Loading core/java/android/view/View.java +14 −7 Original line number Diff line number Diff line Loading @@ -6780,7 +6780,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @RemotableViewMethod public void setVisibility(@Visibility int visibility) { setFlags(visibility, VISIBILITY_MASK); if (mBackground != null) mBackground.setVisible(visibility == VISIBLE, false); } /** Loading Loading @@ -8806,20 +8805,28 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** * Called when the visibility of the view or an ancestor of the view is changed. * @param changedView The view whose visibility changed. Could be 'this' or * an ancestor view. * @param visibility The new visibility of changedView: {@link #VISIBLE}, * Called when the visibility of the view or an ancestor of the view has * changed. * * @param changedView The view whose visibility changed. May be * {@code this} or an ancestor view. * @param visibility The new visibility, one of {@link #VISIBLE}, * {@link #INVISIBLE} or {@link #GONE}. */ protected void onVisibilityChanged(@NonNull View changedView, @Visibility int visibility) { if (visibility == VISIBLE) { final boolean visible = visibility == VISIBLE && getVisibility() == VISIBLE; if (visible) { if (mAttachInfo != null) { initialAwakenScrollBars(); } else { mPrivateFlags |= PFLAG_AWAKEN_SCROLL_BARS_ON_ATTACH; } } final Drawable dr = mBackground; if (dr != null && visible != dr.isVisible()) { dr.setVisible(visible, false); } } /** Loading core/java/android/widget/FrameLayout.java +10 −5 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.widget; import java.util.ArrayList; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.content.res.ColorStateList; Loading Loading @@ -203,11 +204,15 @@ public class FrameLayout extends ViewGroup { } @Override @RemotableViewMethod public void setVisibility(@Visibility int visibility) { super.setVisibility(visibility); if (mForeground != null) { mForeground.setVisible(visibility == VISIBLE, false); protected void onVisibilityChanged(@NonNull View changedView, @Visibility int visibility) { super.onVisibilityChanged(changedView, visibility); final Drawable dr = mForeground; if (dr != null) { final boolean visible = visibility == VISIBLE && getVisibility() == VISIBLE; if (visible != dr.isVisible()) { dr.setVisible(visible, false); } } } Loading Loading
core/java/android/view/View.java +14 −7 Original line number Diff line number Diff line Loading @@ -6780,7 +6780,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, @RemotableViewMethod public void setVisibility(@Visibility int visibility) { setFlags(visibility, VISIBILITY_MASK); if (mBackground != null) mBackground.setVisible(visibility == VISIBLE, false); } /** Loading Loading @@ -8806,20 +8805,28 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** * Called when the visibility of the view or an ancestor of the view is changed. * @param changedView The view whose visibility changed. Could be 'this' or * an ancestor view. * @param visibility The new visibility of changedView: {@link #VISIBLE}, * Called when the visibility of the view or an ancestor of the view has * changed. * * @param changedView The view whose visibility changed. May be * {@code this} or an ancestor view. * @param visibility The new visibility, one of {@link #VISIBLE}, * {@link #INVISIBLE} or {@link #GONE}. */ protected void onVisibilityChanged(@NonNull View changedView, @Visibility int visibility) { if (visibility == VISIBLE) { final boolean visible = visibility == VISIBLE && getVisibility() == VISIBLE; if (visible) { if (mAttachInfo != null) { initialAwakenScrollBars(); } else { mPrivateFlags |= PFLAG_AWAKEN_SCROLL_BARS_ON_ATTACH; } } final Drawable dr = mBackground; if (dr != null && visible != dr.isVisible()) { dr.setVisible(visible, false); } } /** Loading
core/java/android/widget/FrameLayout.java +10 −5 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.widget; import java.util.ArrayList; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.content.res.ColorStateList; Loading Loading @@ -203,11 +204,15 @@ public class FrameLayout extends ViewGroup { } @Override @RemotableViewMethod public void setVisibility(@Visibility int visibility) { super.setVisibility(visibility); if (mForeground != null) { mForeground.setVisible(visibility == VISIBLE, false); protected void onVisibilityChanged(@NonNull View changedView, @Visibility int visibility) { super.onVisibilityChanged(changedView, visibility); final Drawable dr = mForeground; if (dr != null) { final boolean visible = visibility == VISIBLE && getVisibility() == VISIBLE; if (visible != dr.isVisible()) { dr.setVisible(visible, false); } } } Loading