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

Verified Commit fd12bdfe authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊 Committed by Saalim Quadri
Browse files

feat: Disable all apps in taskbar

parent f9802988
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1824,7 +1824,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
                duration);

        View allAppsButton = mControllers.taskbarViewController.getAllAppsButtonView();
        if (!FeatureFlags.enableAllAppsButtonInHotseat()) {
        if (allAppsButton != null && !FeatureFlags.enableAllAppsButtonInHotseat()) {
            ValueAnimator alphaOverride = ValueAnimator.ofFloat(0, 1);
            alphaOverride.setDuration(duration);
            alphaOverride.addUpdateListener(a -> {
+35 −20
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import com.android.launcher3.Insettable;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.apppairs.AppPairIcon;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.folder.PreviewBackground;
import com.android.launcher3.model.data.AppPairInfo;
@@ -105,7 +106,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
    @Nullable private FolderIcon mLeaveBehindFolderIcon;

    // Only non-null when device supports having an All Apps button.
    private final TaskbarAllAppsButtonContainer mAllAppsButtonContainer;
    @Nullable private TaskbarAllAppsButtonContainer mAllAppsButtonContainer;

    // Only non-null when device supports having a Divider button.
    @Nullable private TaskbarDividerContainer mTaskbarDividerContainer;
@@ -130,7 +131,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
    private int mMaxNumIcons = 0;
    private int mIdealNumIcons = 0;

    private final int mAllAppsButtonTranslationOffset;
    private int mAllAppsButtonTranslationOffset;

    private final int mNumStaticViews;

@@ -182,9 +183,12 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        // Needed to draw folder leave-behind when opening one.
        setWillNotDraw(false);

        if (FeatureFlags.enableAllAppsButtonInTaskbar()) {
            mAllAppsButtonContainer = new TaskbarAllAppsButtonContainer(context);

            mAllAppsButtonTranslationOffset = (int) getResources().getDimension(
                    mAllAppsButtonContainer.getAllAppsButtonTranslationXOffset(isTransientTaskbar()));
        }

        if (enableTaskbarPinning() || enableRecentsInTaskbar()) {
            mTaskbarDividerContainer = new TaskbarDividerContainer(context);
@@ -236,12 +240,14 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar

        // All apps icon takes less space compared to normal icon size, reserve space for the icon
        // separately.
        if (mAllAppsButtonContainer != null) {
            boolean forceTransientTaskbarSize =
                    enableTaskbarPinning() && !mActivityContext.isThreeButtonNav();
            availableWidth -= iconSize - (int) getResources().getDimension(
                    mAllAppsButtonContainer.getAllAppsButtonTranslationXOffset(
                            forceTransientTaskbarSize || isTransientTaskbar()));
            ++additionalIcons;
        }

        return Math.floorDiv(availableWidth, iconSize) + additionalIcons;
    }
@@ -270,7 +276,9 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
     */
    private int addStaticViews() {
        int numStaticViews = 1;
        if (mAllAppsButtonContainer != null) {
            addView(mAllAppsButtonContainer);
        }
        if (mActivityContext.getDeviceProfile().isQsbInline) {
            addView(mQsb, mIsRtl ? 1 : 0);
            mQsb.setVisibility(View.INVISIBLE);
@@ -361,7 +369,9 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        mIconClickListener = mControllerCallbacks.getIconOnClickListener();
        mIconLongClickListener = mControllerCallbacks.getIconOnLongClickListener();

        if (mAllAppsButtonContainer != null) {
            mAllAppsButtonContainer.setUpCallbacks(callbacks);
        }
        if (mTaskbarDividerContainer != null
                && mActivityContext.getTaskbarFeatureEvaluator().getSupportsPinningPopup()) {
            mTaskbarDividerContainer.setUpCallbacks(callbacks);
@@ -428,7 +438,9 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
        mNextViewIndex = 0;
        mAddedDividerForRecents = false;

        if (mAllAppsButtonContainer != null) {
            removeView(mAllAppsButtonContainer);
        }

        if (mTaskbarDividerContainer != null) {
            removeView(mTaskbarDividerContainer);
@@ -447,6 +459,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar

        updateRecents(recentTasks);

        if (mAllAppsButtonContainer != null) {
            addView(mAllAppsButtonContainer, mIsRtl ? hotseatItemInfos.length : 0);

            // If there are no recent tasks, add divider after All Apps (unless it's the only view).
@@ -455,6 +468,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
                    && getChildCount() > 1) {
                addView(mTaskbarDividerContainer, mIsRtl ? (getChildCount() - 1) : 1);
            }
        }

        if (mActivityContext.getDeviceProfile().isQsbInline) {
            addView(mQsb, mIsRtl ? getChildCount() : 0);
@@ -1002,6 +1016,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
    /**
     * Returns the all apps button in the taskbar.
     */
    @Nullable
    public TaskbarAllAppsButtonContainer getAllAppsButtonContainer() {
        return mAllAppsButtonContainer;
    }
+5 −0
Original line number Diff line number Diff line
@@ -369,6 +369,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
        return mTaskbarView.getIconViews();
    }

    @Nullable
    public View getAllAppsButtonView() {
        return mTaskbarView.getAllAppsButtonContainer();
    }
@@ -434,6 +435,10 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
    }

    private void updateTaskbarIconTranslationXForPinning() {
        if (mTaskbarView.getAllAppsButtonContainer() == null) {
            return;
        }

        View[] iconViews = mTaskbarView.getIconViews();
        float scale = mTaskbarIconTranslationXForPinning.value;
        float transientTaskbarAllAppsOffset = mActivity.getResources().getDimension(
+4 −0
Original line number Diff line number Diff line
@@ -150,6 +150,10 @@ public final class FeatureFlags {
        return ENABLE_TASKBAR_PINNING.get() || Flags.enableTaskbarPinning();
    }

    public static boolean enableAllAppsButtonInTaskbar() {
        return false;
    }

    // Aconfig migration complete for ENABLE_APP_PAIRS.
    public static final BooleanFlag ENABLE_APP_PAIRS = getDebugFlag(274189428,
            "ENABLE_APP_PAIRS", DISABLED,