From 39cd2bd12f161efe0f7ead5a76246732ca491d68 Mon Sep 17 00:00:00 2001 From: Joyeeta Date: Thu, 7 Nov 2024 17:38:11 +0530 Subject: [PATCH 1/3] bottom drawer IME fixes --- .../java/com/microsoft/fluentui/compose/ModalPopup.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt b/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt index 043664e9..0dd1ab91 100644 --- a/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt +++ b/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt @@ -2,6 +2,7 @@ package com.microsoft.fluentui.compose import android.content.Context import android.graphics.PixelFormat +import android.os.Build import android.view.Gravity import android.view.KeyEvent import android.view.View @@ -104,6 +105,7 @@ fun ModalPopup( } } } + @Composable fun convertWindowInsetsCompatTypeToWindowInsets(windowInsetsCompatType: Int): WindowInsets { return when (windowInsetsCompatType) { @@ -132,6 +134,7 @@ private class ModalWindow( val canCalculatePosition by derivedStateOf { popupContentSize != null } + init { id = android.R.id.content // Set up view owners @@ -155,7 +158,10 @@ private class ModalWindow( type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL // Fill up the entire app view width = WindowManager.LayoutParams.MATCH_PARENT - height = WindowManager.LayoutParams.MATCH_PARENT + height = if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) + WindowManager.LayoutParams.WRAP_CONTENT + else + WindowManager.LayoutParams.MATCH_PARENT // Format of screen pixels format = PixelFormat.TRANSLUCENT From 7f249a232b3236135bb700be20771d9afce03659 Mon Sep 17 00:00:00 2001 From: Joyeeta Date: Fri, 8 Nov 2024 09:45:35 +0530 Subject: [PATCH 2/3] fix app bar not getting covered with scrim --- .../main/java/com/microsoft/fluentui/compose/ModalPopup.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt b/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt index 0dd1ab91..f4555417 100644 --- a/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt +++ b/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt @@ -16,7 +16,6 @@ import androidx.compose.foundation.layout.ime import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.mandatorySystemGestures import androidx.compose.foundation.layout.navigationBars -import androidx.compose.foundation.layout.safeContent import androidx.compose.foundation.layout.statusBars import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.tappableElement @@ -179,7 +178,9 @@ private class ModalWindow( WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM ).inv() - flags = flags or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS + flags = if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) { + flags + } else flags or WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS } private var content: @Composable () -> Unit by mutableStateOf({}) From 3b08c4fc6a1c2e86971da5acb1107fc30a584adf Mon Sep 17 00:00:00 2001 From: Joyeeta Date: Fri, 8 Nov 2024 13:37:55 +0530 Subject: [PATCH 3/3] add comment --- .../src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt b/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt index f4555417..55a6eb61 100644 --- a/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt +++ b/fluentui_core/src/main/java/com/microsoft/fluentui/compose/ModalPopup.kt @@ -157,6 +157,7 @@ private class ModalWindow( type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL // Fill up the entire app view width = WindowManager.LayoutParams.MATCH_PARENT + // for build versions less than or equal to S_V2, set the height to wrap content height = if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) WindowManager.LayoutParams.WRAP_CONTENT else