OSDN Git Service

Fixes for ImageView drawable visibility dispatch
authorAdam Powell <adamp@google.com>
Thu, 25 Aug 2016 00:09:01 +0000 (17:09 -0700)
committerAdam Powell <adamp@google.com>
Fri, 26 Aug 2016 22:59:39 +0000 (22:59 +0000)
commit06f9eb8b621550ae1d39822fda38011a3ed5bdb9
treef36dd0c1587e4c7851b67d33a86b9318d5f0681f
parent61f52fca969c09cb00b7407b1f76b91df38b89b0
Fixes for ImageView drawable visibility dispatch

Some apps rely on their drawables not getting not-visible hints via
setVisible when the window visibility changes. This manifests as
additional animations, such as crossfading from placeholders when the
window becomes visible again.

Apps should be able to handle this case in the future now that we have
more detailed reporting via onVisibilityAggregated, but to keep
existing apps working as-is, ImageView now operates in a compatibility
mode for targetSdkVersion < N and will only dispatch visibility
signals based on the same triggers used in M. New apps get the more
detailed signals.

Fix a bug where window visibility dispatch via onVisibilityAggregated
would double-dispatch "not visible" when the window is transitioning
from GONE => INVISIBLE or INVISIBLE => GONE.

Make the growing set of compatibility check fields in ImageView
static, matching the pattern from View.

Bug 30216207

Change-Id: I88875260bf6aaa23687c7d51353de8d633383531
core/java/android/view/View.java
core/java/android/view/ViewRootImpl.java
core/java/android/widget/ImageView.java