Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude item from update #321

Closed
royhenengel opened this issue Mar 22, 2017 · 2 comments
Closed

Exclude item from update #321

royhenengel opened this issue Mar 22, 2017 · 2 comments
Milestone

Comments

@royhenengel
Copy link

Hi, I already have an open ticket, but since the is a separate question, I thought I would open a new one.
I have a recycler view with multiple item types. One of these types is DFP banners.
These specific items don't play well with a recycler view. Hence I would like to exclude them from updating.
Is there any way to do so?
Thank you

@davideas
Copy link
Owner

@henengel, I was thinking something similar to your proposal: a new method for the item interface so it will get update if requested, but I need to review how the update is made, because now you get updates caused by headers redisplayed at the end of the process.

You can however try this:
Be sure to use unique id for all of your items, so you can enable stableIds in the Adapter constructor. Did this you can call updateDataSet(new items) with single notification disabled (animate = false by default) which means notifyDataSetChanged is invoked but RV is still able to recognise the unique id and notify only those changed.

@royhenengel
Copy link
Author

I think using stable id's did the trick.
Again thank you very much.
I have quite a unique use case of your adapter. (7 view types with DFP integrated and other goods).
If you would like to use it in order to improve your project or/and you need more information about the issues open in ticket #314 , don't hesitate to contact me.
I hope I won't have to bother you again.
Have a good one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants