Merge "Revert "Only call Drawable.setVisible(false) for visible outgoing drawables"" into nyc-dev

am: 991989f

* commit '991989f3183195cdadf308450eff8b3e9266fdab':
  Revert "Only call Drawable.setVisible(false) for visible outgoing drawables"

Change-Id: I442d2f712f25dec0702662950614fb75f0b7b2e6
This commit is contained in:
Adam Powell
2016-04-01 15:47:35 +00:00
committed by android-build-merger
2 changed files with 5 additions and 23 deletions

View File

@@ -18079,13 +18079,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* to clear the previous drawable. setVisible first while we still have the callback set.
*/
if (mBackground != null) {
// It's possible for this method to be invoked from the View constructor before
// subclass constructors have run. Drawables can and should trigger invalidations
// and other activity with their callback on visibility changes, which shouldn't
// happen before subclass constructors finish. However, we won't have set the
// drawable as visible until the view becomes attached. This guard below keeps
// multiple calls to this method from constructors from causing issues.
if (mBackground.isVisible()) {
if (isAttachedToWindow()) {
mBackground.setVisible(false, false);
}
mBackground.setCallback(null);
@@ -18320,13 +18314,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
if (mForegroundInfo.mDrawable != null) {
// It's possible for this method to be invoked from the View constructor before
// subclass constructors have run. Drawables can and should trigger invalidations
// and other activity with their callback on visibility changes, which shouldn't
// happen before subclass constructors finish. However, we won't have set the
// drawable as visible until the view becomes attached. This guard below keeps
// multiple calls to this method from constructors from causing issues.
if (mForegroundInfo.mDrawable.isVisible()) {
if (isAttachedToWindow()) {
mForegroundInfo.mDrawable.setVisible(false, false);
}
mForegroundInfo.mDrawable.setCallback(null);

View File

@@ -911,17 +911,11 @@ public class ImageView extends View {
}
if (mDrawable != null) {
// It's possible for this method to be invoked from the constructor before
// subclass constructors have run. Drawables can and should trigger invalidations
// and other activity with their callback on visibility changes, which shouldn't
// happen before subclass constructors finish. However, we won't have set the
// drawable as visible until the view becomes attached. This guard below keeps
// multiple calls to this method from constructors from causing issues.
if (mDrawable.isVisible()) {
mDrawable.setVisible(false, false);
}
mDrawable.setCallback(null);
unscheduleDrawable(mDrawable);
if (isAttachedToWindow()) {
mDrawable.setVisible(false, false);
}
}
mDrawable = d;