anvil icon indicating copy to clipboard operation
anvil copied to clipboard

rendering issue with list views

Open concernedrat opened this issue 8 years ago • 3 comments

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 :)

concernedrat avatar Nov 09 '16 06:11 concernedrat

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

zserge avatar Nov 09 '16 15:11 zserge

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.

concernedrat avatar Nov 10 '16 06:11 concernedrat

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

niltonvasques avatar Nov 13 '16 23:11 niltonvasques