Skip to content

Commit

Permalink
Merge pull request #11 from yveskalume/update_navigation
Browse files Browse the repository at this point in the history
Update navigation
  • Loading branch information
yveskalume authored Nov 15, 2023
2 parents 49ea5e3 + eba3158 commit 9fd8e7f
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package com.yveskalume.eventcademy.core.ui
import android.content.res.Configuration
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.slideInVertically
import androidx.compose.animation.slideOutVertically
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -57,7 +60,11 @@ fun ComponentActivity.installUi(webClientIdToken: String) {
Scaffold(
modifier = Modifier.fillMaxSize(),
bottomBar = {
if (shouldShowBottomNavigation(destination)) {
AnimatedVisibility(
visible = shouldShowBottomNavigation(destination),
enter = slideInVertically { it / 2 },
exit = slideOutVertically { it / 2},
) {
BottomNavigationBar(
navController = navController,
destination = destination
Expand Down Expand Up @@ -85,7 +92,7 @@ fun ComponentActivity.installUi(webClientIdToken: String) {
}

private fun shouldShowBottomNavigation(destination: NavDestination?): Boolean {
return !destination.isCurrent(Destination.AuthScreen) && !destination.isCurrent(
Destination.EventDetailScreen
)
return !destination.isCurrent(Destination.AuthScreen)
&& !destination.isCurrent(Destination.EventDetailScreen)
&& !destination.isCurrent(Destination.SettingsScreen)
}

0 comments on commit 9fd8e7f

Please sign in to comment.