android-recyclerview

How does Android Paging Library know to load more data?

走远了吗. 提交于 2019-12-18 20:29:11
问题 Iʼm fairly new to developing Android apps and Iʼm trying to do everything “the right way.” So right now, Iʼm implementing the new Android Paging Library into my project, where I need to load a list of articles from a network server. I have an ArticlesRepository class that returns an ArticleList class containing instances of ArticleListItem that I would like to display in a RecyclerView. The list of articles is paginated already on the server, so the repository sends a request for the first

Nested RecyclerView like Google Play Store App

≯℡__Kan透↙ 提交于 2019-12-18 19:42:43
问题 I am currently working on replicating the UI pattern implemented in the Play Store App. For implementing such a behavior, I have used a Vertical RecyclerView as outer view and added a horizontal RecyclerView inside the adapter of the outer Vertical RecyclerView . The problem I am currently facing is while the outer RecyclerView is scrolling, the inner horizontal RecyclerView cannot catch the scroll event on it, but when the outer RecyclerView is not scrolling, we can scroll the horizontal

Nested RecyclerView like Google Play Store App

萝らか妹 提交于 2019-12-18 19:41:52
问题 I am currently working on replicating the UI pattern implemented in the Play Store App. For implementing such a behavior, I have used a Vertical RecyclerView as outer view and added a horizontal RecyclerView inside the adapter of the outer Vertical RecyclerView . The problem I am currently facing is while the outer RecyclerView is scrolling, the inner horizontal RecyclerView cannot catch the scroll event on it, but when the outer RecyclerView is not scrolling, we can scroll the horizontal

How to properly set elevation value to recyclerview?

佐手、 提交于 2019-12-18 18:54:33
问题 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"

Previewing horizontal recyclerview in android studio

我与影子孤独终老i 提交于 2019-12-18 18:33:15
问题 I found out how to preview a list item by using tools:listitem="@layout/my_item_layout" Android studio however is previewing the recyclerview as a vertical list. Is there a way to tell Android Studio to display the layout preview in a horizontal fashion using LinearLayoutManager ? 回答1: Add a LayoutManager and set a horizontal orientation. Here an example: <android.support.v7.widget.RecyclerView android:id="@+id/homesRecyclerView" android:layout_width="match_parent" android:layout_height="wrap

Error inflating class <unknown> - Android

旧巷老猫 提交于 2019-12-18 17:45:10
问题 I am working on an Android App , Here I am working with RecyclerView . I have an item.xml for RecyclerView . item.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cardView="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/userpopstcardview" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android

How to show day/date above of a group of items in Android RecyclerView

青春壹個敷衍的年華 提交于 2019-12-18 13:48:23
问题 Hello I'm getting data in the JSONArray as: { "chatArray": [ { "msg_id": "193", "user_id": "15235", "first_name": "Vishal", "user_name": "vishal13", "message": "twilio", "chat_time": "2017-06-30 11:28:00" }, { "msg_id": "192", "user_id": "15321", "first_name": "Rohit", "user_name": "rohit12", "message": "how are you?", "chat_time": "2017-06-30 11:28:00" }]} I'm showing complete data in a RecyclerView and now my requirement is that I want to show header of their days above of them like

horizontal recycler view with horizontal scroll [duplicate]

放肆的年华 提交于 2019-12-18 13:23:32
问题 This question already has answers here : How to build a Horizontal ListView with RecyclerView? (12 answers) Closed 2 years ago . Im learning android and I cant seem to find a way to do this: I would like to do the right to left scroll with what I guess would be a recylcer view, but not sure if its this. I just need someone to point me in the right direction. I guess i would need an interior layout for the recyclerview. If someone could point me where to figure this out I would be so greatful!

Stop AppBarLayout scrolling off screen when NestedScrollView is empty

我的梦境 提交于 2019-12-18 12:57:14
问题 I have a fairly typical List functionality using a CoordinatorLayout, AppBarLayout, SwipeRefreshLayout and RecyclerView - When the RecyclerView has enough content to scroll, the page seems fine. When the RecyclerView is empty or doesn't have enough content to scroll however, the behavior is that the AppBarLayout children with app:layout_scrollFlags="scroll|enterAlwaysCollapsed" will continue to scroll - which looks odd. Is there a way to stop the AppBarLayout children scrolling when the

Espresso, scrolling not working when NestedScrollView or RecyclerView is in CoordinatorLayout

老子叫甜甜 提交于 2019-12-18 11:52:44
问题 It looks like CoordinatorLayout breaks the behaviour of Espresso actions such as scrollTo() or RecyclerViewActions.scrollToPosition() . Issue with NestedScrollView For a layout like this one: <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_behavior="@string/appbar_scrolling_view_behavior"> ...