Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSContainerController.kt +4 −2 Original line number Diff line number Diff line Loading @@ -3,7 +3,9 @@ package com.android.systemui.plugins.qs interface QSContainerController { fun setCustomizerAnimating(animating: Boolean) fun setCustomizerShowing(showing: Boolean) fun setCustomizerShowing(showing: Boolean) = setCustomizerShowing(showing, 0L) fun setCustomizerShowing(showing: Boolean, animationDuration: Long) fun setDetailShowing(showing: Boolean) } packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java +12 −3 Original line number Diff line number Diff line Loading @@ -39,8 +39,15 @@ public class QSDetailClipper { mBackground = (TransitionDrawable) detail.getBackground(); } public void animateCircularClip(int x, int y, boolean in, AnimatorListener listener) { updateCircularClip(true /* animate */, x, y, in, listener); /** * @param x x position where animation should originate * @param y y position where animation should originate * @param in whether animating in or out * @param listener Animation listener. Called whether or not {@code animate} is true. * @return the duration of the circular animator */ public long animateCircularClip(int x, int y, boolean in, AnimatorListener listener) { return updateCircularClip(true /* animate */, x, y, in, listener); } /** Loading @@ -50,8 +57,9 @@ public class QSDetailClipper { * @param y y position where animation should originate * @param in whether animating in or out * @param listener Animation listener. Called whether or not {@code animate} is true. * @return the duration of the circular animator */ public void updateCircularClip(boolean animate, int x, int y, boolean in, public long updateCircularClip(boolean animate, int x, int y, boolean in, AnimatorListener listener) { if (mAnimator != null) { mAnimator.cancel(); Loading Loading @@ -87,6 +95,7 @@ public class QSDetailClipper { mAnimator.addListener(mGoneOnEnd); } mAnimator.start(); return mAnimator.getDuration(); } private final Runnable mReverseBackground = new Runnable() { Loading packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java +6 −4 Original line number Diff line number Diff line Loading @@ -125,9 +125,10 @@ public class QSCustomizer extends LinearLayout { isShown = true; mOpening = true; setVisibility(View.VISIBLE); mClipper.animateCircularClip(mX, mY, true, new ExpandAnimatorListener(tileAdapter)); long duration = mClipper.animateCircularClip( mX, mY, true, new ExpandAnimatorListener(tileAdapter)); mQsContainerController.setCustomizerAnimating(true); mQsContainerController.setCustomizerShowing(true); mQsContainerController.setCustomizerShowing(true, duration); } } Loading @@ -153,13 +154,14 @@ public class QSCustomizer extends LinearLayout { // Make sure we're not opening (because we're closing). Nobody can think we are // customizing after the next two lines. mOpening = false; long duration = 0; if (animate) { mClipper.animateCircularClip(mX, mY, false, mCollapseAnimationListener); duration = mClipper.animateCircularClip(mX, mY, false, mCollapseAnimationListener); } else { setVisibility(View.GONE); } mQsContainerController.setCustomizerAnimating(animate); mQsContainerController.setCustomizerShowing(false); mQsContainerController.setCustomizerShowing(false, duration); } } Loading packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt +9 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import androidx.constraintlayout.motion.widget.MotionLayout import com.android.settingslib.Utils import com.android.systemui.Dumpable import com.android.systemui.R import com.android.systemui.animation.Interpolators import com.android.systemui.animation.ShadeInterpolation import com.android.systemui.battery.BatteryMeterView import com.android.systemui.battery.BatteryMeterViewController Loading Loading @@ -310,6 +311,14 @@ class LargeScreenShadeHeaderController @Inject constructor( updateVisibility() } fun startCustomizingAnimation(show: Boolean, duration: Long) { header.animate() .setDuration(duration) .alpha(if (show) 0f else 1f) .setInterpolator(if (show) Interpolators.ALPHA_OUT else Interpolators.ALPHA_IN) .start() } private fun loadConstraints() { if (header is MotionLayout) { // Use resources.getXml instead of passing the resource id due to bug b/205018300 Loading packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt +7 −3 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ class NotificationsQSContainerController @Inject constructor( view: NotificationsQuickSettingsContainer, private val navigationModeController: NavigationModeController, private val overviewProxyService: OverviewProxyService, private val largeScreenShadeHeaderController: LargeScreenShadeHeaderController, private val featureFlags: FeatureFlags, @Main private val delayableExecutor: DelayableExecutor ) : ViewController<NotificationsQuickSettingsContainer>(view), QSContainerController { Loading Loading @@ -156,10 +157,13 @@ class NotificationsQSContainerController @Inject constructor( } } override fun setCustomizerShowing(showing: Boolean) { override fun setCustomizerShowing(showing: Boolean, animationDuration: Long) { if (showing != isQSCustomizing) { isQSCustomizing = showing largeScreenShadeHeaderController.startCustomizingAnimation(showing, animationDuration) updateBottomSpacing() } } override fun setDetailShowing(showing: Boolean) { isQSDetailShowing = showing Loading Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSContainerController.kt +4 −2 Original line number Diff line number Diff line Loading @@ -3,7 +3,9 @@ package com.android.systemui.plugins.qs interface QSContainerController { fun setCustomizerAnimating(animating: Boolean) fun setCustomizerShowing(showing: Boolean) fun setCustomizerShowing(showing: Boolean) = setCustomizerShowing(showing, 0L) fun setCustomizerShowing(showing: Boolean, animationDuration: Long) fun setDetailShowing(showing: Boolean) }
packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java +12 −3 Original line number Diff line number Diff line Loading @@ -39,8 +39,15 @@ public class QSDetailClipper { mBackground = (TransitionDrawable) detail.getBackground(); } public void animateCircularClip(int x, int y, boolean in, AnimatorListener listener) { updateCircularClip(true /* animate */, x, y, in, listener); /** * @param x x position where animation should originate * @param y y position where animation should originate * @param in whether animating in or out * @param listener Animation listener. Called whether or not {@code animate} is true. * @return the duration of the circular animator */ public long animateCircularClip(int x, int y, boolean in, AnimatorListener listener) { return updateCircularClip(true /* animate */, x, y, in, listener); } /** Loading @@ -50,8 +57,9 @@ public class QSDetailClipper { * @param y y position where animation should originate * @param in whether animating in or out * @param listener Animation listener. Called whether or not {@code animate} is true. * @return the duration of the circular animator */ public void updateCircularClip(boolean animate, int x, int y, boolean in, public long updateCircularClip(boolean animate, int x, int y, boolean in, AnimatorListener listener) { if (mAnimator != null) { mAnimator.cancel(); Loading Loading @@ -87,6 +95,7 @@ public class QSDetailClipper { mAnimator.addListener(mGoneOnEnd); } mAnimator.start(); return mAnimator.getDuration(); } private final Runnable mReverseBackground = new Runnable() { Loading
packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java +6 −4 Original line number Diff line number Diff line Loading @@ -125,9 +125,10 @@ public class QSCustomizer extends LinearLayout { isShown = true; mOpening = true; setVisibility(View.VISIBLE); mClipper.animateCircularClip(mX, mY, true, new ExpandAnimatorListener(tileAdapter)); long duration = mClipper.animateCircularClip( mX, mY, true, new ExpandAnimatorListener(tileAdapter)); mQsContainerController.setCustomizerAnimating(true); mQsContainerController.setCustomizerShowing(true); mQsContainerController.setCustomizerShowing(true, duration); } } Loading @@ -153,13 +154,14 @@ public class QSCustomizer extends LinearLayout { // Make sure we're not opening (because we're closing). Nobody can think we are // customizing after the next two lines. mOpening = false; long duration = 0; if (animate) { mClipper.animateCircularClip(mX, mY, false, mCollapseAnimationListener); duration = mClipper.animateCircularClip(mX, mY, false, mCollapseAnimationListener); } else { setVisibility(View.GONE); } mQsContainerController.setCustomizerAnimating(animate); mQsContainerController.setCustomizerShowing(false); mQsContainerController.setCustomizerShowing(false, duration); } } Loading
packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt +9 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import androidx.constraintlayout.motion.widget.MotionLayout import com.android.settingslib.Utils import com.android.systemui.Dumpable import com.android.systemui.R import com.android.systemui.animation.Interpolators import com.android.systemui.animation.ShadeInterpolation import com.android.systemui.battery.BatteryMeterView import com.android.systemui.battery.BatteryMeterViewController Loading Loading @@ -310,6 +311,14 @@ class LargeScreenShadeHeaderController @Inject constructor( updateVisibility() } fun startCustomizingAnimation(show: Boolean, duration: Long) { header.animate() .setDuration(duration) .alpha(if (show) 0f else 1f) .setInterpolator(if (show) Interpolators.ALPHA_OUT else Interpolators.ALPHA_IN) .start() } private fun loadConstraints() { if (header is MotionLayout) { // Use resources.getXml instead of passing the resource id due to bug b/205018300 Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt +7 −3 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ class NotificationsQSContainerController @Inject constructor( view: NotificationsQuickSettingsContainer, private val navigationModeController: NavigationModeController, private val overviewProxyService: OverviewProxyService, private val largeScreenShadeHeaderController: LargeScreenShadeHeaderController, private val featureFlags: FeatureFlags, @Main private val delayableExecutor: DelayableExecutor ) : ViewController<NotificationsQuickSettingsContainer>(view), QSContainerController { Loading Loading @@ -156,10 +157,13 @@ class NotificationsQSContainerController @Inject constructor( } } override fun setCustomizerShowing(showing: Boolean) { override fun setCustomizerShowing(showing: Boolean, animationDuration: Long) { if (showing != isQSCustomizing) { isQSCustomizing = showing largeScreenShadeHeaderController.startCustomizingAnimation(showing, animationDuration) updateBottomSpacing() } } override fun setDetailShowing(showing: Boolean) { isQSDetailShowing = showing Loading