Uh oh!
There was an error while loading. Please reload this page.
Fix LayoutAnimation Android bug when adding and removing views at the same time - #7959
Fix LayoutAnimation Android bug when adding and removing views at the same time#7959janicduplessis wants to merge 1 commit into
Conversation
ghost
commented
Jun 6, 2016
janicduplessis
commented
Jun 6, 2016
cc @astreet |
| @@ -352,6 +352,7 @@ public void manageChildren( | |||
| arrayContains(tagsToDelete, viewToRemove.getId())) { | |||
| // The view will be removed and dropped by the 'delete' layout animation | |||
| // instead, so do nothing | |||
There was a problem hiding this comment.
This comment probably needs to be updated. Since do nothing now looks like doing something.
astreet
commented
Jun 7, 2016
Kinda unfortunate we have to do this, but I don't see another easy way. Would be amazing if we could add an integration test for this case as well layout animation in general since it seems somewhat easy to break! |
janicduplessis
commented
Jun 8, 2016
I found other issues that this doesn't fix so I'll have to debug this more and find a better solution. We may want to consider disabling delete animations for now. |
astreet
commented
Jun 9, 2016
janicduplessis
commented
Jun 9, 2016
Yes I saw those commit but the problem is that views get added at the wrong index when doing some more complex animations. I managed to fix some of the issues by removing views based on their tags instead of their index but this doesn't work for adding views. I'll have to figure out why the index passed to manageChildren are not good. I'm using this modified UIExplorer example to reproduce this issue https://gist.github.com/janicduplessis/211d78c5408ab17dee7ad2e381648a48 and also increasing the LayoutAnimation duration to make it more obvious. |
ghost
commented
Jul 17, 2016
@janicduplessis do you have any updates for this pull request? It's been a while since the last update so wanted to check in and see if you've looked at the requested changes. |
Any news on this? I'm getting When using LayoutAnimation on Android when removing and adding items to a wrapped row. |
robclouth
commented
Sep 16, 2016
Occasionally this too: |
hramos
commented
Nov 7, 2016
@janicduplessis still planning to ship this PR? |
janicduplessis
commented
Nov 8, 2016
I don't think I'll have time to work on this any time soon, sadly this PR didn't completely fix the issue and I couldn't figure out a way to have a proper fix. |
lacker
commented
Nov 30, 2016
OK, I am going to close this pull request because it seems like everyone is stalled, but if someone wants to continue working on this then please feel free to spin it back up again! |
Similar to #7942 but for android
Fix a bug that happens when views are added during a delete layout animation. What happens is that the inserted view is not inserted at the proper index if the deleted view index is smaller than the inserted one. This is because the view is not immediately removed from the subviews array so we need to offset the insert index for each view that is going to be deleted with an animation and is before the inserted view.
Test plan (required)
Tested that this fixed the bug in an app where I noticed it, also tested the UIExplorer example to make sure LayoutAnimations still worked properly.