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:

160 questions
7
votes
5 answers

Android LinearSnapHelper - how to increase scrolling/"snapping" speed?

I'm using a LinearSnapHelper to make items in my RecyclerView "snap" into place on the screen (my cards take up most of the screen, so I want them to snap into place and fill the screen on every swipe/fling/scroll). I'm struggling with how to make…
user1743027
7
votes
2 answers

RecyclerView: Set scroll position so that item appears at the bottom of the view

I have a RecyclerView with a LinearLayoutManager that is backed by an adapter with items of different height. Is there a way to tell the RecyclerView to set the scroll position so that item X appears (more or less) exactly at the bottom of the…
Kirill Rakhman
  • 35,458
  • 17
  • 110
  • 133
6
votes
3 answers

Android - What is Layout Manager?

I have seen many types of layout managers like: LineraLayoutManager RecyclerView.LayoutManager ListViewLayoutManager etc What actually LayoutManager is and why it is used and what are the different types of LayoutManagers? Do in android all UI…
6
votes
1 answer

onScrolled being called without the user scrolling (Recycler View endless scroll)

Tried all the related questions but it did not work :( I am building endless scrolling with Recycler View. PROBLEM: onScrolled method is always called without the user scrolling the screen. Android Documentation Guide describes this for onScrolled…
Soon Santos
  • 1,747
  • 12
  • 26
6
votes
1 answer

Unwanted bounce effect on RecyclerView with SnapHelper

I am using a RecyclerView with a Horizontal LinearLayoutManager. recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL,false)); For the adapter items to snap at the center, I've attached a LinearSnapHelper to…
rush
  • 373
  • 4
  • 13
6
votes
3 answers

RecyclerView LinearLayout manager always returns -1 in landscape mode - findLastCompletelyVisibleItemPosition()

I'm using findLastCompletelyVisibleItemPosition() to determine the last visible item in my RecyclerView. Here is a code snippet of how I'm setting up my layout: mRecyclerView.setHasFixedSize(true); LinearLayoutManager mLayoutManager = new…
6
votes
0 answers

RecyclerView with LinearLayoutManager and predictive animations

I am building a relatively simple RecyclerView, using a vertical LinearLayout Manager and a DefaultItemAnimator. It would only handle adding and removing items (no animated changes, swaps, moves, etc) My items would be added at specific positions in…
5
votes
2 answers

RecyclerView with start offset

I want that my first element in recycler view have offset by start list. I try use void onCreate(Bundle savedInstanceState){ ... linearLayoutManager.scrollToPositionWithOffset ... } But it not work. I undestand that i can use empty view how…
5
votes
0 answers

Android - Performance issue on RecyclerView inside a NestedScrollView

I have a NestedScrollView in which RecyclerView and a RelativeLayout lies inside.. It's basically this way //To contain the stuffs inside // Contains a `TextView` and a `ProgressBar` …
Kevin Murvie
  • 2,240
  • 1
  • 18
  • 38
5
votes
1 answer

How to change position of items in RecyclerView programmatically?

Is there a way to move a specific item to a specific position in RecyclerView using LinearLayoutManager programmatically?
Anh Phạm
  • 95
  • 1
  • 2
  • 10
4
votes
0 answers

How to know when recyclerview smoothscroll ends

Overview: The recycler view has a horizontal layout manager, in that linear layout manager i override the canScrollHorizontally method, so that the user can not scroll by himself. Also i have a RecyclerView.SmoothScroller to change visible item…
4
votes
2 answers

RecyclerView with reverseLayout "jumps" upon notifyDataSetChanged

I set my recyclerView's layoutManager like this: recyclerView.layoutManager = LinearLayoutManager(context, HORIZONTAL, true) The last parameter sets the reverseLayout to true which means it will be loaded from right to left. I need this because I…
Michał Klimczak
  • 11,170
  • 7
  • 55
  • 92
4
votes
0 answers

LinearLayoutManager's scrollToPositionWithOffset with smooth animation?

I'm working with a RecyclerView and I want the clicked item to be scrolled to the top of the RecyclerView. I tried the smooth scrolling methods from RecyclerView but none of them work as I expect. The only one working is scrollToPositionWithOffset…
moyo
  • 492
  • 6
  • 22
4
votes
2 answers

Added View has RecyclerView as parent but view is not a real child

I have an issue appears sometimes when content of RecyclerView is changes. I have search view that filters data of RecyclerView. After filtering I call notifyDataSetChanged(); I use this as adapter. I was thinking that issue related with adding…
4
votes
0 answers

RecyclerView redraw content on onLayoutChildren()

I'm using a custom LayoutManager for RecyclerView (FlowLayoutManager) that is working fine and this is the function used for laying out the children: @Override public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State…
Gilad Eshkoli
  • 1,203
  • 10
  • 27
1
2
3
10 11