https://kotlinlang.org logo
#compose
Title
# compose
k

Kev Thompson

10/03/2023, 1:30 PM
Hi all, Im asking here to save time and maybe avoid an RnD spike. Is there a way to create an overlay that overlays all sub screens/activities, we have a custom burger menu created in Compose and we are being asked to now show this over ALL activities including ones we include from AAR’s that are totally black box to us.
h

Hrodrick

10/03/2023, 1:43 PM
I’m not sure if there is a built-in solution that automatically applies to every activity. But if you use Compose, you just need to add your Overlay in your root Composable, after you call your composables. And make sure the container is either a Box (if you want this to be a real overlay) or a Column (if you want this to act like a Header). This can be extended to other use cases like nested scrolling to hide the header and so on, but I think you get the idea Like this :
// activity
OnCreate() {
setContent {
Box {
AppContent { … }
Overlay { … }
}
}
}
👀 1
👍 1
I think there should be a way to inject a view to an activity from a library 🤔, taking full size, not clickable, and rendering Compose in it. But no idea honestly 😅
k

Kev Thompson

10/03/2023, 3:40 PM
Thanks, the black box aar is actually a cordova application we embed within our own so we can at least mess around with the cordova activity if needed.