diff --git a/code/core/src/phone/java/com/adobe/marketing/mobile/services/ui/message/views/Message.kt b/code/core/src/phone/java/com/adobe/marketing/mobile/services/ui/message/views/Message.kt index 5d15352f0..1063a25aa 100644 --- a/code/core/src/phone/java/com/adobe/marketing/mobile/services/ui/message/views/Message.kt +++ b/code/core/src/phone/java/com/adobe/marketing/mobile/services/ui/message/views/Message.kt @@ -11,6 +11,7 @@ package com.adobe.marketing.mobile.services.ui.message.views +import android.app.Activity import android.content.pm.PackageManager.NameNotFoundException import android.os.Build import android.view.ViewGroup @@ -25,6 +26,7 @@ import androidx.compose.ui.platform.LocalView import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogWindowProvider +import androidx.core.view.WindowCompat import com.adobe.marketing.mobile.services.ui.Presentable import com.adobe.marketing.mobile.services.ui.common.PresentationStateManager import com.adobe.marketing.mobile.services.ui.message.GestureTracker @@ -149,6 +151,15 @@ internal fun Message( it.attributes.fitInsetsTypes = 0 it.attributes.fitInsetsSides = 0 } + + // Inherit the host app's system bar appearance so the dialog's + // status/navigation bar icons match the app's theme + (context as? Activity)?.window?.let { activityWindow -> + val activityController = WindowCompat.getInsetsController(activityWindow, activityWindow.decorView) + val dialogController = WindowCompat.getInsetsController(it, it.decorView) + dialogController.isAppearanceLightStatusBars = activityController.isAppearanceLightStatusBars + dialogController.isAppearanceLightNavigationBars = activityController.isAppearanceLightNavigationBars + } } // Backdrop for the InAppMessage only takes into effect if the InAppMessage is taking over the UI diff --git a/code/core/src/phone/java/com/adobe/marketing/mobile/services/ui/message/views/MessageContent.kt b/code/core/src/phone/java/com/adobe/marketing/mobile/services/ui/message/views/MessageContent.kt index c8e078f47..39bef6a71 100644 --- a/code/core/src/phone/java/com/adobe/marketing/mobile/services/ui/message/views/MessageContent.kt +++ b/code/core/src/phone/java/com/adobe/marketing/mobile/services/ui/message/views/MessageContent.kt @@ -13,6 +13,9 @@ package com.adobe.marketing.mobile.services.ui.message.views import android.view.ViewGroup import android.webkit.WebView +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.systemBars +import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -75,6 +78,7 @@ internal fun MessageContent( } }, modifier = modifier + .windowInsetsPadding(WindowInsets.systemBars) .clip(RoundedCornerShape(inAppMessageSettings.cornerRadius.dp)) .testTag(MessageTestTags.MESSAGE_CONTENT) )