Can't call notifyItemChanged(position) to trigger revert swipe
See original GitHub issueAs mentioned here https://stackoverflow.com/questions/31787272/android-recyclerview-itemtouchhelper-revert-swipe-and-restore-view-holder
probably the only way to trigger revert swipe animation is to call notifyItemChanged
on your adapter directly. The problem is that this is not possible with epoxy since you get java.lang.IllegalStateException: You cannot notify item changes directly. Call requestModelBuild instead.
The issue is that requestModelBuild
doesn’t trigger redraw since the backing model didn’t really change.
Here is the link to the exact place where I need to use notifyItemChanged but can’t https://github.com/toggl/android/blob/5e0c1882ab3ebcba4c7f83486168e300653cbd59/timer/src/main/java/com/toggl/timer/log/ui/TimeEntriesLogFragment.kt#L138
Do you have some workaround for this? Thanks
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:14 (6 by maintainers)
It has not been released yet, I’ll try to make a new release soon
@elihart Calling notifyItemChanged(position) for PagedListEpoxyController to revert the swipe action is not working. Neither submitting a new page list with the swiped item changed in the data source.
Any idea to revert swipe action for PagedListEpoxyController? Thanks