android-recyclerview

wrong item changes in recyclerview

孤人 提交于 2019-12-30 11:26:07
问题 Hi everyone I'm stuck in this and need help : Each item has a CheckBox and I set setOnLongClickListener for root element of my items in RecyclerView like this : holder.faviorateVideoItemRelative.setOnLongClickListener(new View.OnLongClickListener() { public boolean onLongClick(View arg0) { if (chk_visible) { return true ; } holder.chk_faviorateVideo.setChecked(!holder.chk_faviorateVideo.isChecked()); chk_visible = true ; checkedItemsCNT = 1 ; deleteListVideoCourses.add(data.get(holder

RecyclerView in React Native: notifyItemInserted() and notifyDataSetChanged() have no effect

喜夏-厌秋 提交于 2019-12-30 11:12:25
问题 I am experimenting with integrating a Firebase-backed RecyclerView in a React Native app. With hardcoded data it works well, but upon inserting rows loaded dynamically and calling either notifyItemInserted() or notifyDataSetChanged() on the RecyclerView.Adapter, the RecyclerView itself does not reflect the change. This manifests as an initial blank view until the app's refresh button is tapped, which has the sole effect of re-rendering the RecyclerView from the React Native side, or until

EditText values in a RecyclerView gives same value after 5th position

浪子不回头ぞ 提交于 2019-12-30 11:04:58
问题 I have a RecyclerView and each row has a EditText also. I am adding item to RecyclerView by searching them and then I type the quantity in the edit text. Then I send it to the server to store using json format. Item add is working perfectly. There is no edit text value swapping problem also when scrolling. I can display 5 rows in the screen. Problem is when I send item to the server, edit text values in bottom rows get the same after 5th row. These are the rows I am adding to the recyclerview

EditText values in a RecyclerView gives same value after 5th position

不想你离开。 提交于 2019-12-30 11:03:16
问题 I have a RecyclerView and each row has a EditText also. I am adding item to RecyclerView by searching them and then I type the quantity in the edit text. Then I send it to the server to store using json format. Item add is working perfectly. There is no edit text value swapping problem also when scrolling. I can display 5 rows in the screen. Problem is when I send item to the server, edit text values in bottom rows get the same after 5th row. These are the rows I am adding to the recyclerview

How to reflow items in a RecyclerView with the StaggeredGridLayoutManager

北城以北 提交于 2019-12-30 10:35:14
问题 I'm playing around with the StaggeredGridLayoutManager and have something close to what I want. I have a horizontal staggered grid with 2 rows, where some items are the height of 1 row, and others span both rows. I want the single row height items to stack up and I thought that could be achieved by setting the gap strategy to GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS, but this does not appear to work. Current: ___ ___ ___ ___ |___| | | |___| | | | | | | |___| |___| What I want: ___ ___ ___ |___|

View in RecyclerView does not match parent width

不问归期 提交于 2019-12-30 09:29:29
问题 I have a horizontal recyclerview : <android.support.v7.widget.RecyclerView android:id="@+id/rvRecommendedVendors" android:scrollbars="none" android:layout_width="match_parent" android:layout_height="225dp" android:visibility="visible" android:layout_below="@+id/llRecommendedVendors" android:overScrollMode="never" android:background="@color/dark_blue" /> It has an item: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android

Retrofit,onResponse method doesnt work

寵の児 提交于 2019-12-30 07:48:13
问题 Im new in Retrofit,try to get data from one web server,create Model,Interface but this still not working.Problem(maybe) in method onResponse() I add to that method Log.d and Toast but I dont see Log and Toast when launch my app.Why that dont work? I can understand when I get wrong response or something else,but onResponse() dont work in general,how I think.Maybe Toast cant work withoud data,but Log.d must work without it,and Log.d havent data,just code of response. I added all depencies and

How to apply setItemChecked(position,true) with RecyclerView in Android?

試著忘記壹切 提交于 2019-12-30 06:18:11
问题 I am developing a Material Design Navigation Drawer. I've created a new class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener in it to handle the user's click on the list items. I use the class this way within the MainActivity class' onCreate method: mRecyclerView.addOnItemTouchListener( new RecyclerItemClickListener(this, mRecyclerView, new RecyclerItemClickListener.OnItemClickListener() { @Override public void onItemClick(View view, int position) {// do whatever if

RecyclerView inside NestedScrollView onBindViewHolder calling for all getItemCount size

不想你离开。 提交于 2019-12-30 06:09:13
问题 When I put RecyclerView inside NestedScrollView then onBindViewHolder is calling for all row like say I have list which has size of 30 then onBindViewHolder is called for all 30 rows at one time even without scrolling RecyclerView list; LinearLayoutManager layoutManager = new LinearLayoutManager(getContext()); list.setLayoutManager(layoutManager); layoutManager.setAutoMeasureEnabled(true); list.setNestedScrollingEnabled(false); list.addItemDecoration(new VerticalSpaceItemDecoration(5)); list

“RecyclerView: No Adapter attached; skipping layout” for recyclerview in fragment [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-12-30 06:07:17
问题 This question already has answers here : recyclerview No adapter attached; skipping layout (30 answers) Closed 3 years ago . I'm getting this error but I don't know what is causing it...perhaps something to do with the fact that this is being initialized in a fragment and not in the activity itself. Edit: included StatsAdapter code public class StatsFragment extends Fragment { private RecyclerView mRecyclerView; private LinearLayoutManager mLinearLayoutManager; private RecyclerView.Adapter