Loading packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +13 −12 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.GlobalActions.GlobalActionsManager; import com.android.systemui.plugins.GlobalActionsPanelPlugin; import com.android.systemui.statusbar.BlurUtils; import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.phone.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.policy.ConfigurationController; Loading Loading @@ -162,7 +162,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private final IActivityManager mIActivityManager; private final TelecomManager mTelecomManager; private final MetricsLogger mMetricsLogger; private final BlurUtils mBlurUtils; private final NotificationShadeDepthController mDepthController; private ArrayList<Action> mItems; private ActionsDialog mDialog; Loading Loading @@ -207,7 +207,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, KeyguardStateController keyguardStateController, UserManager userManager, TrustManager trustManager, IActivityManager iActivityManager, @Nullable TelecomManager telecomManager, MetricsLogger metricsLogger, BlurUtils blurUtils, SysuiColorExtractor colorExtractor, NotificationShadeDepthController depthController, SysuiColorExtractor colorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, ControlsUiController controlsUiController, IWindowManager iWindowManager, Loading @@ -229,7 +229,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mIActivityManager = iActivityManager; mTelecomManager = telecomManager; mMetricsLogger = metricsLogger; mBlurUtils = blurUtils; mDepthController = depthController; mSysuiColorExtractor = colorExtractor; mStatusBarService = statusBarService; mNotificationShadeWindowController = notificationShadeWindowController; Loading Loading @@ -437,7 +437,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, : null; ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, panelViewController, mBlurUtils, mSysuiColorExtractor, mStatusBarService, mDepthController, mSysuiColorExtractor, mStatusBarService, mNotificationShadeWindowController, shouldShowControls() ? mControlsUiController : null); dialog.setCanceledOnTouchOutside(false); // Handled by the custom class. Loading Loading @@ -1570,20 +1570,21 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private ResetOrientationData mResetOrientationData; private boolean mHadTopUi; private final NotificationShadeWindowController mNotificationShadeWindowController; private final BlurUtils mBlurUtils; private final NotificationShadeDepthController mDepthController; private ControlsUiController mControlsUiController; private ViewGroup mControlsView; ActionsDialog(Context context, MyAdapter adapter, GlobalActionsPanelPlugin.PanelViewController plugin, BlurUtils blurUtils, GlobalActionsPanelPlugin.PanelViewController plugin, NotificationShadeDepthController depthController, SysuiColorExtractor sysuiColorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, ControlsUiController controlsUiController) { super(context, com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActions); mContext = context; mAdapter = adapter; mBlurUtils = blurUtils; mDepthController = depthController; mColorExtractor = sysuiColorExtractor; mStatusBarService = statusBarService; mNotificationShadeWindowController = notificationShadeWindowController; Loading Loading @@ -1792,8 +1793,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, float animatedValue = animation.getAnimatedFraction(); int alpha = (int) (animatedValue * mScrimAlpha * 255); mBackgroundDrawable.setAlpha(alpha); mBlurUtils.applyBlur(mGlobalActionsLayout.getViewRootImpl(), mBlurUtils.blurRadiusOfRatio(animatedValue)); mDepthController.updateGlobalDialogVisibility(animatedValue, mGlobalActionsLayout); }) .start(); if (mControlsUiController != null) { Loading Loading @@ -1822,8 +1823,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, float animatedValue = 1f - animation.getAnimatedFraction(); int alpha = (int) (animatedValue * mScrimAlpha * 255); mBackgroundDrawable.setAlpha(alpha); mBlurUtils.applyBlur(mGlobalActionsLayout.getViewRootImpl(), mBlurUtils.blurRadiusOfRatio(animatedValue)); mDepthController.updateGlobalDialogVisibility(animatedValue, mGlobalActionsLayout); }) .start(); dismissPanel(); Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +19 −4 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ class NotificationShadeDepthController @Inject constructor( } lateinit var root: View private var blurRoot: View? = null private var keyguardAnimator: Animator? = null private var notificationAnimator: Animator? = null private var updateScheduled: Boolean = false Loading @@ -72,6 +73,7 @@ class NotificationShadeDepthController @Inject constructor( return shadeBlurRadius.toFloat() } }) private val zoomInterpolator = Interpolators.ACCELERATE_DECELERATE private var shadeBlurRadius = 0 set(value) { if (field == value) return Loading @@ -84,6 +86,7 @@ class NotificationShadeDepthController @Inject constructor( field = value scheduleUpdate() } private var globalDialogVisibility = 0f /** * Callback that updates the window blur value and is called only once per frame. Loading @@ -91,9 +94,12 @@ class NotificationShadeDepthController @Inject constructor( private val updateBlurCallback = Choreographer.FrameCallback { updateScheduled = false val blur = max(shadeBlurRadius, wakeAndUnlockBlurRadius) blurUtils.applyBlur(root.viewRootImpl, blur) wallpaperManager.setWallpaperZoomOut(root.windowToken, blurUtils.ratioOfBlurRadius(blur)) val blur = max(shadeBlurRadius, max(wakeAndUnlockBlurRadius, blurUtils.blurRadiusOfRatio(globalDialogVisibility))) blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur) val rawZoom = max(blurUtils.ratioOfBlurRadius(blur), globalDialogVisibility) wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomInterpolator.getInterpolation(rawZoom)) } /** Loading Loading @@ -162,14 +168,23 @@ class NotificationShadeDepthController @Inject constructor( shadeSpring.animateToFinalPosition(newBlur.toFloat()) } private fun scheduleUpdate() { private fun scheduleUpdate(viewToBlur: View? = null) { if (updateScheduled) { return } updateScheduled = true blurRoot = viewToBlur choreographer.postFrameCallback(updateBlurCallback) } fun updateGlobalDialogVisibility(visibility: Float, dialogView: View) { if (visibility == globalDialogVisibility) { return } globalDialogVisibility = visibility scheduleUpdate(dialogView) } override fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array<out String>) { IndentingPrintWriter(pw, " ").let { it.println("StatusBarWindowBlurController:") Loading Loading
packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +13 −12 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.GlobalActions.GlobalActionsManager; import com.android.systemui.plugins.GlobalActionsPanelPlugin; import com.android.systemui.statusbar.BlurUtils; import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.phone.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.ScrimController; import com.android.systemui.statusbar.policy.ConfigurationController; Loading Loading @@ -162,7 +162,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private final IActivityManager mIActivityManager; private final TelecomManager mTelecomManager; private final MetricsLogger mMetricsLogger; private final BlurUtils mBlurUtils; private final NotificationShadeDepthController mDepthController; private ArrayList<Action> mItems; private ActionsDialog mDialog; Loading Loading @@ -207,7 +207,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, KeyguardStateController keyguardStateController, UserManager userManager, TrustManager trustManager, IActivityManager iActivityManager, @Nullable TelecomManager telecomManager, MetricsLogger metricsLogger, BlurUtils blurUtils, SysuiColorExtractor colorExtractor, NotificationShadeDepthController depthController, SysuiColorExtractor colorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, ControlsUiController controlsUiController, IWindowManager iWindowManager, Loading @@ -229,7 +229,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mIActivityManager = iActivityManager; mTelecomManager = telecomManager; mMetricsLogger = metricsLogger; mBlurUtils = blurUtils; mDepthController = depthController; mSysuiColorExtractor = colorExtractor; mStatusBarService = statusBarService; mNotificationShadeWindowController = notificationShadeWindowController; Loading Loading @@ -437,7 +437,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, : null; ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, panelViewController, mBlurUtils, mSysuiColorExtractor, mStatusBarService, mDepthController, mSysuiColorExtractor, mStatusBarService, mNotificationShadeWindowController, shouldShowControls() ? mControlsUiController : null); dialog.setCanceledOnTouchOutside(false); // Handled by the custom class. Loading Loading @@ -1570,20 +1570,21 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private ResetOrientationData mResetOrientationData; private boolean mHadTopUi; private final NotificationShadeWindowController mNotificationShadeWindowController; private final BlurUtils mBlurUtils; private final NotificationShadeDepthController mDepthController; private ControlsUiController mControlsUiController; private ViewGroup mControlsView; ActionsDialog(Context context, MyAdapter adapter, GlobalActionsPanelPlugin.PanelViewController plugin, BlurUtils blurUtils, GlobalActionsPanelPlugin.PanelViewController plugin, NotificationShadeDepthController depthController, SysuiColorExtractor sysuiColorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, ControlsUiController controlsUiController) { super(context, com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActions); mContext = context; mAdapter = adapter; mBlurUtils = blurUtils; mDepthController = depthController; mColorExtractor = sysuiColorExtractor; mStatusBarService = statusBarService; mNotificationShadeWindowController = notificationShadeWindowController; Loading Loading @@ -1792,8 +1793,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, float animatedValue = animation.getAnimatedFraction(); int alpha = (int) (animatedValue * mScrimAlpha * 255); mBackgroundDrawable.setAlpha(alpha); mBlurUtils.applyBlur(mGlobalActionsLayout.getViewRootImpl(), mBlurUtils.blurRadiusOfRatio(animatedValue)); mDepthController.updateGlobalDialogVisibility(animatedValue, mGlobalActionsLayout); }) .start(); if (mControlsUiController != null) { Loading Loading @@ -1822,8 +1823,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, float animatedValue = 1f - animation.getAnimatedFraction(); int alpha = (int) (animatedValue * mScrimAlpha * 255); mBackgroundDrawable.setAlpha(alpha); mBlurUtils.applyBlur(mGlobalActionsLayout.getViewRootImpl(), mBlurUtils.blurRadiusOfRatio(animatedValue)); mDepthController.updateGlobalDialogVisibility(animatedValue, mGlobalActionsLayout); }) .start(); dismissPanel(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +19 −4 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ class NotificationShadeDepthController @Inject constructor( } lateinit var root: View private var blurRoot: View? = null private var keyguardAnimator: Animator? = null private var notificationAnimator: Animator? = null private var updateScheduled: Boolean = false Loading @@ -72,6 +73,7 @@ class NotificationShadeDepthController @Inject constructor( return shadeBlurRadius.toFloat() } }) private val zoomInterpolator = Interpolators.ACCELERATE_DECELERATE private var shadeBlurRadius = 0 set(value) { if (field == value) return Loading @@ -84,6 +86,7 @@ class NotificationShadeDepthController @Inject constructor( field = value scheduleUpdate() } private var globalDialogVisibility = 0f /** * Callback that updates the window blur value and is called only once per frame. Loading @@ -91,9 +94,12 @@ class NotificationShadeDepthController @Inject constructor( private val updateBlurCallback = Choreographer.FrameCallback { updateScheduled = false val blur = max(shadeBlurRadius, wakeAndUnlockBlurRadius) blurUtils.applyBlur(root.viewRootImpl, blur) wallpaperManager.setWallpaperZoomOut(root.windowToken, blurUtils.ratioOfBlurRadius(blur)) val blur = max(shadeBlurRadius, max(wakeAndUnlockBlurRadius, blurUtils.blurRadiusOfRatio(globalDialogVisibility))) blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur) val rawZoom = max(blurUtils.ratioOfBlurRadius(blur), globalDialogVisibility) wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomInterpolator.getInterpolation(rawZoom)) } /** Loading Loading @@ -162,14 +168,23 @@ class NotificationShadeDepthController @Inject constructor( shadeSpring.animateToFinalPosition(newBlur.toFloat()) } private fun scheduleUpdate() { private fun scheduleUpdate(viewToBlur: View? = null) { if (updateScheduled) { return } updateScheduled = true blurRoot = viewToBlur choreographer.postFrameCallback(updateBlurCallback) } fun updateGlobalDialogVisibility(visibility: Float, dialogView: View) { if (visibility == globalDialogVisibility) { return } globalDialogVisibility = visibility scheduleUpdate(dialogView) } override fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array<out String>) { IndentingPrintWriter(pw, " ").let { it.println("StatusBarWindowBlurController:") Loading