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

Commit 1c28f290 authored by Ats Jenk's avatar Ats Jenk Committed by Android (Google) Code Review
Browse files

Merge "Skip depth and scrim if freeform tasks are visible" into tm-qpr-dev

parents 984a37d1 ca009e4e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1031,6 +1031,14 @@ public class QuickstepLauncher extends Launcher {
        mPendingSplitSelectInfo = null;
    }

    @Override
    public boolean areFreeformTasksVisible() {
        if (mDesktopVisibilityController != null) {
            return mDesktopVisibilityController.areFreeformTasksVisible();
        }
        return false;
    }

    private static final class LauncherTaskViewController extends
            TaskViewTouchController<Launcher> {

+7 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import com.android.launcher3.R;
import com.android.launcher3.allapps.AllAppsTransitionController;
import com.android.launcher3.config.FeatureFlags;
import com.android.quickstep.util.LayoutUtils;
import com.android.quickstep.views.DesktopTaskView;
import com.android.quickstep.views.RecentsView;

/**
@@ -91,6 +92,12 @@ public class BackgroundAppState extends OverviewState {

    @Override
    protected float getDepthUnchecked(Context context) {
        if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
            if (Launcher.getLauncher(context).areFreeformTasksVisible()) {
                // Don't blur the background while freeform tasks are visible
                return 0;
            }
        }
        return 1;
    }

+9 −0
Original line number Diff line number Diff line
@@ -17,10 +17,13 @@ package com.android.launcher3.uioverrides.states;

import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;

import android.graphics.Color;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.util.Themes;
import com.android.quickstep.views.DesktopTaskView;

/**
 * State to indicate we are about to launch a recent task. Note that this state is only used when
@@ -43,6 +46,12 @@ public class QuickSwitchState extends BackgroundAppState {

    @Override
    public int getWorkspaceScrimColor(Launcher launcher) {
        if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) {
            if (launcher.areFreeformTasksVisible()) {
                // No scrim while freeform tasks are visible
                return Color.TRANSPARENT;
            }
        }
        DeviceProfile dp = launcher.getDeviceProfile();
        if (dp.isTaskbarPresentInApps) {
            return launcher.getColor(R.color.taskbar_background);
+8 −0
Original line number Diff line number Diff line
@@ -3326,4 +3326,12 @@ public class Launcher extends StatefulActivity<LauncherState>
            return false; // Return false to continue iterating through all the items.
        });
    }

    /**
     * Returns {@code true} if there are visible tasks with windowing mode set to
     * {@link android.app.WindowConfiguration#WINDOWING_MODE_FREEFORM}
     */
    public boolean areFreeformTasksVisible() {
        return false; // Base launcher does not track freeform tasks
    }
}