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

Commit e1eaefd5 authored by Brian Isganitis's avatar Brian Isganitis
Browse files

Initial prototype of tiny taskbar.

Introducing isTinyTaskbar and using in a few places to show Taskbar on
phones.

Disabling for three button mode since the buttons will take up most of
the space. Could also prototype adding meta key as a 4th button in
this case if we feel like it.

Flag: com.android.wm.shell.enable_tiny_taskbar
Test: Manual
Bug: 341784466
Change-Id: Iba07382d9bd5d14fc29ef080a390db561f6fd454
parent d061c71e
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_N
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING;
import static com.android.window.flags.Flags.enableDesktopWindowingMode;
import static com.android.window.flags.Flags.enableDesktopWindowingTaskbarRunningApps;
import static com.android.wm.shell.Flags.enableTinyTaskbar;

import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
@@ -416,7 +417,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
     * single window for taskbar and navbar.
     */
    public boolean isPhoneMode() {
        return ENABLE_TASKBAR_NAVBAR_UNIFICATION && mDeviceProfile.isPhone;
        return ENABLE_TASKBAR_NAVBAR_UNIFICATION
                && mDeviceProfile.isPhone
                && !mDeviceProfile.isTaskbarPresent;
    }

    /**
@@ -433,6 +436,11 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        return isPhoneMode() && !isThreeButtonNav();
    }

    /** Returns {@code true} iff a tiny version of taskbar is shown on phone. */
    public boolean isTinyTaskbar() {
        return enableTinyTaskbar() && mDeviceProfile.isPhone && mDeviceProfile.isTaskbarPresent;
    }

    /**
     * Returns if software keyboard is docked or input toolbar is placed at the taskbar area
     */
@@ -981,7 +989,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
    public int getDefaultTaskbarWindowSize() {
        Resources resources = getResources();

        if (ENABLE_TASKBAR_NAVBAR_UNIFICATION && mDeviceProfile.isPhone) {
        if (isPhoneMode()) {
            return isThreeButtonNav() ?
                    resources.getDimensionPixelSize(R.dimen.taskbar_phone_size) :
                    resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size);
+1 −1
Original line number Diff line number Diff line
@@ -519,7 +519,7 @@ public class TaskbarManager {
        }
    }

    private static boolean isTaskbarEnabled(DeviceProfile deviceProfile) {
    private boolean isTaskbarEnabled(DeviceProfile deviceProfile) {
        return ENABLE_TASKBAR_NAVBAR_UNIFICATION || deviceProfile.isTaskbarPresent;
    }

+2 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTO
import static com.android.launcher3.testing.shared.ResourceUtils.INVALID_RESOURCE_HANDLE;
import static com.android.launcher3.testing.shared.ResourceUtils.pxFromDp;
import static com.android.launcher3.testing.shared.ResourceUtils.roundPxValueFromFloat;
import static com.android.wm.shell.Flags.enableTinyTaskbar;

import android.annotation.SuppressLint;
import android.content.Context;
@@ -353,7 +354,7 @@ public class DeviceProfile {
        isTablet = info.isTablet(windowBounds);
        isPhone = !isTablet;
        isTwoPanels = isTablet && isMultiDisplay;
        isTaskbarPresent = isTablet
        isTaskbarPresent = (isTablet || (enableTinyTaskbar() && isGestureMode))
                && WindowManagerProxy.INSTANCE.get(context).isTaskbarDrawnInProcess();

        // Some more constants.