recycler-adapter

RecyclerView item not showing ripples/touch feedback when the item has a checkbox

家住魔仙堡 提交于 2019-12-01 05:10:17
I want the items in a RecyclerView to have touch feedback or ripples when pressed, but they seem to not be working, and I think it's because of the checkbox. The ripple is only shown when long pressing, but a simple press won't show it. May someone help me to fix it? Thanks in advance. PD: I was using a ListView, and the item layout parent was a LinearLayout. The ripples were working fine. After moving to RecyclerView, the items ripples don't work. I tried with the LinearLayout again, but still not working. Here's the layout file <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android

Adding a footer view in RECYCLER VIEW?

五迷三道 提交于 2019-12-01 04:44:01
问题 i want to add a footer layout at the base of the recycler view.Below is my adapter view which inflates header layout as well as other items as well.Help appreciated! public class SplitMembersAdapter extends RecyclerViewAdapter<SplitMember, SplitMemberViewHolder> { private final ArrayList<SplitMember> mSplitMembersList; private final ImageLoader mImageLoader; private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; private int splitAmount; private boolean

Set notifyDataSetChanged() on Recyclerview adapter

不羁的心 提交于 2019-12-01 03:57:09
I'm implementing an endless data loading for a RecyclerView. When software detects that last item is going to be shown, it downloads new items and call to the loadMoreData() function but new dataset is not showing. When I called notifyDataSetChanged() so nothing to be happened. I have only one solution that is refresh the view is to set again the adapter but problem is that the recyclerview returns to the first position then again recyclerview scrolled up from the first position to last position. RecyclerViewActivity.java RecyclerView rv; DatabaseHelpr databaseHelpr; RVAdapter adapter;

RecyclerView: how to clear cached/recycled views?

不羁的心 提交于 2019-12-01 02:43:22
I use a RecyclerView to display a list of items with a list layout. I switch from a list layout to a grid layout, showing just a subset of all the data when in grid layout. This switch uses a different layout XML than when list layout is presented. All this works well, except that when I scroll, recycled (cached?) list layout views populate the grid, mixed in with proper grid layout view items. In other words, instead of using my layout_grid.xml for each item's layout in the RecyclerView, I get items using the layout_list.xml layout, but in a grid format. This tells me the LayoutManager is

How to properly set elevation value to recyclerview?

一个人想着一个人 提交于 2019-12-01 02:37:25
I am working on grid layout using recyclerview in android. The grid occupies a portion of the screen and has a shadow. To get the desired shadow effect I am using an elevation value of 12 dp. But it does not seem to work as I cannot see any elevation (shadow) of the grid. Why is this happening? Does recyclerview not support elevation? <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:id="@+id/activity_grid_layout" android:background="

ExpandableTextView in CardView to Open and Close with Click Android

别等时光非礼了梦想. 提交于 2019-12-01 02:03:55
I have a CardView which has ExpandableTextView as Child of CardView when i was clicked on CardView the Expandable Text View expand and also in next click it was closed but the Main Problem is that When I click to Expandable Text View it was expanded and also some of other CardView's Expandable TextView in the RecycleView also expanded without clicked on that CardView. i was searched for the reason but not able to get any proper solution and i am new in development of Material's concept Layout So Please help me in My Following code. Thanks in Advance. The following is my code for RecycleView

Set notifyDataSetChanged() on Recyclerview adapter

五迷三道 提交于 2019-12-01 01:47:25
问题 I'm implementing an endless data loading for a RecyclerView. When software detects that last item is going to be shown, it downloads new items and call to the loadMoreData() function but new dataset is not showing. When I called notifyDataSetChanged() so nothing to be happened. I have only one solution that is refresh the view is to set again the adapter but problem is that the recyclerview returns to the first position then again recyclerview scrolled up from the first position to last

RecyclerView: how to clear cached/recycled views?

女生的网名这么多〃 提交于 2019-11-30 21:34:26
问题 I use a RecyclerView to display a list of items with a list layout. I switch from a list layout to a grid layout, showing just a subset of all the data when in grid layout. This switch uses a different layout XML than when list layout is presented. All this works well, except that when I scroll, recycled (cached?) list layout views populate the grid, mixed in with proper grid layout view items. In other words, instead of using my layout_grid.xml for each item's layout in the RecyclerView, I

ExpandableTextView in CardView to Open and Close with Click Android

核能气质少年 提交于 2019-11-30 20:50:40
问题 I have a CardView which has ExpandableTextView as Child of CardView when i was clicked on CardView the Expandable Text View expand and also in next click it was closed but the Main Problem is that When I click to Expandable Text View it was expanded and also some of other CardView's Expandable TextView in the RecycleView also expanded without clicked on that CardView. i was searched for the reason but not able to get any proper solution and i am new in development of Material's concept Layout

NullPointerException in dissapearence animation of RecyclerView from support v.23.2.0

99封情书 提交于 2019-11-30 20:29:38
In new RecyclerView we can use wrap_content for height (or for width). So Google fixed bug - https://code.google.com/p/android/issues/detail?id=74772 But not all is well in the end. I try to use animation of dissapearence when remove item from RecyclerView. So i use method of Adapter - notifyItemRemoved(int) with any argument and RecyclerView cause NullPointerException. Xml code: ... <RecyclerView android:id="@+id/RecyclerView" android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbars="vertical" android:overScrollMode="always"/> ... Logs: E/AndroidRuntime: