I have my MainActivity setup which looks like this :
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.host.HostActivity">
<fragment
android:id="@+id/mainNavigationFragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/nav_graph" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavigationView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/windowBackground"
app:labelVisibilityMode="labeled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:menu="@menu/main_nav_menu" />
</androidx.constraintlayout.widget.ConstraintLayout>
And the bottom navigation has 3 tabs which can only be shown after some initial authentication and setup user calls have been performed.
What is the best way to show a Loading/Setting up user screen before I let user start using the bottom nav view.
One way I am thinking is to delay the setup of NaHostFragment in my Activity until all the setup is done.
So basically toggle the visibility of mainNavigationFragment
and BottomNavigationView
till the setup is completed.
Are there any other ideas ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…