From 8b50c8f60963f8ebc63c31a0078e964901ccbc8b Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 27 Sep 2024 14:26:02 +0100 Subject: [PATCH] Don't hide DesktopTaskView in split select - Setting DesktopTaskView to GONE completely breaks Overview layout. Instead keep them in split select but do nothing when being clicked - With large desktop tile feature we'll properly hide DesktopTaskView Bug: 330342294 Test: without large desktop tile, enter split select, layout isn't broken; clicking desktop task doesn nothing Flag: EXEMPT BUG_FIX Change-Id: I164ed75e8531e08b6d982e3bda418ae19fa272e9 --- .../fallback/FallbackRecentsView.java | 2 +- .../quickstep/views/DesktopTaskView.kt | 34 ++++++++++--------- .../quickstep/views/LauncherRecentsView.java | 2 +- .../android/quickstep/views/RecentsView.java | 23 ++----------- 4 files changed, 23 insertions(+), 38 deletions(-) diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index 7f880907c3..5a4c769af2 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -323,7 +323,7 @@ public class FallbackRecentsView, orientedState: RecentsOrientedState, - taskOverlayFactory: TaskOverlayFactory + taskOverlayFactory: TaskOverlayFactory, ) { if (DEBUG) { val sb = StringBuilder() @@ -126,7 +126,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu snapshotView, // Add snapshotView to the front after initial views e.g. icon and // background. - childCountAtInflation + childCountAtInflation, ) TaskContainer( this, @@ -137,7 +137,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu SplitConfigurationOptions.STAGE_POSITION_UNDEFINED, digitalWellBeingToast = null, showWindowsView = null, - taskOverlayFactory + taskOverlayFactory, ) } taskContainers.forEach { it.bind() } @@ -159,12 +159,12 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu override fun updateTaskSize( lastComputedTaskSize: Rect, lastComputedGridTaskSize: Rect, - lastComputedCarouselTaskSize: Rect + lastComputedCarouselTaskSize: Rect, ) { super.updateTaskSize( lastComputedTaskSize, lastComputedGridTaskSize, - lastComputedCarouselTaskSize + lastComputedCarouselTaskSize, ) if (taskContainers.isEmpty()) { return @@ -186,7 +186,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu Log.d( TAG, "onMeasure: container=[$containerWidth,$containerHeight]" + - "window=[$windowWidth,$windowHeight] scale=[$scaleWidth,$scaleHeight]" + "window=[$windowWidth,$windowHeight] scale=[$scaleWidth,$scaleHeight]", ) } @@ -218,7 +218,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu Log.d( TAG, "onMeasure: task=${it.task.key} size=[$width,$height]" + - " margin=[$leftMargin,$topMargin]" + " margin=[$leftMargin,$topMargin]", ) } } @@ -252,7 +252,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu TestLogging.recordEvent( TestProtocol.SEQUENCE_MAIN, "launchDesktopFromRecents", - taskIds.contentToString() + taskIds.contentToString(), ) val endCallback = RunnableList() val desktopController = recentsView.desktopRecentsController @@ -262,7 +262,7 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu } Log.d( TAG, - "launchTaskWithDesktopController: ${taskIds.contentToString()}, withRemoteTransition: $animated" + "launchTaskWithDesktopController: ${taskIds.contentToString()}, withRemoteTransition: $animated", ) // Callbacks get run from recentsView for case when recents animation already running @@ -274,11 +274,13 @@ class DesktopTaskView @JvmOverloads constructor(context: Context, attrs: Attribu override fun launchWithoutAnimation( isQuickSwitch: Boolean, - callback: (launched: Boolean) -> Unit + callback: (launched: Boolean) -> Unit, ) = launchTaskWithDesktopController(animated = false)?.add { callback(true) } ?: callback(false) - // Desktop tile can't be in split screen - override fun confirmSecondSplitSelectApp(): Boolean = false + // Return true when Task cannot be launched as fullscreen (i.e. in split select state) to skip + // putting DesktopTaskView to split as it's not supported. + override fun confirmSecondSplitSelectApp(): Boolean = + recentsView?.canLaunchFullscreenTask() != true // TODO(b/330685808) support overlay for Screenshot action override fun setOverlayEnabled(overlayEnabled: Boolean) {} diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java index 8f20cd3857..00e57c2971 100644 --- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java +++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java @@ -250,7 +250,7 @@ public class LauncherRecentsView extends RecentsView