FlexibleAdapter: Item content not updating when animating updateDataSet
Hi David, how are you š ? I think I found a bug/issue that was supposed to be fixed, but still isnāt. I read in this repository issues several tickets (#210ā¦) that resemble mine, not sure if related.
Issue: When updating the dataset with adapter.updateDataSet(new ArrayList<>(items), true), the content of the items donāt update.
Used code:
private void initFeed() {
/* Get recyclerView from layout */
mRecyclerView = (RecyclerView) getView().findViewById(R.id.recyclerViewMain);
/* Save views to cache to prevent reload of them*/
mRecyclerView.setItemViewCacheSize(80);
mRecyclerView.setHasFixedSize(true);
/* Create the adapter */
mAdapter = new FlexibleAdapter<>(new ArrayList<>(mResults));
/* Create pre cache layout manager to load views before displayed to user */
PreCachingLayoutManager layoutManager = new PreCachingLayoutManager(mContext, GeneralUtils.getInstance().getScreenHeight() * 2);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
/* Set adapter */
mRecyclerView.setAdapter(mAdapter);
/* Set StickyHeaders */
mAdapter.setDisplayHeadersAtStartUp(true).setStickyHeaders(true);
}
public void onDataChange(final ArrayList<IFlexible> newResults) {
/* Save scroll position */
Parcelable recyclerViewState;
recyclerViewState = mRecyclerView.getLayoutManager().onSaveInstanceState();
mAdapter.updateDataSet(newResults, true);
/* Restore scroll position */
mRecyclerView.getLayoutManager().onRestoreInstanceState(recyclerViewState);
/* Set new results to default */
mResults = newResults;
}
Solutions tried:
- I changed the dependency to your snapshots (where if I understood correctly this issue was supposed to be fixed):
repositories { jcenter() maven { url āhttps://maven.fabric.io/publicā } maven { url āhttps://jitpack.ioā } maven {url = āhttps://oss.sonatype.org/content/repositories/snapshots/ā } //For Snapshots }
dependencies { ⦠compile āeu.davidea:flexible-adapter:5.0.0-SNAPSHOTā } Didnāt helpā¦
- Tried
mAdapter.updateDataSet(newResults, true);/mAdapter.updateDataSet(new ArrayList<>(newResults), true);- didnāt work
Anything else I can do/try to solve this? Thank you
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (8 by maintainers)
Commits related to this issue
- Resolved #377 - Item content not updating when animating updateDataSet (changing default behaviour of notifyChangeOfUnfilteredItems to "true") — committed to davideas/FlexibleAdapter by davideas 7 years ago
- Resolved #377 - Item content not updating when animating updateDataSet (changing default behaviour of to "true") — committed to davideas/FlexibleAdapter by davideas 7 years ago
- Resolved #377 - Item content not updating when animating updateDataSet (unitTest) — committed to davideas/FlexibleAdapter by davideas 7 years ago
- Resolved #377 - Item content not updating when animating updateDataSet (better unit test) — committed to davideas/FlexibleAdapter by davideas 7 years ago
- Resolved #377 - Item content not updating when animating updateDataSet (better unit test) — committed to davideas/FlexibleAdapter by davideas 7 years ago
Hi David, how are you. So I have been testing everything, and so far so good. If I will encounter anything, Iāll let you know. Thank vary much for your help and time spent helping me. Much appreciated. Regards, Chen
On Jun 11, 2017 00:56, āDavide Stedutoā notifications@github.com wrote:
@henengel, thanks for your opinion.