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

How to Access newly added view from linearlayout manager

I am making a chat application . I have a Layout manager which extends LinearLayoutManager and i want to compute the height of the view added to the adapter so that when i call smoothScrollToPosition() then i could change the scroll speed. For more…
Ezio
  • 723
  • 6
  • 14
1
vote
1 answer

SaveInstanceState of RecyclerView

this is my data List data = new ArrayList<>(); LinearLayoutManager llm = new LinearLayoutManager(this); MyAdapter mAdapter; RecyclerView recyclerView; and this is my recycler view in OnCreate method recyclerView = (RecyclerView)…
1
vote
1 answer

Getting gaps between recyclerview items after scrolling down and then scrolling up again. Please see details

I have a RecyclerView in which I'm loading some items from the database. The problem is that I'm getting some gaps between the items after scrolling down and up again. The gaps then remain there until I restart the app. Like this: Here's how I have…
1
vote
4 answers

Items added to RecyclerView are not shown on bottom

I have a RecyclerView which im using to display messages, in a text app type way. By that I mean, new messages added to the RecyclerView should appear on the bottom. Currently, im using .setStackFromEnd(true) on my LinearLayoutManager to make…
Orbit
  • 2,985
  • 9
  • 49
  • 106
1
vote
1 answer

Getting Flickering Effect When Showing Horizontal RecyclerView inside Vertical RecyclerView

I have a Vertical RecyclerView, and this vertical RecyclerView's each item contains Horizontal RecyclerView. so I have done this and working fine except the performance factor, when I scroll the Vertical RecyclerView the vertical list flickers and…
1
vote
0 answers

How to know when RecyclerView has a new LayoutManager?

When we want to change the view from Linear to Grid and viceversa we use recyclerView.setLayoutManager(layoutManager). But how do we know that a new LayoutManager is set? I've seen we have the method LayoutManager.onAttachToWindow(rv) and that this…
1
vote
1 answer

Horizontal RecyclerView not wrapping layout

Each item should cover 70% of the screen width. Though 70% of the screen is filled, I am getting 30% of blank space and next item is starting after it. Here is the layout -
mihirjoshi
  • 12,161
  • 7
  • 47
  • 78
1
vote
1 answer

Scroll | Always enter collapses the system taskbar, and not my toolbar

I used this as my XML file. I want to collapse the toolbar when I scroll, keeping the tab bar fixed, but the system taskbar collapses, and not the toolbar.
1
vote
3 answers

RecyclerView with null pointer exception

I am getting some news data from my CMS,and want to display them in a RecyclerView.The problem is that I am getting a null pointer exception in the line where I using the LinearLayoutManager. Here is the logcat output. Caused by:…
Theo
  • 3,099
  • 12
  • 53
  • 94
1
vote
3 answers

RecyclerView with different spanCount for each row

Is there any way to get a RecyclerView with different spanCount for every row depends on how many items can fit in a row ? Meaning when there is no more width to fit new item, it will break into a new row. I've attached a photo so you can see what I…
1
vote
1 answer

Android LinearLayoutManager and relocation on item removal

LinearLayoutManager provides a basic implementation for relocating items in the recycler. Assuming the following configuration in recyclerView: E0 | E1 E2 E3 | E4 where | represents the effective bounds of recyclerView, a delete on E1 will result…
Marco Righini
  • 506
  • 2
  • 12
1
vote
1 answer

Vertical LinearLayoutManager Crashes App

So I am using two RecyclerViews in a fragment in my android app. One of them scrolls horizontally and the other scrolls vertically. Yet for some strange reason the vertical one always crashes with the following error: java.lang.NullPointerException:…
0
votes
2 answers

How to hide only one clicked item title from a horizontal LinearLayoutManager based RecyclerView

I am using horizontal LinearLayoutManager to create a horizontal list on my RecyclerView as shown in the picture below My purpose is to hide the RecyclerView item title when I click on it. But when I click for example on the first item title to…
0
votes
1 answer

DividerItemDecoration vs LinearLayoutManager in android recyclerview

can anyone explain the difference between DividerItemDecoration and LinearLayoutManager? when should i use DividerItemDecoration and when should i use LinearLayoutManager in recycler view?
0
votes
0 answers

How to fill RecyclerView equally with LinearLayoutManager in XML?

I have a huge thing that I cannot understand! Hoping on your help! Example: 6 children are Equally filled in RecyclerView by height with GridLayoutManager. But I need LinearLayoutManager(Don't ask me why, it doesn't matter). Example using…