OSDN Git Service

Tweak visibility logic for inflated view scenarios
authorChet Haase <chet@google.com>
Mon, 26 Aug 2013 14:34:12 +0000 (07:34 -0700)
committerChet Haase <chet@google.com>
Mon, 26 Aug 2013 23:04:11 +0000 (16:04 -0700)
commit35a457a3bac0851a1fabd6cda58d1ea67f997b33
treef8bfd7a2279b54870d559c4ff4b78368eee7d87c
parentb3acd8ef263e17879e9a13c3dacd123bd0670c3b
Tweak visibility logic for inflated view scenarios

Previously, Visibility would determine whether a given view was
worthy of a transition by checking the visibility of that view's
parent hierarchy. This is done to avoid fading every view in
a hierarchy when only the top-most node should be faded.

However, the logic was flawed because it assumed the end scene
parent was stable between scenes, which is not the case with inflated
layout scenes, in which the parent views are not the same, even though they
may represent the same parents (via ids).

The new approach is to check information on both the start and end scene
parents, and to take ids into account when checking the state of these
parents in the start/end scenes. Also, avoid this logic altogether if the
transition is targeted at specific views (don't bother checking the
parents if the transition was told to fade specific views).

Issue #10442447 Transitions: Fades don't happen correctly in some situations

Change-Id: Icea24b892f2eff2d37c6436ccfe4e288aac84178
core/java/android/view/transition/Visibility.java