I have Tab Layout with multiple fragments and I would like to display a Popup only when a specific screen is being displayed. I am using the Jetpack Compose Popup component. I followed the docs and currently the popup is always being displayed regardless the fragment is being displayed, but I want to show the Popup only when a specific screen is being displayed.
Popup code:
Box {
val popupWidth = 200.dp
val popupHeight = 50.dp
val cornerSize = 16.dp
Popup(alignment = Alignment.Center) {
// Draw a rectangle shape with rounded corners inside the popup
Box(
Modifier
.size(popupWidth, popupHeight)
.background(Color.White, RoundedCornerShape(cornerSize))
)
}
}