Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -75,6 +78,7 @@ internal fun MessageContent(
}
},
modifier = modifier
.windowInsetsPadding(WindowInsets.systemBars)
.clip(RoundedCornerShape(inAppMessageSettings.cornerRadius.dp))
.testTag(MessageTestTags.MESSAGE_CONTENT)
)
Expand Down
Loading