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

Commit fcb9cb76 authored by Merissa Tan's avatar Merissa Tan
Browse files

Move AllAppsButton placement for desktop environment.

On desktop environment, we want the AllAppsButton to be on the left side
of the taskbar instead of the hotseat, but retain the functionality of
the button.

Bug: 251372204
Test: Manual
Change-Id: Ia2c95a20583cb98785ab6f8c719559d93982c06f
parent 381ba331
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.launcher3.taskbar;
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_NOTIFICATIONS;
import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_QUICK_SETTINGS;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

@@ -31,6 +33,8 @@ public class DesktopNavbarButtonsViewController extends NavbarButtonsViewControl
    private final TaskbarActivityContext mContext;
    private final FrameLayout mNavButtonsView;
    private final ViewGroup mNavButtonContainer;
    private final ViewGroup mStartContextualContainer;
    private final View mAllAppsButton;

    private TaskbarControllers mControllers;

@@ -40,6 +44,12 @@ public class DesktopNavbarButtonsViewController extends NavbarButtonsViewControl
        mContext = context;
        mNavButtonsView = navButtonsView;
        mNavButtonContainer = mNavButtonsView.findViewById(R.id.end_nav_buttons);
        mStartContextualContainer = mNavButtonsView.findViewById(R.id.start_contextual_buttons);
        mAllAppsButton = LayoutInflater.from(context)
                .inflate(R.layout.taskbar_all_apps_button, mStartContextualContainer, false);
        mAllAppsButton.setOnClickListener((View v) -> {
            mControllers.taskbarAllAppsController.show();
        });
    }

    /**
@@ -57,6 +67,8 @@ public class DesktopNavbarButtonsViewController extends NavbarButtonsViewControl
        addButton(R.drawable.ic_sysbar_notifications, BUTTON_NOTIFICATIONS,
                mNavButtonContainer, mControllers.navButtonController,
                R.id.notifications_button);
        // All apps button
        mStartContextualContainer.addView(mAllAppsButton);
    }

    /** Cleans up on destroy */
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.launcher3.taskbar;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Rect;
@@ -126,6 +127,9 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
            mAllAppsButton = LayoutInflater.from(context)
                    .inflate(R.layout.taskbar_all_apps_button, this, false);
            mAllAppsButton.setPadding(mItemPadding, mItemPadding, mItemPadding, mItemPadding);
            if (mActivityContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_PC)) {
                mAllAppsButton.setVisibility(GONE);
            }
        }

        // TODO: Disable touch events on QSB otherwise it can crash.