Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java +40 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.View; import android.view.WindowInsets; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.widget.ViewClippingUtil; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.plugins.DarkIconDispatcher; Loading Loading @@ -67,6 +68,13 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, private final View.OnLayoutChangeListener mStackScrollLayoutChangeListener = (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> updatePanelTranslation(); private final ViewClippingUtil.ClippingParameters mParentClippingParams = new ViewClippingUtil.ClippingParameters() { @Override public boolean shouldFinish(View view) { return view.getId() == R.id.status_bar; } }; private boolean mAnimationsEnabled = true; Point mPoint; Loading Loading @@ -239,6 +247,7 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, if (mShown != isShown) { mShown = isShown; if (isShown) { updateParentClipping(false /* shouldClip */); mHeadsUpStatusBarView.setVisibility(View.VISIBLE); show(mHeadsUpStatusBarView); hide(mClockView, View.INVISIBLE); Loading @@ -256,25 +265,54 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, if (mOperatorNameView != null) { show(mOperatorNameView); } hide(mHeadsUpStatusBarView, View.GONE); hide(mHeadsUpStatusBarView, View.GONE, () -> { updateParentClipping(true /* shouldClip */); }); } } } private void updateParentClipping(boolean shouldClip) { ViewClippingUtil.setClippingDeactivated( mHeadsUpStatusBarView, !shouldClip, mParentClippingParams); } /** * Hides the view and sets the state to endState when finished. * * @param view The view to hide. * @param endState One of {@link View#INVISIBLE} or {@link View#GONE}. * @see HeadsUpAppearanceController#hide(View, int, Runnable) * @see View#setVisibility(int) * */ private void hide(View view, int endState) { hide(view, endState, null); } /** * Hides the view and sets the state to endState when finished. * * @param view The view to hide. * @param endState One of {@link View#INVISIBLE} or {@link View#GONE}. * @param callback Runnable to be executed after the view has been hidden. * @see View#setVisibility(int) * */ private void hide(View view, int endState, Runnable callback) { if (mAnimationsEnabled) { CrossFadeHelper.fadeOut(view, CONTENT_FADE_DURATION /* duration */, 0 /* delay */, () -> view.setVisibility(endState)); 0 /* delay */, () -> { view.setVisibility(endState); if (callback != null) { callback.run(); } }); } else { view.setVisibility(endState); if (callback != null) { callback.run(); } } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java +40 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.View; import android.view.WindowInsets; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.widget.ViewClippingUtil; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.plugins.DarkIconDispatcher; Loading Loading @@ -67,6 +68,13 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, private final View.OnLayoutChangeListener mStackScrollLayoutChangeListener = (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> updatePanelTranslation(); private final ViewClippingUtil.ClippingParameters mParentClippingParams = new ViewClippingUtil.ClippingParameters() { @Override public boolean shouldFinish(View view) { return view.getId() == R.id.status_bar; } }; private boolean mAnimationsEnabled = true; Point mPoint; Loading Loading @@ -239,6 +247,7 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, if (mShown != isShown) { mShown = isShown; if (isShown) { updateParentClipping(false /* shouldClip */); mHeadsUpStatusBarView.setVisibility(View.VISIBLE); show(mHeadsUpStatusBarView); hide(mClockView, View.INVISIBLE); Loading @@ -256,25 +265,54 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, if (mOperatorNameView != null) { show(mOperatorNameView); } hide(mHeadsUpStatusBarView, View.GONE); hide(mHeadsUpStatusBarView, View.GONE, () -> { updateParentClipping(true /* shouldClip */); }); } } } private void updateParentClipping(boolean shouldClip) { ViewClippingUtil.setClippingDeactivated( mHeadsUpStatusBarView, !shouldClip, mParentClippingParams); } /** * Hides the view and sets the state to endState when finished. * * @param view The view to hide. * @param endState One of {@link View#INVISIBLE} or {@link View#GONE}. * @see HeadsUpAppearanceController#hide(View, int, Runnable) * @see View#setVisibility(int) * */ private void hide(View view, int endState) { hide(view, endState, null); } /** * Hides the view and sets the state to endState when finished. * * @param view The view to hide. * @param endState One of {@link View#INVISIBLE} or {@link View#GONE}. * @param callback Runnable to be executed after the view has been hidden. * @see View#setVisibility(int) * */ private void hide(View view, int endState, Runnable callback) { if (mAnimationsEnabled) { CrossFadeHelper.fadeOut(view, CONTENT_FADE_DURATION /* duration */, 0 /* delay */, () -> view.setVisibility(endState)); 0 /* delay */, () -> { view.setVisibility(endState); if (callback != null) { callback.run(); } }); } else { view.setVisibility(endState); if (callback != null) { callback.run(); } } } Loading