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

Commit f26e90aa authored by Tony Wickham's avatar Tony Wickham
Browse files

Add empty Taskbar views and initial TaskbarController

Guarded by a FeatureFlag.

Bug: 171917176
Change-Id: I7145c7ae68282bf53552502798fe758c8c0e285d
parent 867b62a2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
    <uses-permission android:name="${packageName}.permission.HOTSEAT_EDU" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

    <application android:backupAgent="com.android.launcher3.LauncherBackupAgent"
         android:fullBackupOnly="true"
+29 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<com.android.launcher3.taskbar.TaskbarContainerView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/taskbar_container"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <com.android.launcher3.taskbar.TaskbarView
        android:id="@+id/taskbar_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@color/taskbar_background"/>

</com.android.launcher3.taskbar.TaskbarContainerView>
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -24,4 +24,7 @@
    <color name="all_apps_label_text_dark">#61FFFFFF</color>
    <color name="all_apps_prediction_row_separator">#3c000000</color>
    <color name="all_apps_prediction_row_separator_dark">#3cffffff</color>

    <!-- Taskbar -->
    <color name="taskbar_background">#101010</color>
</resources>
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -119,4 +119,7 @@

    <!-- Minimum distance to swipe to trigger accessibility gesture -->
    <dimen name="accessibility_gesture_min_swipe_distance">80dp</dimen>

    <!-- Taskbar -->
    <dimen name="taskbar_size">48dp</dimen>
</resources>
+37 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
import static com.android.launcher3.AbstractFloatingView.TYPE_HIDE_BACK_BUTTON;
import static com.android.launcher3.LauncherState.FLAG_HIDE_BACK_BUTTON;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.util.DisplayController.DisplayHolder.CHANGE_SIZE;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;

@@ -29,8 +30,11 @@ import android.content.Intent;
import android.content.IntentSender;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.view.LayoutInflater;
import android.view.View;

import androidx.annotation.Nullable;

import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.WellbeingModel;
import com.android.launcher3.popup.SystemShortcut;
@@ -39,7 +43,10 @@ import com.android.launcher3.proxy.StartActivityParams;
import com.android.launcher3.statehandlers.BackButtonAlphaHandler;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statemanager.StateManager.StateHandler;
import com.android.launcher3.taskbar.TaskbarContainerView;
import com.android.launcher3.taskbar.TaskbarController;
import com.android.launcher3.uioverrides.RecentsViewStateController;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.UiThreadHelper;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.SysUINavigationMode;
@@ -53,7 +60,6 @@ import com.android.quickstep.views.OverviewActionsView;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.ActivityOptionsCompat;
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;

import java.util.stream.Stream;
@@ -75,6 +81,8 @@ public abstract class BaseQuickstepLauncher extends Launcher

    private OverviewActionsView mActionsView;

    private @Nullable TaskbarController mTaskbarController;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
@@ -86,6 +94,11 @@ public abstract class BaseQuickstepLauncher extends Launcher
    @Override
    public void onDestroy() {
        SysUINavigationMode.INSTANCE.get(this).removeModeChangeListener(this);

        if (mTaskbarController != null) {
            mTaskbarController.cleanup();
        }

        super.onDestroy();
    }

@@ -190,6 +203,29 @@ public abstract class BaseQuickstepLauncher extends Launcher
        mActionsView = findViewById(R.id.overview_actions_view);
        ((RecentsView) getOverviewPanel()).init(mActionsView);
        mActionsView.updateVerticalMargin(SysUINavigationMode.getMode(this));

        addTaskbarIfNecessary();
    }

    @Override
    public void onDisplayInfoChanged(DisplayController.Info info, int flags) {
        super.onDisplayInfoChanged(info, flags);
        if ((flags & CHANGE_SIZE) != 0) {
            addTaskbarIfNecessary();
        }
    }

    private void addTaskbarIfNecessary() {
        if (mTaskbarController != null) {
            mTaskbarController.cleanup();
            mTaskbarController = null;
        }
        if (FeatureFlags.ENABLE_TASKBAR.get() && mDeviceProfile.isTablet) {
            TaskbarContainerView taskbarContainer = (TaskbarContainerView) LayoutInflater.from(this)
                    .inflate(R.layout.taskbar, null, false);
            mTaskbarController = new TaskbarController(this, taskbarContainer);
            mTaskbarController.init();
        }
    }

    public <T extends OverviewActionsView> T getActionsView() {
Loading