<?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/main_navigation"
    app:startDestination="@+id/splashFragment"
    tools:ignore="UnusedNavigation">

    <fragment
        android:id="@+id/splashFragment"
        android:name="com.bearya.kids.splash.SplashFragment"
        tools:layout="@layout/fragment_splash">

        <action
            android:id="@+id/action_splashFragment_to_gradeFragment"
            app:destination="@+id/gradeFragment"
            app:launchSingleTop="true"
            app:popUpTo="@id/splashFragment"
            app:popUpToInclusive="true" />

    </fragment>

    <fragment
        android:id="@+id/gradeFragment"
        android:name="com.bearya.kids.grade.GradeFragment"
        tools:layout="@layout/fragment_grade">

        <action
            android:id="@+id/action_gradeFragment_to_chapterFragment"
            app:destination="@+id/chapterFragment"
            app:launchSingleTop="true" />

    </fragment>

    <fragment
        android:id="@+id/chapterFragment"
        android:name="com.bearya.kids.chapter.ChapterFragment"
        tools:layout="@layout/fragment_chapter">

        <argument
            android:name="grade"
            android:defaultValue="1"
            app:argType="integer"
            app:nullable="false" />

        <action
            android:id="@+id/action_chapterFragment_to_sectionFragment"
            app:destination="@+id/sectionFragment"
            app:launchSingleTop="true" />

    </fragment>

    <fragment
        android:id="@+id/sectionFragment"
        android:name="com.bearya.kids.section.SectionFragment"
        tools:layout="@layout/fragment_section">
        <argument
            android:name="chapterId"
            android:defaultValue="1"
            app:argType="integer"
            app:nullable="false" />

        <argument
            android:name="chapterName"
            android:defaultValue="none"
            app:argType="string"
            app:nullable="true" />

        <action
            android:id="@+id/action_sectionFragment_to_analysisFragment"
            app:destination="@+id/analysisFragment"
            app:launchSingleTop="true" />

    </fragment>

    <fragment
        android:id="@+id/analysisFragment"
        android:name="com.bearya.kids.analysis.AnalysisFragment"
        tools:layout="@layout/fragment_analysis">

        <argument
            android:name="sectionId"
            android:defaultValue="0"
            app:argType="integer"
            app:nullable="false" />

        <argument
            android:name="chapterName"
            android:defaultValue="none"
            app:argType="string"
            app:nullable="true" />

    </fragment>

</navigation>