Loading quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +9 −1 Original line number Diff line number Diff line Loading @@ -192,7 +192,15 @@ public class LauncherTaskbarUIController extends TaskbarUIController { */ public Animator createAnimToLauncher(@NonNull LauncherState toState, @NonNull RecentsAnimationCallbacks callbacks, long duration) { return mTaskbarLauncherStateController.createAnimToLauncher(toState, callbacks, duration); AnimatorSet set = new AnimatorSet(); Animator taskbarState = mTaskbarLauncherStateController .createAnimToLauncher(toState, callbacks, duration); long halfDuration = Math.round(duration * 0.5f); Animator translation = mControllers.taskbarTranslationController.createAnimToLauncher(halfDuration); set.playTogether(taskbarState, translation); return set; } public boolean isDraggingItem() { Loading quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java +25 −5 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.RevealOutlineAnimation; import com.android.launcher3.anim.RoundedRectRevealOutlineProvider; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.Executors; import com.android.launcher3.util.MultiPropertyFactory; import com.android.launcher3.util.MultiValueAlpha; Loading Loading @@ -66,6 +67,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT // Initialized in init. private TaskbarControllers mControllers; private int mTaskbarSize; // The bounds we want to clip to in the settled state when showing the stashed handle. private final Rect mStashedHandleBounds = new Rect(); Loading Loading @@ -96,15 +98,18 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT DeviceProfile deviceProfile = mActivity.getDeviceProfile(); Resources resources = mActivity.getResources(); if (isPhoneGestureNavMode(mActivity.getDeviceProfile())) { mStashedHandleView.getLayoutParams().height = resources.getDimensionPixelSize(R.dimen.taskbar_size); mTaskbarSize = resources.getDimensionPixelSize(R.dimen.taskbar_size); mStashedHandleWidth = resources.getDimensionPixelSize(R.dimen.taskbar_stashed_small_screen); } else { mStashedHandleView.getLayoutParams().height = deviceProfile.taskbarSize; mTaskbarSize = deviceProfile.taskbarSize; mStashedHandleWidth = resources .getDimensionPixelSize(R.dimen.taskbar_stashed_handle_width); } int taskbarBottomMargin = DisplayController.isTransientTaskbar(mActivity) ? resources.getDimensionPixelSize(R.dimen.transient_taskbar_margin) : 0; mStashedHandleView.getLayoutParams().height = mTaskbarSize + taskbarBottomMargin; mTaskbarStashedHandleAlpha.get(ALPHA_INDEX_STASHED).setValue( isPhoneGestureNavMode(deviceProfile) ? 1 : 0); Loading Loading @@ -181,9 +186,17 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT * morphs into the size of where the taskbar icons will be. */ public Animator createRevealAnimToIsStashed(boolean isStashed) { Rect visualBounds = new Rect(mControllers.taskbarViewController.getIconLayoutBounds()); if (DisplayController.isTransientTaskbar(mActivity)) { // Account for the full visual height of the transient taskbar. int heightDiff = (mTaskbarSize - visualBounds.height()) / 2; visualBounds.top -= heightDiff; visualBounds.bottom += heightDiff; } final RevealOutlineAnimation handleRevealProvider = new RoundedRectRevealOutlineProvider( mStashedHandleRadius, mStashedHandleRadius, mControllers.taskbarViewController.getIconLayoutBounds(), mStashedHandleBounds); mStashedHandleRadius, mStashedHandleRadius, visualBounds, mStashedHandleBounds); boolean isReversed = !isStashed; boolean changingDirection = mWasLastRevealAnimReversed != isReversed; Loading Loading @@ -219,6 +232,13 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT mStashedHandleView.setScaleY(mTaskbarStashedHandleHintScale.value); } /** * Sets the translation of the stashed handle during the swipe up gesture. */ protected void setTranslationYForSwipe(float transY) { mStashedHandleView.setTranslationY(transY); } /** * Should be called when the home button is disabled, so we can hide this handle as well. */ Loading quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +16 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.popup.PopupDataProvider; import com.android.launcher3.taskbar.TaskbarAutohideSuspendController.AutohideSuspendFlag; import com.android.launcher3.taskbar.TaskbarTranslationController.TransitionCallback; import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController; import com.android.launcher3.taskbar.overlay.TaskbarOverlayController; import com.android.launcher3.testing.TestLogging; Loading Loading @@ -224,6 +225,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { new TaskbarAllAppsController(), new TaskbarInsetsController(this), new VoiceInteractionWindowController(this), new TaskbarTranslationController(this), isDesktopMode ? new DesktopTaskbarRecentAppsController(this) : TaskbarRecentAppsController.DEFAULT); Loading Loading @@ -835,6 +837,20 @@ public class TaskbarActivityContext extends BaseTaskbarContext { mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(false); } /** * Called to start the taskbar translation spring to its settled translation (0). */ public void startTranslationSpring() { mControllers.taskbarTranslationController.startSpring(); } /** * Returns a callback to help monitor the swipe gesture. */ public TransitionCallback getTranslationCallbacks() { return mControllers.taskbarTranslationController.getTransitionCallback(); } /** * Called when a transient Autohide flag suspend status changes. */ Loading quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt +5 −2 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) { val paint: Paint = Paint() var backgroundHeight = context.deviceProfile.taskbarSize.toFloat() var translationYForSwipe = 0f private var maxBackgroundHeight = context.deviceProfile.taskbarSize.toFloat() private val transientBackgroundBounds = context.transientTaskbarBounds Loading Loading @@ -114,11 +115,13 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) { canvas.translate(canvas.width - rightCornerRadius, -rightCornerRadius) canvas.drawPath(invertedRightCornerPath, paint) } else { // Approximates the stash/unstash animation to transform the background. val scaleFactor = backgroundHeight / maxBackgroundHeight val width = transientBackgroundBounds.width() val widthScale = mapToRange(scaleFactor, 0f, 1f, 0.4f, 1f, Interpolators.LINEAR) val newWidth = widthScale * width val delta = width - newWidth canvas.translate(0f, bottomMargin * ((1f - scaleFactor) / 2f)) // Draw shadow. val shadowAlpha = mapToRange(paint.alpha.toFloat(), 0f, 255f, 0f, 25f, Loading @@ -132,9 +135,9 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) { canvas.drawRoundRect( transientBackgroundBounds.left + (delta / 2f), 0f, translationYForSwipe, transientBackgroundBounds.right - (delta / 2f), backgroundHeight, backgroundHeight + translationYForSwipe, radius, radius, paint ) } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java +5 −1 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ public class TaskbarControllers { public final TaskbarInsetsController taskbarInsetsController; public final VoiceInteractionWindowController voiceInteractionWindowController; public final TaskbarRecentAppsController taskbarRecentAppsController; public final TaskbarTranslationController taskbarTranslationController; public final TaskbarOverlayController taskbarOverlayController; @Nullable private LoggableTaskbarController[] mControllersToLog = null; Loading Loading @@ -92,6 +93,7 @@ public class TaskbarControllers { TaskbarAllAppsController taskbarAllAppsController, TaskbarInsetsController taskbarInsetsController, VoiceInteractionWindowController voiceInteractionWindowController, TaskbarTranslationController taskbarTranslationController, TaskbarRecentAppsController taskbarRecentAppsController) { this.taskbarActivityContext = taskbarActivityContext; this.taskbarDragController = taskbarDragController; Loading @@ -113,6 +115,7 @@ public class TaskbarControllers { this.taskbarAllAppsController = taskbarAllAppsController; this.taskbarInsetsController = taskbarInsetsController; this.voiceInteractionWindowController = voiceInteractionWindowController; this.taskbarTranslationController = taskbarTranslationController; this.taskbarRecentAppsController = taskbarRecentAppsController; } Loading Loading @@ -144,6 +147,7 @@ public class TaskbarControllers { taskbarInsetsController.init(this); voiceInteractionWindowController.init(this); taskbarRecentAppsController.init(this); taskbarTranslationController.init(this); mControllersToLog = new LoggableTaskbarController[] { taskbarDragController, navButtonController, navbarButtonsViewController, Loading @@ -151,7 +155,7 @@ public class TaskbarControllers { taskbarUnfoldAnimationController, taskbarKeyguardController, stashedHandleViewController, taskbarStashController, taskbarEduController, taskbarAutohideSuspendController, taskbarPopupController, taskbarInsetsController, voiceInteractionWindowController voiceInteractionWindowController, taskbarTranslationController }; mBackgroundRendererControllers = new BackgroundRendererController[] { taskbarDragLayerController, taskbarScrimViewController, Loading Loading
quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +9 −1 Original line number Diff line number Diff line Loading @@ -192,7 +192,15 @@ public class LauncherTaskbarUIController extends TaskbarUIController { */ public Animator createAnimToLauncher(@NonNull LauncherState toState, @NonNull RecentsAnimationCallbacks callbacks, long duration) { return mTaskbarLauncherStateController.createAnimToLauncher(toState, callbacks, duration); AnimatorSet set = new AnimatorSet(); Animator taskbarState = mTaskbarLauncherStateController .createAnimToLauncher(toState, callbacks, duration); long halfDuration = Math.round(duration * 0.5f); Animator translation = mControllers.taskbarTranslationController.createAnimToLauncher(halfDuration); set.playTogether(taskbarState, translation); return set; } public boolean isDraggingItem() { Loading
quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java +25 −5 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.RevealOutlineAnimation; import com.android.launcher3.anim.RoundedRectRevealOutlineProvider; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.Executors; import com.android.launcher3.util.MultiPropertyFactory; import com.android.launcher3.util.MultiValueAlpha; Loading Loading @@ -66,6 +67,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT // Initialized in init. private TaskbarControllers mControllers; private int mTaskbarSize; // The bounds we want to clip to in the settled state when showing the stashed handle. private final Rect mStashedHandleBounds = new Rect(); Loading Loading @@ -96,15 +98,18 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT DeviceProfile deviceProfile = mActivity.getDeviceProfile(); Resources resources = mActivity.getResources(); if (isPhoneGestureNavMode(mActivity.getDeviceProfile())) { mStashedHandleView.getLayoutParams().height = resources.getDimensionPixelSize(R.dimen.taskbar_size); mTaskbarSize = resources.getDimensionPixelSize(R.dimen.taskbar_size); mStashedHandleWidth = resources.getDimensionPixelSize(R.dimen.taskbar_stashed_small_screen); } else { mStashedHandleView.getLayoutParams().height = deviceProfile.taskbarSize; mTaskbarSize = deviceProfile.taskbarSize; mStashedHandleWidth = resources .getDimensionPixelSize(R.dimen.taskbar_stashed_handle_width); } int taskbarBottomMargin = DisplayController.isTransientTaskbar(mActivity) ? resources.getDimensionPixelSize(R.dimen.transient_taskbar_margin) : 0; mStashedHandleView.getLayoutParams().height = mTaskbarSize + taskbarBottomMargin; mTaskbarStashedHandleAlpha.get(ALPHA_INDEX_STASHED).setValue( isPhoneGestureNavMode(deviceProfile) ? 1 : 0); Loading Loading @@ -181,9 +186,17 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT * morphs into the size of where the taskbar icons will be. */ public Animator createRevealAnimToIsStashed(boolean isStashed) { Rect visualBounds = new Rect(mControllers.taskbarViewController.getIconLayoutBounds()); if (DisplayController.isTransientTaskbar(mActivity)) { // Account for the full visual height of the transient taskbar. int heightDiff = (mTaskbarSize - visualBounds.height()) / 2; visualBounds.top -= heightDiff; visualBounds.bottom += heightDiff; } final RevealOutlineAnimation handleRevealProvider = new RoundedRectRevealOutlineProvider( mStashedHandleRadius, mStashedHandleRadius, mControllers.taskbarViewController.getIconLayoutBounds(), mStashedHandleBounds); mStashedHandleRadius, mStashedHandleRadius, visualBounds, mStashedHandleBounds); boolean isReversed = !isStashed; boolean changingDirection = mWasLastRevealAnimReversed != isReversed; Loading Loading @@ -219,6 +232,13 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT mStashedHandleView.setScaleY(mTaskbarStashedHandleHintScale.value); } /** * Sets the translation of the stashed handle during the swipe up gesture. */ protected void setTranslationYForSwipe(float transY) { mStashedHandleView.setTranslationY(transY); } /** * Should be called when the home button is disabled, so we can hide this handle as well. */ Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +16 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.popup.PopupDataProvider; import com.android.launcher3.taskbar.TaskbarAutohideSuspendController.AutohideSuspendFlag; import com.android.launcher3.taskbar.TaskbarTranslationController.TransitionCallback; import com.android.launcher3.taskbar.allapps.TaskbarAllAppsController; import com.android.launcher3.taskbar.overlay.TaskbarOverlayController; import com.android.launcher3.testing.TestLogging; Loading Loading @@ -224,6 +225,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { new TaskbarAllAppsController(), new TaskbarInsetsController(this), new VoiceInteractionWindowController(this), new TaskbarTranslationController(this), isDesktopMode ? new DesktopTaskbarRecentAppsController(this) : TaskbarRecentAppsController.DEFAULT); Loading Loading @@ -835,6 +837,20 @@ public class TaskbarActivityContext extends BaseTaskbarContext { mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(false); } /** * Called to start the taskbar translation spring to its settled translation (0). */ public void startTranslationSpring() { mControllers.taskbarTranslationController.startSpring(); } /** * Returns a callback to help monitor the swipe gesture. */ public TransitionCallback getTranslationCallbacks() { return mControllers.taskbarTranslationController.getTransitionCallback(); } /** * Called when a transient Autohide flag suspend status changes. */ Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt +5 −2 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) { val paint: Paint = Paint() var backgroundHeight = context.deviceProfile.taskbarSize.toFloat() var translationYForSwipe = 0f private var maxBackgroundHeight = context.deviceProfile.taskbarSize.toFloat() private val transientBackgroundBounds = context.transientTaskbarBounds Loading Loading @@ -114,11 +115,13 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) { canvas.translate(canvas.width - rightCornerRadius, -rightCornerRadius) canvas.drawPath(invertedRightCornerPath, paint) } else { // Approximates the stash/unstash animation to transform the background. val scaleFactor = backgroundHeight / maxBackgroundHeight val width = transientBackgroundBounds.width() val widthScale = mapToRange(scaleFactor, 0f, 1f, 0.4f, 1f, Interpolators.LINEAR) val newWidth = widthScale * width val delta = width - newWidth canvas.translate(0f, bottomMargin * ((1f - scaleFactor) / 2f)) // Draw shadow. val shadowAlpha = mapToRange(paint.alpha.toFloat(), 0f, 255f, 0f, 25f, Loading @@ -132,9 +135,9 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) { canvas.drawRoundRect( transientBackgroundBounds.left + (delta / 2f), 0f, translationYForSwipe, transientBackgroundBounds.right - (delta / 2f), backgroundHeight, backgroundHeight + translationYForSwipe, radius, radius, paint ) } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java +5 −1 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ public class TaskbarControllers { public final TaskbarInsetsController taskbarInsetsController; public final VoiceInteractionWindowController voiceInteractionWindowController; public final TaskbarRecentAppsController taskbarRecentAppsController; public final TaskbarTranslationController taskbarTranslationController; public final TaskbarOverlayController taskbarOverlayController; @Nullable private LoggableTaskbarController[] mControllersToLog = null; Loading Loading @@ -92,6 +93,7 @@ public class TaskbarControllers { TaskbarAllAppsController taskbarAllAppsController, TaskbarInsetsController taskbarInsetsController, VoiceInteractionWindowController voiceInteractionWindowController, TaskbarTranslationController taskbarTranslationController, TaskbarRecentAppsController taskbarRecentAppsController) { this.taskbarActivityContext = taskbarActivityContext; this.taskbarDragController = taskbarDragController; Loading @@ -113,6 +115,7 @@ public class TaskbarControllers { this.taskbarAllAppsController = taskbarAllAppsController; this.taskbarInsetsController = taskbarInsetsController; this.voiceInteractionWindowController = voiceInteractionWindowController; this.taskbarTranslationController = taskbarTranslationController; this.taskbarRecentAppsController = taskbarRecentAppsController; } Loading Loading @@ -144,6 +147,7 @@ public class TaskbarControllers { taskbarInsetsController.init(this); voiceInteractionWindowController.init(this); taskbarRecentAppsController.init(this); taskbarTranslationController.init(this); mControllersToLog = new LoggableTaskbarController[] { taskbarDragController, navButtonController, navbarButtonsViewController, Loading @@ -151,7 +155,7 @@ public class TaskbarControllers { taskbarUnfoldAnimationController, taskbarKeyguardController, stashedHandleViewController, taskbarStashController, taskbarEduController, taskbarAutohideSuspendController, taskbarPopupController, taskbarInsetsController, voiceInteractionWindowController voiceInteractionWindowController, taskbarTranslationController }; mBackgroundRendererControllers = new BackgroundRendererController[] { taskbarDragLayerController, taskbarScrimViewController, Loading