<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />
<fragment
android:id="@+id/nav_host_fragment_activity_main"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintBottom_toTopOf="@id/nav_view"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"
app:navGraph="@navigation/mobile_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<navigation 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:id="@+id/mobile_navigation"
app:startDestination="@+id/navigation_home">
<!-- 登录注册Fragment -->
<fragment
android:id="@+id/loginRegisterFragment"
android:name="com.di.appforbridge.LoginRegisterFragment"
android:label="Login"
tools:layout="@layout/fragment_login_register">
<action
android:id="@+id/action_login_to_home"
app:destination="@id/navigation_home"
app:popUpTo="@id/loginRegisterFragment"
app:popUpToInclusive="true" />
</fragment>
<fragment
android:id="@+id/navigation_home"
android:name="com.di.appforbridge.ui.home.HomeFragment"
android:label="@string/title_home"
tools:layout="@layout/fragment_home" />
<fragment
android:id="@+id/navigation_model_library"
android:name="com.di.appforbridge.ui.dashboard.DashboardFragment"
android:label="@string/title_model_library"
tools:layout="@layout/fragment_model_library" />
<fragment
android:id="@+id/navigation_simulation"
android:name="com.di.appforbridge.ui.notifications.NotificationsFragment"
android:label="@string/title_simulation"
tools:layout="@layout/fragment_simulation" />
<fragment
android:id="@+id/navigation_data_analysis"
android:name="com.di.appforbridge.ui.analysis.AnalysisFragment"
android:label="@string/title_data_analysis"
tools:layout="@layout/fragment_data_analysis" />
<fragment
android:id="@+id/navigation_profile"
android:name="com.di.appforbridge.ui.profile.ProfileFragment"
android:label="@string/title_profile"
tools:layout="@layout/fragment_profile" />
</navigation>
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/navigation_home"
android:icon="@drawable/ic_home_black_24dp"
android:title="@string/title_home" />
<item
android:id="@+id/navigation_model_library"
android:icon="@drawable/ic_dashboard_black_24dp"
android:title="@string/title_model_library" />
<item
android:id="@+id/navigation_simulation"
android:icon="@drawable/baseline_smart_toy_24"
android:title="@string/title_simulation" />
<item
android:id="@+id/navigation_data_analysis"
android:icon="@drawable/baseline_analytics_24"
android:title="@string/title_data_analysis" />
<item
android:id="@+id/navigation_profile"
android:icon="@drawable/baseline_person_24"
android:title="@string/title_profile" />
</menu>