I have a RecyclerView with multiple item types:
Type 1: RecyclerView of games.
Type 2: RecyclerView of apps.
Type 3: Horizontal RecyclerView of categories.
Type 4: RecyclerView of items with pagination and dynamic content based on category.
I want to implement two functionalities:
Stick Type 3 to Top on Scroll: When scrolling through the RecyclerView, if the user reaches Type 3 items, I want them to stick to the top of the screen.
Update Type 4 Data on Chip Click: When a user clicks on one of the category chips, I want to update the data displayed in Type 4 accordingly.
I have a specific issue:
When I change the category, I use notifyItemRangeRemoved for Type 4 items. However, this action causes the RecyclerView to auto-scroll to the top. I want to maintain the scroll position after the category change.
Please suggest any idea. Thanks in advance.
image
Rebecca is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.