android-recyclerview

how to implement pagination in RecyclerView on scroll

此生再无相见时 提交于 2019-12-25 04:27:32
问题 recyclerview comes with its own scroll listener having below methods : void onScrollStateChanged(RecyclerView recyclerView, int newState) Callback method to be invoked when RecyclerView's scroll state changes. void onScrolled(RecyclerView recyclerView, int dx, int dy) Callback method to be invoked when the RecyclerView has been scrolled. Is there any way to trigger loader to load more data when scroll reaches end of the list? I have implemented this way: @Override public void onBindViewHolder

NullPointerException at RecycleView

谁说胖子不能爱 提交于 2019-12-25 03:46:05
问题 i've been trying to use the TwoWay lib for a horizonal listview implemention, so i got the RecycleView lib and the TwoWay, but at both run time and the xml i receive this Exception : 09-21 01:46:52.148: E/AndroidRuntime(12471): FATAL EXCEPTION: main 09-21 01:46:52.148: E/AndroidRuntime(12471): java.lang.NullPointerException 09-21 01:46:52.148: E/AndroidRuntime(12471): at com.lifemate.lmmessenger.recycleview.RecyclerView.onMeasure(RecyclerView.java:1346) 09-21 01:46:52.148: E/AndroidRuntime

NullPointerException at RecycleView

时间秒杀一切 提交于 2019-12-25 03:46:03
问题 i've been trying to use the TwoWay lib for a horizonal listview implemention, so i got the RecycleView lib and the TwoWay, but at both run time and the xml i receive this Exception : 09-21 01:46:52.148: E/AndroidRuntime(12471): FATAL EXCEPTION: main 09-21 01:46:52.148: E/AndroidRuntime(12471): java.lang.NullPointerException 09-21 01:46:52.148: E/AndroidRuntime(12471): at com.lifemate.lmmessenger.recycleview.RecyclerView.onMeasure(RecyclerView.java:1346) 09-21 01:46:52.148: E/AndroidRuntime

NestedScrollView with ImageView and Recycler view

百般思念 提交于 2019-12-25 03:43:04
问题 The Recycler view gets scrolled inside imageview and imageview stays stationary.My requirement is to scroll both the views when recyclerview is scrolled.The xml I have written is given below: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" xmlns:app="http://schemas.android.com/apk/res-auto" app:layout

How to display image and text from Cardview in another activity onClick?

点点圈 提交于 2019-12-25 03:42:49
问题 I have a sample app from exoguru which contains cardview each card consists of an image and corresponding text .Now how to display that image and text in another activity on clicking that particular card? Here is the screenshot Here is the ViewHolder which contains the onclick for the cardview class ViewHolder extends RecyclerView.ViewHolder{ public ImageView imgThumbnail; public TextView tvNature; public TextView tvDesNature; public ViewHolder(View itemView) { super(itemView); imgThumbnail =

Using only one Fragment with RecyclerView for multiple TabLayout , not updating data correctly on tabs change

孤街浪徒 提交于 2019-12-25 03:27:13
问题 There is a question similar to me, but that solution didn't work for my case. The question I have referred is this I have a fragment named "HomeFragment" which consists of a VieWPager and TabLayout. I am adding tabs dynamically from the backend. So I am using another Fragment named "SecondFragment" for all tabs since all tabs contain a RecyclerView only. I am populating the RecyclerView onCreate() of the SecondFragment. My issue comes here that when I swipe or change the tab, the RecyclerView

Using only one Fragment with RecyclerView for multiple TabLayout , not updating data correctly on tabs change

不羁的心 提交于 2019-12-25 03:27:02
问题 There is a question similar to me, but that solution didn't work for my case. The question I have referred is this I have a fragment named "HomeFragment" which consists of a VieWPager and TabLayout. I am adding tabs dynamically from the backend. So I am using another Fragment named "SecondFragment" for all tabs since all tabs contain a RecyclerView only. I am populating the RecyclerView onCreate() of the SecondFragment. My issue comes here that when I swipe or change the tab, the RecyclerView

How to perform programmatic click on a item in a RecyclerView?

有些话、适合烂在心里 提交于 2019-12-25 03:21:56
问题 Hi I have a app that uses a Recycler view to display a bunch of items. Now I want to run an android test on the list but I don't know how to set a programmatic click on a given item. Can anyone tell me how to achieve this? 回答1: You have to implement it from scratch. The RecyclerView lacks for some of the awesome features that a ListView provides by default. Given this, in the adapter you have to declare an interface for the Observer between Fragment/Activity and the RecyclerView. The correct

Custom fragment transition parent-to-child navigation setExitTransition not showing

烈酒焚心 提交于 2019-12-25 03:14:43
问题 Background I've been trying to get parent-to-child navigational transition implemented (specifically for recyclerview items -> detail fragment). I'm currently using sharedElementTransitions with the item container and detail container as the sharedElement along with ChangeTransform and ChangeBounds transitions. The detail fragment's enter transition is mostly working. However, I am having problems with the recyclerview item's exit transition. What I want to do is have the recyclerview dim

change RecyclerView item to be above all others

好久不见. 提交于 2019-12-25 02:16:05
问题 I have horizontal recyclerView that contains images as items. How can I detect when a RecycleView item is in the center of the screen and emphasize it to be something like this : Example : 回答1: You could use the carousel logic with RecyclerView combination and SnapHelper compatibility class like this: <android.support.v7.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="wrap_content" android:fadingEdge="horizontal" android