RecyclerView with nested ViewPager2 inside BottomSheet - android

I have RecyclerView inside BottomSheet. It has different kinds of views inside the rows (TextView, MaterialCardView and ViewPager2). This RecyclerView should not scroll vertically while BottomSheet is in the collapsed state - Bottom Sheet should expand on scrolling instead. And this behaviour works correctly when I touching any row of RecyclerView except one that contains ViewPager2. In case of touching the cell of ViewPager2 RecyclerView just scrolls vertically and expending of BottomSheet doesn't happening.

Related

ViewPager within MotionLayout not scrolling correctly

I have a MotionLayout which basically contains an image and a ViewPager. The ViewPager renders a fragment with a RecyclerView in it.
At first the image has normal size, when i drag up, the image reduces its size and the ViewPager (with the RecyclerView within it) expands.
The problem is that the MotionLayout keeps intercepting the scroll action, so if the RecyclerView is expanded, and the user scrolls down, the MotionLayout will expand the image, rather than letting the RecyclerView scroll.
What i would expect is that the MotionLayout will expand the top image only if the RecyclerView has reached the first element, in that case since the RecyclerView cannot scroll anymore, the scroll action would be managed by the MotionLayout.
I am aware that within MotionLayout I can set the attribute moveWhenScrollAtTop="true" to get that behaviour, but that only works if there is just a RecyclerView, but not if the RecyclerView is within a ViewPager.
Has anyone faced this issue?
if your xml file contains nested scrollview just add android:nestedScrollingEnabled="false"

child recyclerview not scrolling when i put horizontal recyclerview inside another horizontal recyclerview

I have a nested recyclerview and both have a horizontal linear layout but the child one is not scrolling
All consequences
1) I'm using a snap helper in the parent recyclerview
2) also using recycler view pool in child recyclerview
It is bad practice to use a Nested RecyclerView with the same LayoutManager.
If horizontal scrolling is important to use for you then try RecyclerView inside ViewPager.
This will behave like this:
When scrolling RecyclerView, Fragment will stick to port until RecyclerView last item is shown. After that the next fragment switchs.

Space appears at the bottom of a Cardview when scrolling

I have a Recyclerview with a Cardview and inside there is another Recyclerview like Netflix. So I cann scroll vertical and horizontal. Insider the inner recyclerview there are some cardviews with buttons. My Problem is if I scroll down and up again, then there apears some Space inside the Carview.
How does this happen?
Start
After Scrolling
Any suggestion or idea is helpful.
Note: Without the Itemdecoration (Page Indikator) it works and no Space appears.

Recyclerview items starts overlapping after its size is changed via ConstraintLayout and ConstraintSet animations

My layout is ConstraintLayout and hierarchy is like this:
There is top view area that takes half of the screen, below that a TabLayout and ViewPager. In this ViewPager there are 3 tabs which contain a RecyclerView. When any RecyclerView is scrolled, top area collapses to 10% of height and ViewPager expands. Due to this RecyclerView expands too. However, after this expansion, RecyclerView items stars overlapping too.
What could be the cause of this?
If you use the ConstraintLayout and enable animation for each item when has changed. Let disable that issue will be resolved.
android:animateLayoutChanges="false"

ViewPager showing Scrolling issue inside RecyclerView

My RecyclerView has 2 type of ViewHolder inside it, one whose parent layout is CardView and another one is ViewPager. My issue is that when RecyclerView scrolls vertically, its stops scroll at ViewPager and can't scroll further on touching ViewPager. If i try to scroll on CardView row it works fine.

Categories

Resources