From fd170e25cb65afa9a5948ad98364987c001d608e Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 13 Jul 2022 10:33:12 -0700 Subject: [PATCH] Provide 0 insets to VoiceInteractionWindow in gesture nav Test: Invoke assistant on tablet on both geture nav and 3 button mode; In gesture nav mode: assistant shows at the very bottom of the screen, layered on top of the taskbar background (in z order) In 3 button mode: assistant shows right above the taskbar, which only shows the 3 buttons (no taskbar icons) while assistant is showing Fixes: 225200928 Change-Id: I2fbc05e696b58e8801e704092aa2741cb57c05c4 --- .../launcher3/taskbar/TaskbarInsetsController.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt index dc5c22d017..48fde8f26e 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarInsetsController.kt @@ -22,6 +22,7 @@ import android.view.InsetsState.ITYPE_BOTTOM_MANDATORY_GESTURES import android.view.InsetsState import android.view.WindowManager import android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD +import android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION import com.android.launcher3.AbstractFloatingView import com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_ALL_APPS import com.android.launcher3.DeviceProfile @@ -88,11 +89,17 @@ class TaskbarInsetsController(val context: TaskbarActivityContext): LoggableTask } } - var imeInsetsSize = Insets.of(0, 0, 0, taskbarHeightForIme) - var insetsSizeOverride = arrayOf( + val imeInsetsSize = Insets.of(0, 0, 0, taskbarHeightForIme) + // Use 0 insets for the VoiceInteractionWindow (assistant) when gesture nav is enabled. + val visInsetsSize = Insets.of(0, 0, 0, if (context.isGestureNav) 0 else tappableHeight) + val insetsSizeOverride = arrayOf( InsetsFrameProvider.InsetsSizeOverride( TYPE_INPUT_METHOD, imeInsetsSize + ), + InsetsFrameProvider.InsetsSizeOverride( + TYPE_VOICE_INTERACTION, + visInsetsSize ) ) for (provider in windowLayoutParams.providedInsets) { @@ -153,7 +160,8 @@ class TaskbarInsetsController(val context: TaskbarActivityContext): LoggableTask + " insetsSize=" + provider.insetsSize) if (provider.insetsSizeOverrides != null) { pw.print(" insetsSizeOverrides={") - for (overrideSize in provider.insetsSizeOverrides) { + for ((i, overrideSize) in provider.insetsSizeOverrides.withIndex()) { + if (i > 0) pw.print(", ") pw.print(overrideSize) } pw.print("})")