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

Commit ec0b4e16 authored by Jagrut Desai's avatar Jagrut Desai
Browse files

Removing ENABLE_ALL_APPS_IN_TASKBAR and FLAG_STASHED_IN_APP_EMPTY

Test: Visual(pics in buganizer)
Bug: 265462138
Bug: 267382941

Change-Id: I223cd5ea7e5b553619dfc81c36f1be93e399639d
parent 6fa1ab94
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -289,6 +289,7 @@

    <!-- Transient taskbar -->
    <dimen name="transient_taskbar_size">72dp</dimen>
    <dimen name="transient_taskbar_min_width">150dp</dimen>
    <dimen name="transient_taskbar_icon_size">48dp</dimen>
    <dimen name="transient_taskbar_margin">24dp</dimen>
    <dimen name="transient_taskbar_shadow_blur">40dp</dimen>
+0 −7
Original line number Diff line number Diff line
@@ -199,13 +199,6 @@ public class TaskbarModelCallbacks implements
        hotseatItemInfos = mControllers.taskbarRecentAppsController
                .updateHotseatItemInfos(hotseatItemInfos);
        mContainer.updateHotseatItems(hotseatItemInfos);

        final boolean finalIsHotseatEmpty = isHotseatEmpty;
        mControllers.runAfterInit(() -> {
            mControllers.taskbarStashController.updateStateForFlag(
                    TaskbarStashController.FLAG_STASHED_IN_APP_EMPTY, finalIsHotseatEmpty);
            mControllers.taskbarStashController.applyState();
        });
    }

    @Override
+8 −10
Original line number Diff line number Diff line
@@ -72,21 +72,20 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
    public static final int FLAG_IN_APP = 1 << 0;
    public static final int FLAG_STASHED_IN_APP_MANUAL = 1 << 1; // long press, persisted
    public static final int FLAG_STASHED_IN_SYSUI_STATE = 1 << 2; // app pinning, keyguard, etc.
    public static final int FLAG_STASHED_IN_APP_EMPTY = 1 << 3; // no hotseat icons
    public static final int FLAG_STASHED_IN_APP_SETUP = 1 << 4; // setup wizard and AllSetActivity
    public static final int FLAG_STASHED_IN_APP_IME = 1 << 5; // IME is visible
    public static final int FLAG_IN_STASHED_LAUNCHER_STATE = 1 << 6;
    public static final int FLAG_STASHED_IN_TASKBAR_ALL_APPS = 1 << 7; // All apps is visible.
    public static final int FLAG_IN_SETUP = 1 << 8; // In the Setup Wizard
    public static final int FLAG_STASHED_SMALL_SCREEN = 1 << 9; // phone screen gesture nav, stashed
    public static final int FLAG_STASHED_IN_APP_AUTO = 1 << 10; // Autohide (transient taskbar).
    public static final int FLAG_STASHED_IN_APP_SETUP = 1 << 3; // setup wizard and AllSetActivity
    public static final int FLAG_STASHED_IN_APP_IME = 1 << 4; // IME is visible
    public static final int FLAG_IN_STASHED_LAUNCHER_STATE = 1 << 5;
    public static final int FLAG_STASHED_IN_TASKBAR_ALL_APPS = 1 << 6; // All apps is visible.
    public static final int FLAG_IN_SETUP = 1 << 7; // In the Setup Wizard
    public static final int FLAG_STASHED_SMALL_SCREEN = 1 << 8; // phone screen gesture nav, stashed
    public static final int FLAG_STASHED_IN_APP_AUTO = 1 << 9; // Autohide (transient taskbar).

    // If any of these flags are enabled, isInApp should return true.
    private static final int FLAGS_IN_APP = FLAG_IN_APP | FLAG_IN_SETUP;

    // If we're in an app and any of these flags are enabled, taskbar should be stashed.
    private static final int FLAGS_STASHED_IN_APP = FLAG_STASHED_IN_APP_MANUAL
            | FLAG_STASHED_IN_SYSUI_STATE | FLAG_STASHED_IN_APP_EMPTY | FLAG_STASHED_IN_APP_SETUP
            | FLAG_STASHED_IN_SYSUI_STATE | FLAG_STASHED_IN_APP_SETUP
            | FLAG_STASHED_IN_APP_IME | FLAG_STASHED_IN_TASKBAR_ALL_APPS
            | FLAG_STASHED_SMALL_SCREEN | FLAG_STASHED_IN_APP_AUTO;

@@ -929,7 +928,6 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
        appendFlag(sj, flags, FLAGS_IN_APP, "FLAG_IN_APP");
        appendFlag(sj, flags, FLAG_STASHED_IN_APP_MANUAL, "FLAG_STASHED_IN_APP_MANUAL");
        appendFlag(sj, flags, FLAG_STASHED_IN_SYSUI_STATE, "FLAG_STASHED_IN_SYSUI_STATE");
        appendFlag(sj, flags, FLAG_STASHED_IN_APP_EMPTY, "FLAG_STASHED_IN_APP_EMPTY");
        appendFlag(sj, flags, FLAG_STASHED_IN_APP_SETUP, "FLAG_STASHED_IN_APP_SETUP");
        appendFlag(sj, flags, FLAG_STASHED_IN_APP_IME, "FLAG_STASHED_IN_APP_IME");
        appendFlag(sj, flags, FLAG_IN_STASHED_LAUNCHER_STATE, "FLAG_IN_STASHED_LAUNCHER_STATE");
+21 −4
Original line number Diff line number Diff line
@@ -88,6 +88,8 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar

    private View mQsb;

    private float mTransientTaskbarMinWidth;

    public TaskbarView(@NonNull Context context) {
        this(context, null);
    }
@@ -108,6 +110,8 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        mIconLayoutBounds = mActivityContext.getTransientTaskbarBounds();
        Resources resources = getResources();
        mIsRtl = Utilities.isRtl(resources);
        mTransientTaskbarMinWidth = mContext.getResources().getDimension(
                R.dimen.transient_taskbar_min_width);

        int actualMargin = resources.getDimensionPixelSize(R.dimen.taskbar_icon_spacing);
        int actualIconSize = mActivityContext.getDeviceProfile().iconSizePx;
@@ -124,11 +128,9 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar

        mThemeIconsBackground = calculateThemeIconsBackground();

        if (FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get()
                && !mActivityContext.getPackageManager().hasSystemFeature(FEATURE_PC)) {
        if (!mActivityContext.getPackageManager().hasSystemFeature(FEATURE_PC)) {
            mAllAppsButton = (IconButtonView) LayoutInflater.from(context)
                    .inflate(R.layout.taskbar_all_apps_button, this, false);
            mAllAppsButton.setPadding(mItemPadding, mItemPadding, mItemPadding, mItemPadding);
            mAllAppsButton.setScaleX(mIsRtl ? -1 : 1);
            mAllAppsButton.setForegroundTint(mActivityContext.getColor(
                    DisplayController.isTransientTaskbar(mActivityContext)
@@ -277,7 +279,8 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        if (mAllAppsButton != null) {
            addView(mAllAppsButton, mIsRtl ? getChildCount() : 0);

            if (mTaskbarDivider != null) {
            // if only all apps button present, don't include divider view.
            if (mTaskbarDivider != null && getChildCount() > 1) {
                addView(mTaskbarDivider, mIsRtl ? (getChildCount() - 1) : 1);
            }
        }
@@ -319,6 +322,11 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        int count = getChildCount();
        DeviceProfile deviceProfile = mActivityContext.getDeviceProfile();
        int spaceNeeded = getIconLayoutWidth();
        // We are removing the margin from taskbar divider item in taskbar,
        // so remove it from spacing also.
        if (FeatureFlags.ENABLE_TASKBAR_PINNING.get() && count > 1) {
            spaceNeeded -= mIconTouchSize;
        }
        int navSpaceNeeded = deviceProfile.hotseatBarEndOffset;
        boolean layoutRtl = isLayoutRtl();
        int iconEnd = right - (right - left - spaceNeeded) / 2;
@@ -362,7 +370,15 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
                iconEnd = iconStart - mItemMarginLeftRight;
            }
        }

        mIconLayoutBounds.left = iconEnd;

        if (mIconLayoutBounds.right - mIconLayoutBounds.left < mTransientTaskbarMinWidth) {
            int center = mIconLayoutBounds.centerX();
            int distanceFromCenter = (int) mTransientTaskbarMinWidth / 2;
            mIconLayoutBounds.right = center + distanceFromCenter;
            mIconLayoutBounds.left = center - distanceFromCenter;
        }
    }

    @Override
@@ -519,6 +535,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar

    /**
     * Finds the first icon to match one of the given matchers, from highest to lowest priority.
     *
     * @return The first match, or All Apps button if no match was found.
     */
    public View getFirstMatch(Predicate<ItemInfo>... matchers) {
+2 −3
Original line number Diff line number Diff line
@@ -339,8 +339,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
        for (int i = 0; i < mTaskbarView.getChildCount(); i++) {
            View child = mTaskbarView.getChildAt(i);
            int positionInHotseat;
            boolean isAllAppsButton = FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get()
                    && child == mTaskbarView.getAllAppsButtonView();
            boolean isAllAppsButton = child == mTaskbarView.getAllAppsButtonView();
            if (!mIsHotseatIconOnTopWhenAligned) {
                // When going to home, the EMPHASIZED interpolator in TaskbarLauncherStateController
                // plays iconAlignment to 1 really fast, therefore moving the fading towards the end
@@ -589,7 +588,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
    }

    public static final FloatProperty<View> ICON_TRANSLATE_X =
            new FloatProperty<View>("taskbarAligmentTranslateX") {
            new FloatProperty<View>("taskbarAlignmentTranslateX") {

                @Override
                public void setValue(View view, float v) {
Loading