Loading quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt +11 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) { private val fullRightCornerRadius = context.rightCornerRadius.toFloat() private var leftCornerRadius = fullLeftCornerRadius private var rightCornerRadius = fullRightCornerRadius private var widthInsetPercentage = 0f private val square: Path = Path() private val circle: Path = Path() private val invertedLeftCornerPath: Path = Path() Loading Loading @@ -166,12 +167,22 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) { transientBackgroundBounds.right - halfWidthDelta, bottom ) val horizontalInset = fullWidth * widthInsetPercentage lastDrawnTransientRect.inset(horizontalInset, 0f) canvas.drawRoundRect(lastDrawnTransientRect, radius, radius, paint) } canvas.restore() } /** * Sets the width percentage to inset the transient taskbar's background from the left and from * the right. */ fun setBackgroundHorizontalInsets(insetPercentage: Float) { widthInsetPercentage = insetPercentage } companion object { const val DEFAULT_ROUNDNESS = 1f } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java +9 −0 Original line number Diff line number Diff line Loading @@ -200,4 +200,13 @@ public class TaskbarDragLayer extends BaseDragLayer<TaskbarActivityContext> { } return super.dispatchKeyEvent(event); } /** * Sets the width percentage to inset the transient taskbar's background from the left and from * the right. */ public void setBackgroundHorizontalInsets(float insetPercentage) { mBackgroundRenderer.setBackgroundHorizontalInsets(insetPercentage); invalidate(); } } quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java +9 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,15 @@ public class TaskbarDragLayerController implements TaskbarControllers.LoggableTa mLastSetBackgroundAlpha * (1 - mBgOffset.value)); } /** * Sets the width percentage to inset the transient taskbar's background from the left and from * the right. */ public void setBackgroundHorizontalInsets(float insetPercentage) { mTaskbarDragLayer.setBackgroundHorizontalInsets(insetPercentage); } @Override public void dumpLogs(String prefix, PrintWriter pw) { pw.println(prefix + "TaskbarDragLayerController:"); Loading quickstep/src/com/android/launcher3/taskbar/TaskbarUnfoldAnimationController.java +7 −0 Original line number Diff line number Diff line Loading @@ -33,11 +33,14 @@ import java.io.PrintWriter; public class TaskbarUnfoldAnimationController implements TaskbarControllers.LoggableTaskbarController { private static final float MAX_WIDTH_INSET_FRACTION = 0.035f; private final ScopedUnfoldTransitionProgressProvider mScopedUnfoldTransitionProgressProvider; private final NaturalRotationUnfoldProgressProvider mNaturalUnfoldTransitionProgressProvider; private final UnfoldMoveFromCenterAnimator mMoveFromCenterAnimator; private final TransitionListener mTransitionListener = new TransitionListener(); private TaskbarViewController mTaskbarViewController; private TaskbarDragLayerController mTaskbarDragLayerController; public TaskbarUnfoldAnimationController(BaseTaskbarContext context, ScopedUnfoldTransitionProgressProvider source, Loading @@ -63,6 +66,7 @@ public class TaskbarUnfoldAnimationController implements mTaskbarViewController.addOneTimePreDrawListener(() -> mScopedUnfoldTransitionProgressProvider.setReadyToHandleTransition(true)); mNaturalUnfoldTransitionProgressProvider.addCallback(mTransitionListener); mTaskbarDragLayerController = taskbarControllers.taskbarDragLayerController; } /** Loading Loading @@ -99,11 +103,14 @@ public class TaskbarUnfoldAnimationController implements public void onTransitionFinished() { mMoveFromCenterAnimator.onTransitionFinished(); mMoveFromCenterAnimator.clearRegisteredViews(); mTaskbarDragLayerController.setBackgroundHorizontalInsets(0f); } @Override public void onTransitionProgress(float progress) { mMoveFromCenterAnimator.onTransitionProgress(progress); float insetPercentage = (1 - progress) * MAX_WIDTH_INSET_FRACTION; mTaskbarDragLayerController.setBackgroundHorizontalInsets(insetPercentage); } } } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt +11 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) { private val fullRightCornerRadius = context.rightCornerRadius.toFloat() private var leftCornerRadius = fullLeftCornerRadius private var rightCornerRadius = fullRightCornerRadius private var widthInsetPercentage = 0f private val square: Path = Path() private val circle: Path = Path() private val invertedLeftCornerPath: Path = Path() Loading Loading @@ -166,12 +167,22 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) { transientBackgroundBounds.right - halfWidthDelta, bottom ) val horizontalInset = fullWidth * widthInsetPercentage lastDrawnTransientRect.inset(horizontalInset, 0f) canvas.drawRoundRect(lastDrawnTransientRect, radius, radius, paint) } canvas.restore() } /** * Sets the width percentage to inset the transient taskbar's background from the left and from * the right. */ fun setBackgroundHorizontalInsets(insetPercentage: Float) { widthInsetPercentage = insetPercentage } companion object { const val DEFAULT_ROUNDNESS = 1f } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java +9 −0 Original line number Diff line number Diff line Loading @@ -200,4 +200,13 @@ public class TaskbarDragLayer extends BaseDragLayer<TaskbarActivityContext> { } return super.dispatchKeyEvent(event); } /** * Sets the width percentage to inset the transient taskbar's background from the left and from * the right. */ public void setBackgroundHorizontalInsets(float insetPercentage) { mBackgroundRenderer.setBackgroundHorizontalInsets(insetPercentage); invalidate(); } }
quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java +9 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,15 @@ public class TaskbarDragLayerController implements TaskbarControllers.LoggableTa mLastSetBackgroundAlpha * (1 - mBgOffset.value)); } /** * Sets the width percentage to inset the transient taskbar's background from the left and from * the right. */ public void setBackgroundHorizontalInsets(float insetPercentage) { mTaskbarDragLayer.setBackgroundHorizontalInsets(insetPercentage); } @Override public void dumpLogs(String prefix, PrintWriter pw) { pw.println(prefix + "TaskbarDragLayerController:"); Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarUnfoldAnimationController.java +7 −0 Original line number Diff line number Diff line Loading @@ -33,11 +33,14 @@ import java.io.PrintWriter; public class TaskbarUnfoldAnimationController implements TaskbarControllers.LoggableTaskbarController { private static final float MAX_WIDTH_INSET_FRACTION = 0.035f; private final ScopedUnfoldTransitionProgressProvider mScopedUnfoldTransitionProgressProvider; private final NaturalRotationUnfoldProgressProvider mNaturalUnfoldTransitionProgressProvider; private final UnfoldMoveFromCenterAnimator mMoveFromCenterAnimator; private final TransitionListener mTransitionListener = new TransitionListener(); private TaskbarViewController mTaskbarViewController; private TaskbarDragLayerController mTaskbarDragLayerController; public TaskbarUnfoldAnimationController(BaseTaskbarContext context, ScopedUnfoldTransitionProgressProvider source, Loading @@ -63,6 +66,7 @@ public class TaskbarUnfoldAnimationController implements mTaskbarViewController.addOneTimePreDrawListener(() -> mScopedUnfoldTransitionProgressProvider.setReadyToHandleTransition(true)); mNaturalUnfoldTransitionProgressProvider.addCallback(mTransitionListener); mTaskbarDragLayerController = taskbarControllers.taskbarDragLayerController; } /** Loading Loading @@ -99,11 +103,14 @@ public class TaskbarUnfoldAnimationController implements public void onTransitionFinished() { mMoveFromCenterAnimator.onTransitionFinished(); mMoveFromCenterAnimator.clearRegisteredViews(); mTaskbarDragLayerController.setBackgroundHorizontalInsets(0f); } @Override public void onTransitionProgress(float progress) { mMoveFromCenterAnimator.onTransitionProgress(progress); float insetPercentage = (1 - progress) * MAX_WIDTH_INSET_FRACTION; mTaskbarDragLayerController.setBackgroundHorizontalInsets(insetPercentage); } } }