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

Selection Bug #606

Closed
ishdemon opened this issue May 7, 2018 · 4 comments
Closed

Selection Bug #606

ishdemon opened this issue May 7, 2018 · 4 comments

Comments

@ishdemon
Copy link

ishdemon commented May 7, 2018

I have been tweaking the demo app in selection modes and I found this weird bug. After you turn off the screen and turn on and if you select any other item, the selection becomes ambiguous and glitchy resulting in multiple selections. It gets cleared once you scroll past them. Please note it's not the long press for multiselection, it happens in normal press.

Initial state

After screen off and on

After Scrolling past those selected items

@ishdemon
Copy link
Author

ishdemon commented May 7, 2018

One Temporary workaround I have found is Refreshing the dataset in onResume(); But it's not feasible as the dataset is reloading unnecessary.

@davideas
Copy link
Owner

davideas commented May 7, 2018

@ishdemon, thank you for the messages.
I already verified your steps, indeed something is not working as expected, but I don't know if it's the demoApp or the library, I will find out and fix it.

@ishdemon
Copy link
Author

ishdemon commented May 7, 2018

Thanks. Looking forward to it.

@davideas davideas added the bug label May 7, 2018
@davideas
Copy link
Owner

davideas commented May 7, 2018

@ishdemon, yes, I confirm that is a small bug, introduced in 5.0.2 when clearing the cache for view bounds in onSaveInstanceState, but the mistake is that views are not being bound again on restore, so I should not clear the cache previously, but only when the full dataSet is updating:

  1. when updateDataSet(List) is invoked, same as updateDataSet(List, false).
  2. when updateDataSet(List, true) is invoked with notifyChangeOfUnfilteredItems=true (default).

⚠️ Warning: Once again, I remind that, when using FlexibleAdapter we should never call official methods notify*** but call the relative methods I created, because there are others operations on going, like the one above.

ℹ️ I also remind that, view holders in this cache are removed when views are recycled. The cache keeps only very few elements constantly in memory, so it's not an issue.
The cache helps to see animations on going, because we are not interested in rebinding the content but making a transition of the view from the old state to the new state, so we allow animations to be performed without interruption.

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