-
-
Notifications
You must be signed in to change notification settings - Fork 492
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
CreateBinding is being called each time item is being collapsed or expanded. #1018
Comments
@Ceees2 you can modify this behaviour by configuring It's used here when we toggle the expandable state for the clicked item: If you don't notify this item, you'd need to make sure alternatively to highlight any indicator that it's expanded |
I know, that was my proposed solution in the linked PR, but I feel like that is more a work around than an actual solution. Might also just be that I'm trying to do something thats just not possible, but not giving up yet. |
Sorry, missed that this was the exact thing you had linked. One potential solution would be to do the |
I thought about that, but that would mean updating the expand and collapse methods wouldn't it? Would it also be possible to call bindView/unbindView with the current view instead of creating a new view. Seems like that's also causing issues for animations if the starting state of the view (when starting the animation) is different than when the view is created initially. eg the jumping of the expand icon; when the item is expanded and you want to collapse, the icon jumps to the collapsed rotation(since the view is being recreated), then immediately back to the expanded rotation and then the animation starts to rotate it back to collapse. |
@Ceees2 it will mean we have to update the extension, but it would still be a good option, and consumers of the SDK can start acting on it optionally. No it's not anticipated to call The animation parts can all be handled by making use of the payload, as within the |
That was fast, thanks for all your work. |
Works like a charm, I've completely removed the click listener triggering the animation and am using the payload now to determine if animations should be shown, and no need to use If wanted I can also open a PR updating and applying these changes in the expand example in the fast adapter example app @mikepenz |
@Ceees2 that's awesome news. Glad it works that great for you. And yes definitely. Always happy about contributions 😀 |
About this issue
When using
AbstractBindingItem
and the expandable extension, expanding/collapsing an item causes createBinding to be called each time. I feel like this is not intended behaviour, since the actual clicked item is not dissapearing/appearing from/on the screen. And also because when usingAbstractItem
a new view holder is not being created newly each time on expanding/collapsing. Correct me if I'm wrong.I've previously created a pull request to "fix" something caused by this, but rather than fixing it, it was more a work around and preventing us from using notifying about item changes.
If this is indeed wrong/unintended behaviour i'd be happy to help out fixing it.
Details
The text was updated successfully, but these errors were encountered: