<?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" android:id="@+id/navigation_graph"
    app:startDestination="@id/mainFragment">

    <action android:id="@+id/toTrackCollection"
        app:destination="@id/trackCollectionFragment"  />
    <action android:id="@+id/toBookmarks"
        app:destination="@id/bookmarksFragment"  />
    <action android:id="@+id/toMediaLibrary"
        app:destination="@id/mediaLibraryFragment"  />

    <fragment
        android:id="@+id/mainFragment"
        android:name="org.moire.ultrasonic.fragment.MainFragment"
        android:label="@string/common.appname" >
        <action
            android:id="@+id/mainToTrackCollection"
            app:destination="@id/trackCollectionFragment" />
        <action
            android:id="@+id/mainToAlbumList"
            app:destination="@id/albumListFragment" />
        <action
            android:id="@+id/mainToArtistList"
            app:destination="@id/artistListFragment" />
        <action
            android:id="@+id/mainToSelectGenre"
            app:destination="@id/selectGenreFragment" />
        <action
            android:id="@+id/toTrackCollection"
            app:destination="@id/trackCollectionFragment" />
    </fragment>
    <fragment
        android:id="@+id/mediaLibraryFragment"
        android:name="org.moire.ultrasonic.fragment.ArtistListFragment"
        android:label="@string/music_library.label" >
        <action
            android:id="@+id/artistsListToAlbumsList"
            app:destination="@id/albumListFragment" />
        <action
            android:id="@+id/artistsListToTrackCollection"
            app:destination="@id/trackCollectionFragment" />
    </fragment>
    <fragment
        android:id="@+id/nowPlayingFragment"
        android:name="org.moire.ultrasonic.fragment.NowPlayingFragment"
        android:label="@string/button_bar.now_playing">
        <action
            android:id="@+id/toTrackCollection"
            app:destination="@id/trackCollectionFragment" />
    </fragment>
    <fragment
        android:id="@+id/artistListFragment"
        android:name="org.moire.ultrasonic.fragment.ArtistListFragment" >
        <action
            android:id="@+id/artistsListToAlbumsList"
            app:destination="@id/albumListFragment" />
        <action
            android:id="@+id/artistsListToTrackCollection"
            app:destination="@id/trackCollectionFragment" />
        <argument
            android:name="refresh"
            app:argType="boolean"
            android:defaultValue="false" />
        <argument
            android:name="title"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null"
            />
    </fragment>
    <fragment
        android:id="@+id/trackCollectionFragment"
        android:name="org.moire.ultrasonic.fragment.TrackCollectionFragment" >
        <argument
            android:name="id"
            app:nullable="true"
            android:defaultValue="@null"
            app:argType="string" />
        <argument
            android:name="isAlbum"
            app:argType="boolean"
            android:defaultValue="false"/>
        <argument
            android:name="isArtist"
            app:argType="boolean"
            android:defaultValue="false"/>
        <argument
            android:name="getRandom"
            android:defaultValue="false"
            app:argType="boolean" />
        <argument
            android:name="getStarred"
            android:defaultValue="false"
            app:argType="boolean" />
        <argument
            android:name="getVideos"
            android:defaultValue="false"
            app:argType="boolean" />
        <argument
            android:name="autoPlay"
            android:defaultValue="false"
            app:argType="boolean" />
        <argument
            android:name="shuffle"
            android:defaultValue="false"
            app:argType="boolean" />
        <argument
            android:name="refresh"
            android:defaultValue="true"
            app:argType="boolean" />
        <argument android:name="name"
            app:argType="string"
            android:defaultValue="@null"
            app:nullable="true"/>
        <argument android:name="parentId"
            app:argType="string"
            android:defaultValue="@null"
            app:nullable="true"/>
        <argument android:name="genreName"
            app:argType="string"
            android:defaultValue="@null"
            app:nullable="true"/>
        <argument android:name="shareId"
            app:argType="string"
            android:defaultValue="@null"
            app:nullable="true"/>
        <argument android:name="playlistId"
            app:argType="string"
            android:defaultValue="@null"
            app:nullable="true"/>
        <argument android:name="playlistName"
            app:argType="string"
            android:defaultValue="@null"
            app:nullable="true"/>
        <argument android:name="shareName"
            app:argType="string"
            android:defaultValue="@null"
            app:nullable="true"/>
        <argument android:name="podcastChannelId"
            app:argType="string"
            android:defaultValue="@null"
            app:nullable="true"/>
        <argument
            android:name="albumListType"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null"/>
        <argument
            android:name="size"
            app:argType="integer"
            android:defaultValue="0"
            />
        <argument
            android:name="offset"
            app:argType="integer"
            android:defaultValue="0"
            />
        <action
            android:id="@+id/loadMoreTracks"
            app:destination="@id/trackCollectionFragment" />
    </fragment>
    <fragment
        android:id="@+id/albumListFragment"
        android:name="org.moire.ultrasonic.fragment.AlbumListFragment" >
        <argument
            android:name="type"
            app:argType="org.moire.ultrasonic.api.subsonic.models.AlbumListType"
            />
        <argument
            android:name="title"
            app:argType="string"
            app:nullable="true" />
        <argument
            android:name="size"
            app:argType="integer"
        />
        <argument
            android:name="offset"
            app:argType="integer"
            />
        <argument
            android:name="append"
            android:defaultValue="false"
            app:argType="boolean" />
        <argument
            android:name="refresh"
            android:defaultValue="false"
            app:argType="boolean" />
        <argument
            android:name="id"
            android:defaultValue="@null"
            app:nullable="true"
            app:argType="string" />
        <action
            android:id="@+id/albumListToTrackCollection"
            app:destination="@id/trackCollectionFragment" />
    </fragment>
    <fragment
        android:id="@+id/entryListFragment"
        android:name="org.moire.ultrasonic.fragment.EntryListFragment" >
        <action
            android:id="@+id/entryListToTrackCollection"
            app:destination="@id/trackCollectionFragment" />
    </fragment>
    <fragment
        android:id="@+id/searchFragment"
        android:name="org.moire.ultrasonic.fragment.SearchFragment" >
        <action
            android:id="@+id/searchToTrackCollection"
            app:destination="@id/trackCollectionFragment" />
        <action
            android:id="@+id/searchToAlbumsList"
            app:destination="@id/albumListFragment" />
        <argument
            android:name="query"
            app:argType="string"
            app:nullable="true"
            android:defaultValue="@null" />
        <argument
            android:name="autoplay"
            app:argType="boolean"
            android:defaultValue="false" />
    </fragment>
    <fragment
        android:id="@+id/playlistsFragment"
        android:name="org.moire.ultrasonic.fragment.legacy.PlaylistsFragment" >
        <action
            android:id="@+id/playlistsToTrackCollection"
            app:destination="@id/trackCollectionFragment" />
    </fragment>
    <fragment
        android:id="@+id/downloadsFragment"
        android:name="org.moire.ultrasonic.fragment.DownloadsFragment" />
    <fragment
        android:id="@+id/sharesFragment"
        android:name="org.moire.ultrasonic.fragment.legacy.SharesFragment" >
        <action
            android:id="@+id/sharesToTrackCollection"
            app:destination="@id/trackCollectionFragment" />
    </fragment>
    <fragment
        android:id="@+id/bookmarksFragment"
        android:name="org.moire.ultrasonic.fragment.BookmarksFragment" />
    <fragment
        android:id="@+id/chatFragment"
        android:name="org.moire.ultrasonic.fragment.ChatFragment" />
    <fragment
        android:id="@+id/podcastFragment"
        android:name="org.moire.ultrasonic.fragment.legacy.PodcastFragment" >
        <action
            android:id="@+id/podcastToTrackCollection"
            app:destination="@id/trackCollectionFragment" />
    </fragment>
    <fragment
        android:id="@+id/settingsFragment"
        android:name="org.moire.ultrasonic.fragment.SettingsFragment" >
    </fragment>
    <fragment
        android:id="@+id/aboutFragment"
        android:name="org.moire.ultrasonic.fragment.AboutFragment" />
    <fragment
        android:id="@+id/selectGenreFragment"
        android:name="org.moire.ultrasonic.fragment.legacy.SelectGenreFragment">
        <action
            android:id="@+id/selectGenreToTrackCollection"
            app:destination="@id/trackCollectionFragment" />
    </fragment>
    <fragment
        android:id="@+id/playerFragment"
        android:name="org.moire.ultrasonic.fragment.PlayerFragment" >
        <action
            android:id="@+id/playerToSelectAlbum"
            app:destination="@id/trackCollectionFragment" />
        <action
            android:id="@+id/playerToAlbumsList"
            app:destination="@id/albumListFragment" />
        <action
            android:id="@+id/playerToLyrics"
            app:destination="@id/lyricsFragment" />
        <action
            android:id="@+id/playerToEqualizer"
            app:destination="@id/equalizerFragment" />
    </fragment>
    <fragment
        android:id="@+id/lyricsFragment"
        android:name="org.moire.ultrasonic.fragment.legacy.LyricsFragment" >
        <argument
            android:name="artist"
            app:argType="string" />
        <argument
            android:name="title"
            app:argType="string" />
    </fragment>
    <fragment
        android:id="@+id/equalizerFragment"
        android:name="org.moire.ultrasonic.fragment.EqualizerFragment" />
    <fragment
        android:id="@+id/serverSelectorFragment"
        android:name="org.moire.ultrasonic.fragment.ServerSelectorFragment" >
        <action
            android:id="@+id/toEditServer"
            app:destination="@id/editServerFragment" />
    </fragment>
    <fragment
        android:id="@+id/editServerFragment"
        android:name="org.moire.ultrasonic.fragment.EditServerFragment" >
        <argument
            android:name="index"
            app:argType="integer"
            android:defaultValue="-1" />
    </fragment>
    <action
        android:id="@+id/toSearchFragment"
        app:destination="@id/searchFragment" />
</navigation>