android-recyclerview

how to select and de-select an item in RecyclerView?

自闭症网瘾萝莉.ら 提交于 2019-12-14 01:55:03
问题 @Override public void onBindViewHolder(final mainscreenspecializationadap.MyViewHolder holder, final int positionz) { this.position = holder.getAdapterPosition(); final specializationpojo album = albumList.get(holder.getAdapterPosition()); holder.txtspecs.setText(album.getSplztnname()); holder.imgspecs.setImageResource(album.getIcon()); holder.linelayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { row_index=positionz; album.setOpened(!album

How to detect if Recyclerview item is being swiped?

隐身守侯 提交于 2019-12-14 01:28:02
问题 I am trying to add functionality of swipe to delete as well as to show bottom sheet pop-up if RecyclerView item is long pressed. I am using ItemTouchHelper.SimpleCallback for swipe to delete and ItemTouchListener for showing pop-up on long press of item. Problem is that when I am swiping the item to delete its also detecting long press. What I want is that it should ignore long press when item is being swiped. I have ItemTouchHelper class which extends Simplecallback for swipe to delete.

android:The specified child already has a parent. You must call removeView()

…衆ロ難τιáo~ 提交于 2019-12-14 01:12:07
问题 I have an activity which opens a fragment with view pager. when I change between the tabs I get this error: The specified child already has a parent. You must call removeView() on the child's parent first. I think is the problem is from the header of the RecyclerView and I posted a new question about it here the view pager code is: private void mViewPager(ViewPager viewPager) { ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager()); adapter.addFragment(new a_Frag(),

Android RecyclerView Edittext issue

ぃ、小莉子 提交于 2019-12-14 00:19:30
问题 I'm creating a list of editable items (received from backend). I'm using the "new" recyclerview for this. There a couple of possible viewTypes in my recyclerview: checkbox spinner edittext The problem I'm having is with the EditText gaining focus. AdjustResize kicks in fine and my keyboard is shown. But the EditText that has gained focus isn't visible anymore in the list. (position in the list in the now resized portion is below the visible positions). I don't want to be using AdjustPan in

How to support dpad controls for RecyclerView

感情迁移 提交于 2019-12-14 00:19:04
问题 I am currently trying to port Android mobile app to Android TV. I have a RecyclerView that seems to be displaying correctly in my Android TV app. I am using linearLayout for my RecyclerView. But I don't seem to be able to navigate inside RecyclerView using dpad controls. Any ideas? Here is the concerned xml: <android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/RecyclerView" android

RecyclerView: how to refresh Details Activity?

吃可爱长大的小学妹 提交于 2019-12-14 00:15:44
问题 In MainActivity I have a RecyclerView list of CardView Items. A click on any CardView launches a DetailsActivity CardView that show more data from the database, for that specific CardView. A click on the DetailsActivity CardView launches EditActivity to edit that CardView's data. Clicking the "Save" button returns the user to the DetailsActivity so the user can see any edited changes to that CardView. The model for the CardView Item implements Parcelable so I use getParcelable() to pass the

If there is data in query or Path it show data in FirestoreRecyclerAdapter. but when there is no data at that path

断了今生、忘了曾经 提交于 2019-12-14 00:09:14
问题 I use FirestoreRecyclerAdapter with query. I show the loading till it's not getting into onBindViewHolder() . If it comes to onBindViewHolder then I close the dialog. But in my scenario there is no data into query and its not get into onBindViewHolder so I do not found anyway to close it. Here is my code. Please help. Query query = GlobalApplication.applianceRef.whereEqualTo("applianceType", appType); FirestoreRecyclerOptions < RoomAppliance > response = new FirestoreRecyclerOptions.Builder <

adding mp3 file on recyclerview

走远了吗. 提交于 2019-12-13 23:14:51
问题 Hi I create arecyclerview apps. when I click an item it shows text and image but I want to add r.raw.b mp3 file as a third item. How could I do it? here is detailed activity. How Could I change them? if anyone help, thanks alot.. Bundle mBundle = getIntent().getExtras(); if (mBundle != null) { mToolbar.setTitle(mBundle.getString("Title")); mFlower.setImageResource(mBundle.getInt("Image")); mDescription.setText(mBundle.getString("Description")); here is main page: GridLayoutManager

How to position CardViews next to each other?

风流意气都作罢 提交于 2019-12-13 22:16:33
问题 I want to make Google PlayStore-like-CardView layout . However, I do not manage to put Card Views side-by-side, rather they are being listed Vertically, top down. SCREENSHOT: cardview.xml: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView android:id="@+id/card_view" android:layout_width="150dp" android:layout_height="200dp" android:layout_margin="5dp" android:layout_gravity="center" card_view:cardCornerRadius="2dp" card_view:contentPadding="10dp" xmlns:android="http:/

Android: removing and adding views to a recyclerView properly

自作多情 提交于 2019-12-13 21:38:09
问题 I have a simple RecyclerView that looks like a list, I'm setting each view a diffrent ID, and adding views by clicking on the first view, and removing views when they're clicked (expect the first one). What's not working correctly is when I remove a view and then add another one, the new view's ID breaks the order. The adapter public class AddEventsAdapter extends RecyclerView.Adapter<AddEventsAdapter.ViewHolder> { private List<String> items = new ArrayList<>(); public void addItem(String