170 questions
0
votes
1
answer
74
views
Initialization of recycler view using rootViewContext
fun RecyclerView.applyHorizontalDecoration(context: Context, spacing: Int){
with(this){
Log.i("sachin", "$context,,,,,,,, ${rootView.context}")
...
0
votes
0
answers
68
views
Can't get initialPrefetchItemCount to work, or how can I optimize scrolling in RecyclerView?
I have a RecyclerView with a complex layout. It's a vertical list where each item contains a nested RecyclerView with a GridLayoutManager. The inner list can have up to 40 items. Additionally, the ...
0
votes
1
answer
217
views
RecyclerView horizontal linearlayout manager is causing recyclerview not showing
at first my code goes
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvPrices"
android:layout_width="match_parent"
android:layout_height=&...
1
vote
0
answers
323
views
How to change space between rows in FlexboxLayoutManager?
I'm using FlexboxLayoutManager.
How to change space between rows, and space between items on the first row?
class FlexboxLayoutManagerImpl(context: Context, flexDirection: Int) :
...
0
votes
2
answers
40
views
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 ...
-1
votes
4
answers
723
views
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 ...
0
votes
1
answer
45
views
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
1
answer
508
views
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 ...
0
votes
4
answers
3k
views
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 ...
2
votes
1
answer
306
views
Why does LinearLayoutManager.childAt() returns null?
I have a recylcerview where the method shown below gets called on each selection of an item. The method only runs sucessfully when I do not scroll the recyclerview, so the firstvisible is 0. The ...
0
votes
1
answer
204
views
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 ...
1
vote
0
answers
106
views
Animating RecyclerView from Grid to Linear with MotionLayout
Can I animate transition of RecyclerView items from Grid layout to Linear (Horizontal) layout with use of MotionLayout?
I was unable to find any example of that.
My goal is to use RecyclerView in this ...
1
vote
1
answer
274
views
LayoutManager.startSmoothScroll scrolls to wrong position
I have a RecyclerView of goods with categories and HorizontalScrollView of good's categories above it. I am trying to implement the following behavior: when you click on category in scroll view, ...
1
vote
0
answers
183
views
Android : How to add an horizontal Recycler view as list item inside Recycler Grid view list?
I have a Recycler list on which Grid layout Manger set. I want to add an horizontal list (Linear Layout Manager) after 4th position of Grid list as an list item. See iOS sample screen in attachment.
...
1
vote
2
answers
105
views
Change recyclerView scroll position reference
Is there a way to change the scroll counter reference of recyclerView to start from the center of the screen, and not from the beginning?
So that, when I call linearLayoutManager....
0
votes
0
answers
1k
views
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 ...
0
votes
1
answer
81
views
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 ...
1
vote
2
answers
299
views
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 ...
1
vote
0
answers
477
views
why I get onLayoutChildren called every time when onBindViewHolder is called(when add one view)
I'm using my own custome LinearLayoutManager for the RecyclerView.
I need to dynamically add one view if user scroll or move the list by button. When getViewByPosition is called, the onBindViewHolder ...
0
votes
0
answers
150
views
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 ...
0
votes
0
answers
36
views
how to know if a certain view item is visible [duplicate]
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 ...
1
vote
1
answer
301
views
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] ...
0
votes
1
answer
845
views
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 :
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:...
1
vote
2
answers
1k
views
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 ...
0
votes
2
answers
182
views
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 ...
1
vote
1
answer
600
views
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 ...
0
votes
1
answer
1k
views
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....
2
votes
0
answers
481
views
RecyclerView not scrolling top top when new item inserted
I have a RecyclerView which allows swipe-to-delete functionality. After deliting, a Snackbar shows to confirm deletion with an action that allows users to "undo" the delete.
Everything works fine ...
1
vote
0
answers
115
views
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. ...
1
vote
2
answers
456
views
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 ...
0
votes
0
answers
496
views
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 ...
0
votes
2
answers
349
views
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 ...
10
votes
0
answers
624
views
Weird behavior (bug?) with RecyclerView And LinearLayoutManager with reverseLayout == true
When using RecyclerView with LinearLayoutManager and "reverseLayout" flag set to true, when notifying any item via notifyItemChanged it also calls onBindViewHolder for the first non-visible item. And ...
0
votes
1
answer
38
views
error in linear layout.vertical. what should be the exact line
mUserListLayoutManager = new LinearLayoutManager(getApplicationContext(), LinearLayout.VERTICAL, false);
LinearLayout.Vertical is creating a warning
1
vote
1
answer
495
views
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){
...
1
vote
0
answers
563
views
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 ...
1
vote
0
answers
163
views
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 ...
0
votes
1
answer
335
views
Why Recyclerview start scrolling up/down from half of the list?
Actually, I am updating "RecylerView" list adapter based on filter data list. When I update adapter data updated successfully but Scrolling start from half of adapter list.
Does anyone face problem ...
0
votes
2
answers
279
views
Detect when the recyclerview has reached the top most position
I have recyclerview that is used to show the chat. I have set the property of the layoutmanager - stackFromEnd - true which is actually used to reach the bottom of the recyclerview. The issue I am ...
5
votes
3
answers
9k
views
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 ...
1
vote
0
answers
235
views
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. ...
1
vote
3
answers
481
views
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. ...
1
vote
2
answers
286
views
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 ...
0
votes
3
answers
4k
views
Item overlap in recyclerview
I want to overlap first item on second item in recycler view .
this is what I want to achieve:
this is how my recycler view is looking now:
[]
content inside green border is actually a recyclerView ...
0
votes
1
answer
3k
views
How to make a RecylerView like WhatsApp Chat activity?
I building an app which should have a layout almost identical to the one used in WhatsApp in the chat activity. it should have a text input, camera & video recording option. Items should be ...
0
votes
1
answer
1k
views
how to show a bounce effect when scrolling is disabled in a recyclerview?
I have a recyclerview which scrolls horizontally. I have disabled scrolling the recyclerview when user click on an item. Now if the user try to scroll the list when its lock I want to show a bounce ...
0
votes
2
answers
3k
views
How can i fix the error 'java.lang.IllegalStateException: RecyclerView must not be null'
I have a recyclerView where I send data with my adapter but got the error
RecyclerView must not be null
code with my adpater:
class InWaitingFragment : Fragment() {
private lateinit var ...
-1
votes
1
answer
58
views
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 -
@...
0
votes
2
answers
362
views
How do I stop my recyclerview from resetting?
I'm developing a chat UI. When I send a message, it inflates correctly. However, when I send another message, the new message is added at the top of a new screen, instead of below the previous message....
3
votes
1
answer
2k
views
Prefetching view for child recycler view is not working
I have vertical RecyclerView with child(nested) horizontal RecyclerView.
For second recycler I use layout manager:
LinearLayoutManager(itemView.context, LinearLayoutManager.HORIZONTAL, false).apply {
...