Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bottomBar 노출 조건 수정 #25

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/src/main/java/com/keyme/app/ui/KeymeApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.keyme.presentation.keymetest.keymeTestGraph
import com.keyme.presentation.myprofile.ui.KeymeQuestionResultDestination
import com.keyme.presentation.myprofile.ui.keymeQuestionResultGraph
import com.keyme.presentation.myprofile.ui.myProfileGraph
import com.keyme.presentation.onboarding.OnboardingDestination
import com.keyme.presentation.onboarding.onboardingGraph

@Composable
Expand All @@ -33,7 +34,7 @@ fun KeymeApp() {
KeymeTheme {
Scaffold(
bottomBar = {
if (appState.isSignIn) {
if (appState.currentDestination.isOnBoarding().not()) {
KeymeBottomBar(
currentDestination = appState.currentDestination,
onNavigateToDestination = appState::navigate,
Expand Down Expand Up @@ -78,6 +79,10 @@ fun KeymeApp() {
}
}

private fun NavDestination?.isOnBoarding(): Boolean {
return this?.hierarchy?.any { it.route == OnboardingDestination.route } == true
}

@Composable
fun KeymeBottomBar(
currentDestination: NavDestination?,
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/keyme/app/ui/KeymeAppState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ class KeymeAppState(

val startDestination = OnboardingDestination

var isSignIn by mutableStateOf(false)
var isOnBoarding by mutableStateOf(false)

init {
coroutineScope.launch {
onboardingViewModel.localOnboardingState.collectLatest {
isSignIn = it == OnboardingStepsEnum.MY_DAILY.ordinal
isOnBoarding = it == OnboardingStepsEnum.MY_DAILY.ordinal
}
}
}
Expand Down