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
0
votes
2 answers

Recyclerview not able to control view

I am using a RecyclerView with LinearLayoutManager thats horizontal. I am displaying 3 items per view and using endless scrolling. My issue is that they're 3 images and I want the middle image to be enlarged by 2X but I can't get control of the…
0
votes
1 answer

Unable to cast LinearLayoutManager to GridLayoutManager

if (mLayoutManager instanceof GridLayoutManager) { ((GridLayoutManager) mLayoutManager).setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { @Override public int…
0
votes
1 answer

RecyclerView LayoutManager - force to keep a view even if not visible

I am animating views between two RecyclerView. The first one is something like a list of folders showing the first item as cover, clicking it opens a new view showing the folders content animating the cover to the first item. Clicking back animates…
prom85
  • 16,896
  • 17
  • 122
  • 242
0
votes
1 answer

List item views not correctly appearing in Linear RecyclerView

Hello I have a horizontal recyclerView that should display a picture and below it a name. I can't get this to work as the image views appear of different sizes, even though they have fixed dimensions, and the text below is either not visible or…
0
votes
1 answer

Horizontal RecyclerViews inside Vertical RecyclerView losing position/state

I have a vertical recyclerview, eatch item of the vertical recyclerview have a horizontal recyclerview, all items of the horizontal recyclerview have diferent withs and the same height, i'm scrolling the recycler programatically with distances in…
0
votes
0 answers

Different types of rows in RecyclerView

I receive data (an object with few elements inside) from a server and I want to show it in RecyclerView. Each object could contain 2, 3, 4.. or even 18 elements (as on the picture): I know how to create different types of rows from pre-created XML…
0
votes
1 answer

How to change icon using list to grid

I am changing list to grid and grid to list using StaggeredGridlayoutmanager, but i want to change icon while changing the view,,like if view is in list mode i want to display grid icon and and view is in grid mode i want to display list mode case…
0
votes
1 answer
0
votes
1 answer

Android: Custom LinearLayoutManager not allowing recyclerView to scroll

I am using a custom LinearLayoutManager to disable/enable scrolling for my recyclerView. public class CustomLayoutManager extends LinearLayoutManager { private boolean isScrollEnabled = true; public CustomLayoutManager(Context context) { …
rahul
  • 6,447
  • 3
  • 31
  • 42
0
votes
1 answer

LinearLayoutManager prepareForDrop not fired

I'm trying to catch the point when a Recyclerview item is dropped after a drag&drop operation, e.g. to read out the coordinates. Thought that prepareForDrop event of LinearLayoutManager would be the right thing for that: public class…
0
votes
1 answer

How to get non focused recyclerview item using position android

I want to update the recyclerview adapter item's textview value dynamically with some data. For that i'm doing this way: View mRecyclerView = linearLayoutManager.getChildAt(viewPosition); TextView textView=(TextView)…
Manikanta
  • 3,421
  • 4
  • 30
  • 51
-1
votes
4 answers

LinearLayoutManager(this) in Fragment Kotlin

I'm learning Kotlin in Adroid Studio and recently I have stuck on RecyclerView. The problem is that I'm not able to go forward due to error showing on LinearLayoutManager(this). My little code looks like: package com.store.example …
-1
votes
1 answer

findFragmentById on back button becomes blank as size becomes zero

Here's my Flow/Structure: Activity Fragment Same Fragment within it. I have overriden removeCurrentFragment() method which does go back functionality by removing Fragment by ID as follows - @Override public void removeCurrentFragment() { …
-1
votes
2 answers

How to force recyclerview to have dynamic height changing items?

Actually I'm trying to use recyclerview as a viewpager which is working fine by the help of PagerSnapHelper() class . But now the problem is how can I force recyclerview to change item heights dynamically and not show white space . Now when I try to…
Srinivas Nahak
  • 1,846
  • 4
  • 20
  • 45
-1
votes
2 answers

Android Recyclerview : change row from linear to grid on button click

On button click I want to change list view to gridview as on shopping-cart pages but my layout looks like link shown below. //For displaying the row as linear list view case R.id.ivGrid: ivList.setVisibility(View.VISIBLE); …
1 2 3
11
12