mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-17 17:48:20 +00:00
Merge "Skip depth and scrim if freeform tasks are visible" into tm-qpr-dev
This commit is contained in:
@@ -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> {
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user