update One Recycler view from another RecyclerView? - android

I have two Recycler views inside a LinearLayout in a fragment. one horizontal recycler view at the top of fragment and below that a vertical recyclerview. What i want to do is to add items from the vertical Recyclerview to horizontal Recyclerview by long touching the items.each of Recyclerviews has it's own adapter.how can i add/remove items to/from the top RV and refresh the view at the same time?

Related

Recycler view scrollToPosition scroll item to top of screen

Hi I want to display index at top of recyclerview it when scrollin to it
I tried
Recyclerview.scrolltoPosition(index)
Recyclerview.smoothscrollToPosition(index)
Layoutmanager.scrolltoPosition(index)
even used custom layoutManager and no change .

using recycler view in item of another recycler view with itemtouchhelper

I want to use horizontal recycler view in the item of vertical recycler view but it uses ItemTouchHelper and when I trying to scroll child recycler view, parent item starting swiping instead of scrolling horizontal recycler view
how can I fix that?
Disable swiping for parent recyclerview by not attaching an Itemtouchhelper.

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.

HorizontalScrollView in View Pager

I have view pager with list of child views. Every child is horizontal view. When horizontal view is not active view pager not scroll to the next page. If horizontal view is active then It scrolls horizontally but in horizontal scroll view. I need to scroll to next page of view pager if the horizontal view is not active. So I don't know where to handle this action and how to do it.
The following is a complete example of how to implement a ViewPager with different fragment Types and different layout files.
Try This

How to add views dynamically to Horizontal Scroll View?

I need to have horizontal scroll view, but the number of views in it is not static. Can one dynamically add views to a horizontal scroll view using adapters, just as we can do in a ListView?

Categories

Resources