Fixed white screen blink when opening a new tab

This commit is contained in:
Abdelilah El Aissaoui 2022-05-23 19:14:21 +02:00
parent e283676ef4
commit 46cb205739

View File

@ -234,13 +234,16 @@ class App {
@Composable @Composable
private fun TabsContent(tabs: List<TabInformation>, selectedTabKey: Int) { private fun TabsContent(tabs: List<TabInformation>, selectedTabKey: Int) {
val selectedTab = tabs.firstOrNull { it.key == selectedTabKey } ?: return val selectedTab = tabs.firstOrNull { it.key == selectedTabKey }
Box( Box(
modifier = Modifier modifier = Modifier
.background(MaterialTheme.colors.background)
.fillMaxSize(), .fillMaxSize(),
) { ) {
AppTab(selectedTab.tabViewModel) if (selectedTab != null) {
AppTab(selectedTab.tabViewModel)
}
} }
} }