Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0dce287a authored by Jagrut Desai's avatar Jagrut Desai
Browse files

Change Taskbar Window height logic for taskbar pinning.

- Breakout CL part 6
- This is a breakout cl from ag/24272821 to make it more readable and atomic.
- This cl makes default taskbar window height to be transient when the taskbar pinning flag is on, so we don't see taskbar window cutoff during animation.

Test: Manual, Visual
Bug: 265170176
Flag: ENABLE_TASKBAR_PINNING
Change-Id: I37e8ad0f2c4d144476828f101019dcacdea7acb2
parent a84e5041
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE;
import static com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_OVERLAY_PROXY;
import static com.android.launcher3.Utilities.isRunningInTestHarness;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_PINNING;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NO_RECREATION;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING;
@@ -842,9 +843,17 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
            return getSetupWindowHeight();
        }

        if (DisplayController.isTransientTaskbar(this)) {
            return mDeviceProfile.taskbarHeight
                    + (2 * mDeviceProfile.taskbarBottomMargin)
        boolean shouldTreatAsTransient = DisplayController.isTransientTaskbar(this)
                || (ENABLE_TASKBAR_PINNING.get() && !isThreeButtonNav());

        // Return transient taskbar window height when pinning feature is enabled, so taskbar view
        // does not get cut off during pinning animation.
        if (shouldTreatAsTransient) {
            DeviceProfile transientTaskbarDp = mDeviceProfile.toBuilder(this)
                    .setIsTransientTaskbar(true).build();

            return transientTaskbarDp.taskbarHeight
                    + (2 * transientTaskbarDp.taskbarBottomMargin)
                    + resources.getDimensionPixelSize(R.dimen.transient_taskbar_shadow_blur);
        }