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

    <fragment
        android:id="@+id/changePhoneNumberFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberFragment"
        tools:layout="@layout/fragment_change_phone_number">

        <action
            android:id="@+id/action_changePhoneNumberFragment_to_enterPhoneNumberChangeFragment"
            app:destination="@id/enterPhoneNumberChangeFragment"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit" />
    </fragment>

    <fragment
        android:id="@+id/enterPhoneNumberChangeFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberEnterPhoneNumberFragment"
        tools:layout="@layout/fragment_change_number_enter_phone_number">

        <action
            android:id="@+id/action_enterPhoneNumberChangeFragment_to_changePhoneNumberConfirmFragment"
            app:destination="@id/changePhoneNumberConfirmFragment"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit" />

        <action
            android:id="@+id/action_enterPhoneNumberChangeFragment_to_countryPickerFragment"
            app:destination="@id/countryPickerFragment"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit" />
    </fragment>

    <fragment
        android:id="@+id/changePhoneNumberConfirmFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberConfirmFragment"
        tools:layout="@layout/fragment_change_number_confirm">

        <action
            android:id="@+id/action_changePhoneNumberConfirmFragment_to_changePhoneNumberVerifyFragment"
            app:destination="@id/changePhoneNumberVerifyFragment"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit"
            app:popUpTo="@+id/enterPhoneNumberChangeFragment" />
    </fragment>

    <fragment
        android:id="@+id/countryPickerFragment"
        android:name="org.thoughtcrime.securesms.registration.fragments.CountryPickerFragment"
        tools:layout="@layout/fragment_registration_country_picker">

        <argument
            android:name="result_key"
            android:defaultValue="@null"
            app:argType="string"
            app:nullable="true" />
    </fragment>

    <fragment
        android:id="@+id/changePhoneNumberVerifyFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberVerifyFragment"
        tools:layout="@layout/fragment_change_phone_number_verify">

        <action
            android:id="@+id/action_changePhoneNumberVerifyFragment_to_captchaFragment"
            app:destination="@id/captchaFragment"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit" />

        <action
            android:id="@+id/action_changePhoneNumberVerifyFragment_to_changeNumberEnterCodeFragment"
            app:destination="@id/changeNumberEnterCodeFragment"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit"
            app:popUpTo="@+id/enterPhoneNumberChangeFragment" />
    </fragment>

    <fragment
        android:id="@+id/captchaFragment"
        android:name="org.thoughtcrime.securesms.registration.fragments.CaptchaFragment"
        tools:layout="@layout/fragment_registration_captcha" />

    <fragment
        android:id="@+id/changeNumberEnterCodeFragment"
        android:name="org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberEnterSmsCodeFragment"
        tools:layout="@layout/fragment_change_number_enter_code">

        <action
            android:id="@+id/action_changeNumberEnterCodeFragment_to_captchaFragment"
            app:destination="@id/captchaFragment"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit" />

        <action
            android:id="@+id/action_changeNumberEnterCodeFragment_to_changeNumberRegistrationLock"
            app:destination="@id/changeNumberRegistrationLock"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit"
            app:popUpTo="@id/enterPhoneNumberChangeFragment" />

        <action
            android:id="@+id/action_changeNumberEnterCodeFragment_to_changeNumberAccountLocked"
            app:destination="@id/changeNumberAccountLocked"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit"
            app:popUpTo="@id/enterPhoneNumberChangeFragment" />

    </fragment>

    <fragment
        android:id="@+id/changeNumberRegistrationLock"
        android:name="org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberRegistrationLockFragment"
        tools:layout="@layout/fragment_change_number_registration_lock">

        <argument
            android:name="timeRemaining"
            app:argType="long" />

        <action
            android:id="@+id/action_changeNumberRegistrationLock_to_changeNumberAccountLocked"
            app:destination="@id/changeNumberAccountLocked"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit"
            app:popUpTo="@id/enterPhoneNumberChangeFragment" />

        <action
            android:id="@+id/action_changeNumberRegistrationLock_to_changeNumberPinDiffers"
            app:destination="@id/changeNumberPinDiffers"
            app:enterAnim="@anim/fragment_open_enter"
            app:exitAnim="@anim/fragment_open_exit"
            app:popEnterAnim="@anim/fragment_close_enter"
            app:popExitAnim="@anim/fragment_close_exit"
            app:popUpTo="@id/enterPhoneNumberChangeFragment" />

    </fragment>

    <fragment
        android:id="@+id/changeNumberAccountLocked"
        android:name="org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberAccountLockedFragment"
        tools:layout="@layout/fragment_change_number_account_locked" />

    <fragment
        android:id="@+id/changeNumberPinDiffers"
        android:name="org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberPinDiffersFragment"
        tools:layout="@layout/fragment_change_number_pin_differs" />

    <action
        android:id="@+id/action_pop_app_settings_change_number"
        app:enterAnim="@anim/fragment_open_enter"
        app:exitAnim="@anim/fragment_open_exit"
        app:popEnterAnim="@anim/fragment_close_enter"
        app:popExitAnim="@anim/fragment_close_exit"
        app:popUpTo="@id/changePhoneNumberFragment"
        app:popUpToInclusive="true" />

</navigation>