Merge "Dispatch aggregated visibility when performing attachViewToParent" into nyc-dev

This commit is contained in:
Adam Powell
2016-03-18 01:12:57 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 3 deletions

View File

@@ -4994,6 +4994,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if (child.hasFocus()) {
requestChildFocus(child, child.findFocus());
}
dispatchVisibilityAggregated(isAttachedToWindow() && getWindowVisibility() == VISIBLE
&& isShown());
}
/**

View File

@@ -913,7 +913,9 @@ public class ImageView extends View {
if (mDrawable != null) {
mDrawable.setCallback(null);
unscheduleDrawable(mDrawable);
mDrawable.setVisible(false, false);
if (isAttachedToWindow()) {
mDrawable.setVisible(false, false);
}
}
mDrawable = d;
@@ -924,8 +926,9 @@ public class ImageView extends View {
if (d.isStateful()) {
d.setState(getDrawableState());
}
d.setVisible(isAttachedToWindow() && getWindowVisibility() == VISIBLE && isShown(),
true);
if (isAttachedToWindow()) {
d.setVisible(getWindowVisibility() == VISIBLE && isShown(), true);
}
d.setLevel(mLevel);
mDrawableWidth = d.getIntrinsicWidth();
mDrawableHeight = d.getIntrinsicHeight();