@OptIn(ExperimentalComposeUiApi::class) @Composable private fun RecentTabMenu( showMenu: Boolean, menuItems: List<RecentTabMenuItem>, tab: RecentTab.Tab, onDismissRequest: () -> Unit, ) { DisposableEffect(LocalConfiguration.current.orientation) { onDispose { onDismissRequest() } } DropdownMenu( expanded = showMenu, onDismissRequest = { onDismissRequest() }, modifier = Modifier .background(color = FirefoxTheme.colors.layer2) .semantics { testTagsAsResourceId = true testTag = "recent.tab.menu" }, ) { for (item in menuItems) { DropdownMenuItem( onClick = { onDismissRequest() item.onClick(tab) }, ) { Text( text = item.title, color = FirefoxTheme.colors.textPrimary, maxLines = 1, modifier = Modifier .fillMaxHeight() .align(Alignment.CenterVertically), ) } } } }
Menu shown for a [RecentTab.Tab].