<?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/nav_graph"
    app:startDestination="@id/loginFragment">

    <!-- 登录Fragment -->
    <fragment
        android:id="@+id/loginFragment"
        android:name="com.narutohuo.xindazhou.user.ui.login.LoginFragment"
        android:label="登录">
        <action
            android:id="@+id/action_loginFragment_to_registerFragment"
            app:destination="@id/registerFragment" />
        <action
            android:id="@+id/action_loginFragment_to_mainFragment"
            app:destination="@id/mainFragment"
            app:popUpTo="@id/loginFragment"
            app:popUpToInclusive="true" />
    </fragment>

    <!-- 注册Fragment -->
    <fragment
        android:id="@+id/registerFragment"
        android:name="com.narutohuo.xindazhou.user.ui.register.RegisterFragment"
        android:label="注册">
        <action
            android:id="@+id/action_registerFragment_to_mainFragment"
            app:destination="@id/mainFragment"
            app:popUpTo="@id/loginFragment"
            app:popUpToInclusive="true" />
    </fragment>

    <!-- 主界面Fragment -->
    <fragment
        android:id="@+id/mainFragment"
        android:name="com.narutohuo.xindazhou.common.main.ui.MainFragment"
        android:label="主界面"
        tools:layout="@layout/fragment_main" />

</navigation>

