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

Fix view indices with Android LayoutAnimation (attempt 2) #19775

Commits on Aug 1, 2018

  1. Fix view indices with Android LayoutAnimation

    Fixes issue #11828 that causes layout animations for removed views to
    remove some adjacent views as well. This happens because the animated
    views are still present in the ViewGroup, which throws off subsequent
    operations that rely on view indices having updated.
    
    This issue was addressed in #11962, which was closed in favour of a more
    reliable solution that addresses the issue globally since it’s difficult
    to account for animated views everywhere. @janicduplessis recommended[0]
    handling the issue through ViewManager.
    
    Since API 11, Android provides `ViewGroup#startViewTransition(View)`
    that can be used to keep child views visible even if they have been
    removed from the group. ViewGroup keeps an array of these views, which
    is only used for drawing. Methods such as `ViewGroup#getChildCount()`
    and `ViewGroup#getChildAt(int)` will ignore them.
    
    I believe relying on these framework methods within ViewManager is the
    most reliable way to solve this issue because it also works if callers
    ignore ViewManager and reach into the native view indices and counts
    directly.
    
    [0]: #11962 (review)
    lnikkila committed Aug 1, 2018
    Configuration menu
    Copy the full SHA
    abd3fd9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5245abe View commit details
    Browse the repository at this point in the history