Loading quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +4 −0 Original line number Diff line number Diff line Loading @@ -456,6 +456,10 @@ public class TaskbarActivityContext extends BaseTaskbarContext { return mTransientTaskbarBounds; } protected float getCurrentTaskbarWidth() { return mControllers.taskbarViewController.getCurrentVisualTaskbarWidth(); } @Override public StatsLogManager getStatsLogManager() { // Used to mock, can't mock a default interface method directly Loading quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt +1 −6 Original line number Diff line number Diff line Loading @@ -203,12 +203,7 @@ class TaskbarBackgroundRenderer(private val context: TaskbarActivityContext) { val newBackgroundHeight = mapRange(progress, backgroundHeightWhileAnimating, maxTransientTaskbarHeight) val fullWidth = transientBackgroundBounds.width() // .9f is here to restrict min width of the background while animating, so transient // background keeps it pill shape until animation end. val animationWidth = if (DisplayController.isTransientTaskbar(context)) fullWidth.toFloat() * .9f else fullWidth.toFloat() val animationWidth = context.currentTaskbarWidth val backgroundWidthWhileAnimating = if (isAnimatingPinning) animationWidth else stashedHandleWidth.toFloat() Loading quickstep/src/com/android/launcher3/taskbar/TaskbarPinningController.kt +3 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.SuppressLint import android.view.View import androidx.annotation.VisibleForTesting import androidx.core.animation.doOnEnd import com.android.app.animation.Interpolators import com.android.launcher3.LauncherPrefs import com.android.launcher3.LauncherPrefs.Companion.TASKBAR_PINNING import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_DIVIDER_MENU_CLOSE Loading Loading @@ -106,6 +107,7 @@ class TaskbarPinningController(private val context: TaskbarActivityContext) : taskbarViewController.taskbarIconTranslationXForPinning.animateToValue(animateToValue) ) animatorSet.interpolator = Interpolators.EMPHASIZED return animatorSet } Loading @@ -129,6 +131,6 @@ class TaskbarPinningController(private val context: TaskbarActivityContext) : companion object { const val PINNING_PERSISTENT = 1f const val PINNING_TRANSIENT = 0f const val PINNING_ANIMATION_DURATION = 500L const val PINNING_ANIMATION_DURATION = 600L } } quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +25 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,8 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar private final int mTransientIconSize; private final int mPersistentIconSize; private final float mTaskbarLeftRightMargin; public TaskbarViewController(TaskbarActivityContext activity, TaskbarView taskbarView) { mActivity = activity; mTransientTaskbarDp = mActivity.getTransientTaskbarDeviceProfile(); Loading @@ -184,6 +186,9 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar mTaskbarThemedIconsBackgroundColor = ColorUtils.HSLToColor(colorHSL); } mIsRtl = Utilities.isRtl(mTaskbarView.getResources()); mTaskbarLeftRightMargin = mActivity.getResources().getDimensionPixelSize( R.dimen.transient_taskbar_padding); } public void init(TaskbarControllers controllers) { Loading Loading @@ -391,6 +396,26 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar } } /** * Calculates visual taskbar view width. */ public float getCurrentVisualTaskbarWidth() { if (mTaskbarView.getIconViews().length == 0) { return 0; } View[] iconViews = mTaskbarView.getIconViews(); int leftIndex = mActivity.getDeviceProfile().isQsbInline && !mIsRtl ? 1 : 0; int rightIndex = mActivity.getDeviceProfile().isQsbInline && mIsRtl ? iconViews.length - 2 : iconViews.length - 1; float left = iconViews[leftIndex].getX(); float right = iconViews[rightIndex].getRight() + iconViews[rightIndex].getTranslationX(); return right - left + (2 * mTaskbarLeftRightMargin); } /** * Sets the translation of the TaskbarView during the swipe up gesture. Loading Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +4 −0 Original line number Diff line number Diff line Loading @@ -456,6 +456,10 @@ public class TaskbarActivityContext extends BaseTaskbarContext { return mTransientTaskbarBounds; } protected float getCurrentTaskbarWidth() { return mControllers.taskbarViewController.getCurrentVisualTaskbarWidth(); } @Override public StatsLogManager getStatsLogManager() { // Used to mock, can't mock a default interface method directly Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt +1 −6 Original line number Diff line number Diff line Loading @@ -203,12 +203,7 @@ class TaskbarBackgroundRenderer(private val context: TaskbarActivityContext) { val newBackgroundHeight = mapRange(progress, backgroundHeightWhileAnimating, maxTransientTaskbarHeight) val fullWidth = transientBackgroundBounds.width() // .9f is here to restrict min width of the background while animating, so transient // background keeps it pill shape until animation end. val animationWidth = if (DisplayController.isTransientTaskbar(context)) fullWidth.toFloat() * .9f else fullWidth.toFloat() val animationWidth = context.currentTaskbarWidth val backgroundWidthWhileAnimating = if (isAnimatingPinning) animationWidth else stashedHandleWidth.toFloat() Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarPinningController.kt +3 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.SuppressLint import android.view.View import androidx.annotation.VisibleForTesting import androidx.core.animation.doOnEnd import com.android.app.animation.Interpolators import com.android.launcher3.LauncherPrefs import com.android.launcher3.LauncherPrefs.Companion.TASKBAR_PINNING import com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_DIVIDER_MENU_CLOSE Loading Loading @@ -106,6 +107,7 @@ class TaskbarPinningController(private val context: TaskbarActivityContext) : taskbarViewController.taskbarIconTranslationXForPinning.animateToValue(animateToValue) ) animatorSet.interpolator = Interpolators.EMPHASIZED return animatorSet } Loading @@ -129,6 +131,6 @@ class TaskbarPinningController(private val context: TaskbarActivityContext) : companion object { const val PINNING_PERSISTENT = 1f const val PINNING_TRANSIENT = 0f const val PINNING_ANIMATION_DURATION = 500L const val PINNING_ANIMATION_DURATION = 600L } }
quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +25 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,8 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar private final int mTransientIconSize; private final int mPersistentIconSize; private final float mTaskbarLeftRightMargin; public TaskbarViewController(TaskbarActivityContext activity, TaskbarView taskbarView) { mActivity = activity; mTransientTaskbarDp = mActivity.getTransientTaskbarDeviceProfile(); Loading @@ -184,6 +186,9 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar mTaskbarThemedIconsBackgroundColor = ColorUtils.HSLToColor(colorHSL); } mIsRtl = Utilities.isRtl(mTaskbarView.getResources()); mTaskbarLeftRightMargin = mActivity.getResources().getDimensionPixelSize( R.dimen.transient_taskbar_padding); } public void init(TaskbarControllers controllers) { Loading Loading @@ -391,6 +396,26 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar } } /** * Calculates visual taskbar view width. */ public float getCurrentVisualTaskbarWidth() { if (mTaskbarView.getIconViews().length == 0) { return 0; } View[] iconViews = mTaskbarView.getIconViews(); int leftIndex = mActivity.getDeviceProfile().isQsbInline && !mIsRtl ? 1 : 0; int rightIndex = mActivity.getDeviceProfile().isQsbInline && mIsRtl ? iconViews.length - 2 : iconViews.length - 1; float left = iconViews[leftIndex].getX(); float right = iconViews[rightIndex].getRight() + iconViews[rightIndex].getTranslationX(); return right - left + (2 * mTaskbarLeftRightMargin); } /** * Sets the translation of the TaskbarView during the swipe up gesture. Loading