summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Powell <adamp@google.com> 2016-08-24 09:49:51 -0700
committer Adam Powell <adamp@google.com> 2016-08-24 22:57:09 +0000
commit37b44dd592f04e2f74cd7dad724bf6d599d4f78f (patch)
tree0cbdf91e6e5c935cd55df863d26a918dc3203614
parente9c519e0499ebf5dd17d556ce983439ba37596a1 (diff)
Always report visibility to new ImageView drawables
Fix a regression where some drawables would not be correctly updated with their visibility state if set while an ImageView was not attached to a window. Bug 30216207 Change-Id: Ia30326a78168141c8f85bad9c782710f965623b7
-rw-r--r--core/java/android/widget/ImageView.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index 184544d87aba..ea0afb9cf542 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -933,9 +933,8 @@ public class ImageView extends View {
if (d.isStateful()) {
d.setState(getDrawableState());
}
- if (isAttachedToWindow()) {
- d.setVisible(getWindowVisibility() == VISIBLE && isShown(), true);
- }
+ d.setVisible(isAttachedToWindow() && getWindowVisibility() == VISIBLE && isShown(),
+ true);
d.setLevel(mLevel);
mDrawableWidth = d.getIntrinsicWidth();
mDrawableHeight = d.getIntrinsicHeight();