<?xml version="1.0" encoding="utf-8"?><!--
  ~ Kiwix Android
  ~ Copyright (c) 2020 Kiwix <android.kiwix.org>
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program. If not, see <http://www.gnu.org/licenses/>.
  ~
  -->

<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"
  app:startDestination="@id/readerFragment">
  <fragment
    android:id="@+id/readerFragment"
    android:name="org.kiwix.kiwixmobile.nav.destination.reader.KiwixReaderFragment"
    android:label="Reader"
    tools:layout="@layout/fragment_reader">
    <argument
      android:name="zimFileUri"
      android:defaultValue=""
      app:argType="string" />
    <argument
      android:name="findInPageSearchString"
      android:defaultValue=""
      app:argType="string" />
    <argument
      android:name="pageUrl"
      android:defaultValue=""
      app:argType="string" />
    <argument
      android:name="shouldOpenInNewTab"
      android:defaultValue="false"
      app:argType="boolean" />
    <argument
      android:name="searchItemTitle"
      android:defaultValue=""
      app:argType="string" />

    <action
      android:id="@+id/action_navigation_reader_to_navigation_library"
      app:destination="@id/libraryFragment" />
    <action
      android:id="@+id/action_readerFragment_to_searchFragment"
      app:destination="@id/searchFragment" />
    <action
      android:id="@+id/action_readerFragment_to_introFragment"
      app:destination="@id/introFragment"
      app:popUpTo="@id/readerFragment"
      app:popUpToInclusive="true" />
  </fragment>

  <fragment
    android:id="@+id/libraryFragment"
    android:name="org.kiwix.kiwixmobile.nav.destination.library.LocalLibraryFragment"
    android:label="Library"
    tools:layout="@layout/fragment_destination_library">
    <action
      android:id="@+id/action_navigation_library_to_navigation_reader"
      app:destination="@id/readerFragment"
      app:popUpTo="@id/readerFragment" />
    <action
      android:id="@+id/action_navigation_library_to_navigation_downloads"
      app:destination="@id/downloadsFragment" />
    <action
      android:id="@+id/action_libraryFragment_to_localFileTransferFragment"
      app:destination="@id/localFileTransferFragment" />
  </fragment>

  <fragment
    android:id="@+id/downloadsFragment"
    android:name="org.kiwix.kiwixmobile.nav.destination.library.OnlineLibraryFragment"
    android:label="Downloads"
    tools:layout="@layout/fragment_destination_download" />
  <fragment
    android:id="@+id/bookmarksFragment"
    android:name="org.kiwix.kiwixmobile.core.page.bookmark.BookmarksFragment"
    android:label="BookmarksFragment"
    tools:layout="@layout/fragment_page" />
  <fragment
    android:id="@+id/notesFragment"
    android:name="org.kiwix.kiwixmobile.core.page.notes.NotesFragment"
    android:label="NotesFragment"
    tools:layout="@layout/fragment_page" />
  <fragment
    android:id="@+id/introFragment"
    android:name="org.kiwix.kiwixmobile.intro.IntroFragment"
    android:label="IntroFragment"
    tools:layout="@layout/fragment_intro">
    <action
      android:id="@+id/action_introfragment_to_libraryFragment"
      app:destination="@id/libraryFragment"
      app:popUpTo="@id/introFragment"
      app:popUpToInclusive="true" />
  </fragment>
  <fragment
    android:id="@+id/historyFragment"
    android:name="org.kiwix.kiwixmobile.core.page.history.HistoryFragment"
    android:label="HistoryFragment"
    tools:layout="@layout/fragment_page" />
  <fragment
    android:id="@+id/languageFragment"
    android:name="org.kiwix.kiwixmobile.language.LanguageFragment"
    android:label="LanguageFragment"
    tools:layout="@layout/activity_language" />
  <fragment
    android:id="@+id/zimHostFragment"
    android:name="org.kiwix.kiwixmobile.webserver.ZimHostFragment"
    android:label="HistoryFragment"
    tools:layout="@layout/activity_zim_host" />
  <fragment
    android:id="@+id/helpFragment"
    android:name="org.kiwix.kiwixmobile.help.KiwixHelpFragment"
    android:label="HelpFragment"
    tools:layout="@layout/fragment_help" />
  <fragment
    android:id="@+id/kiwixSettingsFragment"
    android:name="org.kiwix.kiwixmobile.settings.KiwixSettingsFragment"
    android:label="KiwixSettingsFragment"
    tools:layout="@layout/settings" />
  <fragment
    android:id="@+id/searchFragment"
    android:name="org.kiwix.kiwixmobile.core.search.SearchFragment"
    android:label="SearchFragment"
    tools:layout="@layout/fragment_search">
    <action
      android:id="@+id/action_searchFragment_to_readerFragment"
      app:destination="@id/readerFragment"
      app:popUpTo="@id/readerFragment" />
  </fragment>
  <fragment
    android:id="@+id/localFileTransferFragment"
    android:name="org.kiwix.kiwixmobile.localFileTransfer.LocalFileTransferFragment"
    android:label="LocalFileTransferFragment"
    tools:layout="@layout/fragment_local_file_transfer">
    <argument
      android:name="uris"
      android:defaultValue="@null"
      app:argType="android.net.Uri[]"
      app:nullable="true" />
  </fragment>
</navigation>
