Questions tagged [linearlayoutmanager]

A RecyclerView.LayoutManager implementation which provides similar functionality to ListView. It was introduced with the Android L Developer Preview along with RecyclerView, but is also available as part of the Support Library.

LinearLayoutManager is an implementation of RecyclerView.LayoutManager which provides similar functionality to ListView, i.e., it arranges items in a linear arrangement, either horizontal or vertical, much like LinearLayout ViewGroup. It was introduced with the Android L Developer Preview along with RecyclerView, but is also available as part of the Support Library.

Official Documentation

Other RecyclerView.LayoutManager implementations:

170 questions
1
vote
1 answer

GridLayoutManager how to display different view type on next row

How to configure GridLayoutManager to display different viewtypes in different rows? For example I have 2 viewtypes and RecycleView displays the following: [category] [category] [category] [category] [item] [item] [item] [item] [item] [item] And…
1
vote
2 answers

How to get the offset of scroll position relative to the current text view's start?

I have a RecyclerView that contains TextViews. The number of TextViews can vary and the size of them vary as well and can be dynamically changed. When the user scrolls to a certain position within the list and exits app, I want to be able to return…
Samuel
  • 395
  • 2
  • 5
  • 20
1
vote
1 answer

unwanted scroll in reverse layout RecyclerView on notifyDataSetChanged

here is the image explaining the problem so that you can understand better Hi friends, I was building a chat module, I have used recycler-view for that with reverse layout (Linear layout manager). I am facing a problem is that whenever I am loading…
1
vote
0 answers

Add Constraint to RecyclerView Item

I would like to implement a horizontal recycler view. I would like to have all the item have the same size. However if I use wrap_content in item layout_height, each item would have different height. How can I enforce recycler view to the max height…
1
vote
1 answer

How to change RecyclerView LayoutManager from List to Grid?

I'm using a ViewPager in which I have a RecyclerView, in this RecyclerView I want to change the LayoutManager from List to Grid. I've implemented this code: void setLManager(boolean managerL){ GridLayoutManager glManager = new…
1
vote
0 answers

Workaround for RecyclerView height measurement with horizontal LinearLayoutManager

Problem I want to have a RecyclerView with width=match_parent and height=wrap_content. I need to display items horizontally so I use a proper LinearLayoutManager. I face a problem with a RecyclerView behaviour. The items of my list have different…
1
vote
0 answers

Custom spacing between recyclerview items

I need to display items similar to a hamburger. Each element has a different height, but the distance between them should be always the same. I tried to use LinearLayoutManager, but spaces between items were too big. I created custom…
1
vote
0 answers

RecyclerView.SmoothScroller isn't smooth at first use

I am trying to scroll my RecyclerView smoothly to certain item position at the initialization of the list and do it so that the item is displayed at the top. To do so I am using LinearSmoothScroller. But it doesn't work on first use. On first scroll…
1
vote
3 answers

Recyclerview listitem layout gravity issue

This is the chat bot. Some messages are left aligned and some are right aligned. Left aligned messages are working fine but right aligned messages also get left aligned. This is the required listitem. layout_gravity to be on the right. But when…
1
vote
2 answers

Nudge a paged recyclerview to hint at next page without switching

I'm using a horizontal recyclerview with a LinearLayoutManager and a PagerSnapHelper and each viewholder/page is fullscreen and snaps to the window so only one page is viewable once settled. Like most fullscreen swipeable tabs. When inserting a new…
1
vote
0 answers

How to implement carousel effect for recylerview

I'm trying to implement the carousel-like effect in recyclerView like this. I can't find the right function for scaling and moving the views. Also, the views that reached the top of recyclerview must not scroll out of recyclerview's edges but stick…
1
vote
0 answers

RecyclerView smoothScrollToPosition(lastItem) scrolls to bottom where last item is partially visible

Im working on chat type screen where new text msg item is added in list and recyclerView is scrolled to last position of the list but the last item is partially visible, and does not scroll till end of bottom when the keyboard is open. I have added …
1
vote
0 answers

AndroidX Horizontal RecyclerView wrap_content not working?

RecyclerView horizontal was worked in support library. after converting to androidx is not working when using the wrap_content. My layout looks like this
1
vote
0 answers

How to save/restore value on CustomLayoutManager?

Currently, I am using custom LinearLayoutManger(StackLayoutManager) which save and retrieve some int value for my RecyclerView as below code, @Override public Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); …
1
vote
4 answers

Save Position of RecylerView when we go to Detail Activity by clicking from list of items in RecyclerView and restore it when we back to RecylerView

How to Save Scroll Position of RecylerView Activity when we go to next Detail Activity by using itemclicklistener from list of items(these items are retrieved from Firebase JSON) in RecyclerView and restore position when we come back to Recylerview…