From c9db21e88164844d5dec20a56cdca0454728d667 Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Sat, 5 Aug 2023 22:17:51 +0200 Subject: [PATCH] Enable BottomAppBar selected animation --- .../java/com/readrops/app/compose/home/HomeScreen.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/appcompose/src/main/java/com/readrops/app/compose/home/HomeScreen.kt b/appcompose/src/main/java/com/readrops/app/compose/home/HomeScreen.kt index a6600451..da741f9e 100644 --- a/appcompose/src/main/java/com/readrops/app/compose/home/HomeScreen.kt +++ b/appcompose/src/main/java/com/readrops/app/compose/home/HomeScreen.kt @@ -15,7 +15,6 @@ import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import cafe.adriel.voyager.androidx.AndroidScreen -import cafe.adriel.voyager.navigator.CurrentScreen import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow import cafe.adriel.voyager.navigator.tab.CurrentTab @@ -40,7 +39,7 @@ class HomeScreen : AndroidScreen() { bottomBar = { BottomAppBar { NavigationBarItem( - selected = false, + selected = tabNavigator.current.key == TimelineTab.key, onClick = { tabNavigator.current = TimelineTab }, icon = { Icon( @@ -52,7 +51,7 @@ class HomeScreen : AndroidScreen() { ) NavigationBarItem( - selected = false, + selected = tabNavigator.current.key == FeedTab.key, onClick = { tabNavigator.current = FeedTab }, icon = { Icon( @@ -64,7 +63,7 @@ class HomeScreen : AndroidScreen() { ) NavigationBarItem( - selected = false, + selected = tabNavigator.current.key == AccountTab.key, onClick = { tabNavigator.current = AccountTab }, icon = { Icon( @@ -76,7 +75,7 @@ class HomeScreen : AndroidScreen() { ) NavigationBarItem( - selected = false, + selected = tabNavigator.current.key == MoreTab.key, onClick = { tabNavigator.current = MoreTab }, icon = { Icon(