Android 如何使用底部导航视图进行条件导航

Android 如何使用底部导航视图进行条件导航,android,kotlin,bottomnavigationview,Android,Kotlin,Bottomnavigationview,我使用FirebaseUI在我的应用程序中创建了登录流。 目前我的流量如下-> main片段: login_button.setOnClickListener { launchLoginFlow() } //launch the flow through button view observeAuthState() //observe whether the user is authenticate or not MainViewModel:在mainFragment中激活ob

我使用
FirebaseUI
在我的应用程序中创建了登录流。 目前我的流量如下->

main片段

    login_button.setOnClickListener { launchLoginFlow() } //launch the flow through button view
    observeAuthState() //observe whether the user is authenticate or not
MainViewModel
:在
mainFragment
中激活
observeAuthState

val authenticationState = FirebaseUserLiveData().map { user ->
    if (user != null) {
        AuthState.AUTHENTICATED
    } else {
        AuthState.UNAUTHENTICATED
    } }
我的问题是,如果用户未登录,如何防止用户从
main片段导航到其他片段

使用直接导航非常简单,在导航之前,我只需检查他是否登录

但如何使用底部导航视图检查此问题