anvil
anvil copied to clipboard
rendering issue with list views
Hi,
Thank you for this interesting project. I am using it along with Jedux as state container. I found an issue trying to use a RecyclerAdapter and RendereableAdapter also; whenever I tried to update individual row states (each item) the whole listview gets updated as well making the scroll go all to the beginning.
Thanks in advance :)
Hi, do you cache your adapter instance or do you reuse the same one (e.g. inline it like adapter(new RenderableAdapter() { ...})
? In the latter case the list will be fully refreshed and the scroll position will be reset. In the first case though the list may seem to not be updated at all, so you will have to call notifyDataSetChanged()
from inside your parent view()
method
I cached the adapter on the parent view, and it works for RenderableAdapter() but it keeps updating the whole view for RenderableRecyclerViewAdapter, T_T
Thanks.
I've solved this problem caching the layout manager. I don't know if was the best approach.
See the code here: https://github.com/Catbag/redux-android-sample/blob/c0e5c51b784d73a3d31d384424ac68e0d6f6ef60/app/src/main/java/br/com/catbag/gifreduxsample/ui/components/FeedView.java