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

LinearLayout problem, Pagination recyclerview with DiffUtil & AsyncListDiffer not working

Basically My problem is not with DiffUtil & AsyncListDiffer but the issue is in the LayoutManager item count. Please look at my code: recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public…
0
votes
1 answer

Sticky item content in RecyclerView

What is the best way to stick the content of a recyclerview items to the side of the screen. So that when the element goes off screen its content sticks to the side and goes with its parent only after there is no room in the rest of the element for…
Roman
  • 803
  • 2
  • 10
  • 17
0
votes
4 answers

Attempt to invoke virtual method 'void androidx.recyclerview.widget.RecyclerView.setLayoutManager(androidx.recyclerview..)' on a null object reference

I want to write a good chat application with bottom navigation using Fragments. In ChatsFragment.kt I got a problem: enter image description here My fun onCreateView() in ChatsFragment: override fun onCreateView( inflater: LayoutInflater,…
0
votes
1 answer

Add swipe effiect using recyclerview like inshorts app

I am trying to implement the swipe effect like inshorts and way2news app, So far I can only find the solutions using viewpager and pageradapter. Those are working fine for me but I have to implement the same solution using recyclerview and…
0
votes
0 answers

How to save RecyclerView state in fragments android kotlin

I have a two fragments and one of which contains RecyclerView (the data comes from the Firebase). For example, a user clicks on an item and opens a fragment with a description, and then if he returns back need to save the scroll state of the…
0
votes
1 answer

How do I design my Recycler View to be similar to this design from Chanel App?

I need to design my Recycler View as follows and I need ideas to go around with it. I have some ideas regarding it. I know I would probably need to override a LayoutManager, but I have no idea how to approach that. So I just wanted to ask where or…
che10
  • 2,176
  • 2
  • 4
  • 11
0
votes
2 answers

How to get the views which are not visible currently in the linear layout of the recycler view

I was designing an Instagram story type template. I am stuck at a very weird problem. I have used recycler view in the main activity. MainActivity: (This is just the layout shown. I have change the orientation to Horizontal). My layout: Then I…
0
votes
0 answers

How to make a recyclerView scroll to the top position by clicking menu item?

I need so that if one clicks the menu item "turn All Words On" (look below), then the view scrolls to the top position. How to do this from the onOptionItemSelected() method and what to type there? Appreciate any help. @AndroidEntryPoint class…
0
votes
0 answers

how to know if a certain view item is visible

I was making an app where you get posts on your feed in a recyclerview.I have a text view for the number of views in my listItem layout and i want to update that in real time based on the number of times it was viewed class PostPagingAdapter :…
0
votes
1 answer

Android change height depending on screen rotation /width in Adapter

I have the following layout: Each of the Pokemon Team rows has a fixed size of 100dp :
0
votes
2 answers

RecyclerView.Adapter does not reach onCreateViewHolder when using ViewModelProviders?

My recyclerview is not reaching onCreateViewHolder or getItemCount. I have checked and am sure that my item count isn't 0, I have added breakpoints in the adapter but except the constructor no other method is being called. Questions I have looked…
0
votes
1 answer

How to set the scrollToPositionWithOffset(x,y) of RecyclerView?

I have a RecyclerView fetching data from an API. I am using Volley. I am fetching data in batches of 20 items. I wish to set the scroll position using Linear Layout Manager myLLM.scrollToPositionWithOffset(x,y) so that when next batch of data is…
0
votes
1 answer

RecyclerView inaccurate first completely visible item index if clipToPadding="false"

i have a RecyclerView with top padding and android:clipToPadding="false" when findFirstCompletelyVisibleItemPosition() is called on the RecyclerView's LinearLayoutManager, it returns the index of the first item that would be completely visible if…
0
votes
0 answers

Nested RecyclerViews

I'm creating a calendar app, with each month being displayed using a RecylcerView. Inside each day of each month, there is another RecyclerView to display events on that day. I'm using the custuomLinearLayoutManager from…
0
votes
2 answers

Selected Item on RecyclerView Horizontal Layout keeps hidden behind start of Layout on Android

I'm using a RecyclerView with LinearLayout Manager and Horizontal orientation. It's to be used on a TV app, so it needs to be navigated with the dpad. But whenever I go do the end and come back it get stuck on the last one. See photo: The selected…