<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <PreferenceCategory app:title="@string/settings_title_general">
        <Preference
            android:layout_height="match_parent"
            android:key="system_equalizer"
            android:summary="@string/settings_system_equalizer_summary"
            android:title="@string/settings_system_equalizer_title" />

        <Preference
            android:layout_height="match_parent"
            android:key="app_equalizer"
            android:summary="@string/settings_app_equalizer_summary"
            android:title="@string/settings_app_equalizer" />

        <Preference
            android:key="scan_library"
            android:title="@string/settings_scan_title" />

        <Preference
            android:key="logout"
            android:title="@string/settings_logout_title"/>
    </PreferenceCategory>

    <PreferenceCategory app:title="@string/settings_title_ui">
        <ListPreference
            android:layout_height="match_parent"
            app:defaultValue="default"
            app:dialogTitle="@string/settings_language"
            app:key="language"
            app:title="@string/settings_language" />

        <ListPreference
            android:layout_height="wrap_content"
            app:defaultValue="default"
            app:dialogTitle="@string/settings_theme"
            app:entries="@array/theme_list_titles"
            app:entryValues="@array/theme_list_values"
            app:key="theme"
            app:title="@string/settings_theme"
            app:useSimpleSummaryProvider="true" />

        <SwitchPreference
            android:title="@string/settings_always_on_display"
            android:defaultValue="false"
            android:key="always_on_display" />

        <SwitchPreference
            android:layout_height="match_parent"
            android:defaultValue="true"
            android:key="rounded_corner"
            android:summary="@string/settings_rounded_corner_summary"
            android:title="@string/settings_rounded_corner" />

        <ListPreference
            app:defaultValue="6"
            app:dialogTitle="@string/settings_rounded_corner_size"
            app:entries="@array/rounded_corner_size_titles"
            app:entryValues="@array/rounded_corner_size_values"
            app:key="rounded_corner_size"
            app:title="@string/settings_rounded_corner_size"
            app:useSimpleSummaryProvider="true" />

        <SwitchPreference
            android:layout_height="wrap_content"
            android:defaultValue="false"
            android:key="audio_quality_per_item"
            android:summary="@string/settings_audio_quality_summary"
            android:title="@string/settings_audio_quality" />

        <SwitchPreference
            android:title="@string/settings_song_rating"
            android:defaultValue="false"
            android:summary="@string/settings_song_rating_summary"
            android:key="song_rating_per_item" />

        <SwitchPreference
            android:title="@string/settings_item_rating"
            android:defaultValue="false"
            android:summary="@string/settings_item_rating_summary"
            android:key="rating_per_item" />

        <SwitchPreference
            android:title="@string/settings_podcast"
            android:defaultValue="true"
            android:summary="@string/settings_podcast_summary"
            android:key="podcast_section_visibility" />

        <SwitchPreference
            android:title="@string/settings_radio"
            android:defaultValue="true"
            android:summary="@string/settings_radio_summary"
            android:key="radio_section_visibility" />

        <SwitchPreference
            android:title="@string/settings_auto_download_lyrics"
            android:defaultValue="false"
            android:summary="@string/settings_auto_download_lyrics_summary"
            android:key="auto_download_lyrics" />

        <SwitchPreference
            android:title="@string/settings_show_mini_shuffle_button"
            android:defaultValue="false"
            android:summary="@string/settings_show_mini_shuffle_button_summary"
            android:key="mini_shuffle_button_visibility" />

        <SwitchPreference
            android:title="@string/settings_music_directory"
            android:defaultValue="true"
            android:summary="@string/settings_music_directory_summary"
            android:key="music_directory_section_visibility" />

        <SwitchPreference
            android:title="@string/settings_album_detail"
            android:defaultValue="false"
            android:summary="@string/settings_album_detail_summary"
            android:key="album_detail" />

        <SwitchPreference
            android:title="@string/settings_artist_sort_by_album_count"
            android:defaultValue="false"
            android:summary="@string/settings_artist_sort_by_album_count_summary"
            android:key="artist_sort_by_album_count" />

    </PreferenceCategory>

     <PreferenceCategory app:title="@string/settings_title_playlist">
        <SwitchPreference
            android:title="@string/settings_allow_playlist_duplicates"
            android:defaultValue="false"
            android:summary="@string/settings_allow_playlist_duplicates_summary"
            android:key="allow_playlist_duplicates" />
    </PreferenceCategory>

    
    <PreferenceCategory app:title="@string/settings_title_data">
        <ListPreference
            app:defaultValue="256"
            app:dialogTitle="@string/settings_streaming_cache_size"
            app:entries="@array/streaming_cache_size_titles"
            app:entryValues="@array/streaming_cache_size_values"
            app:key="streaming_cache_size"
            app:title="@string/settings_streaming_cache_size" />

        <ListPreference
            app:defaultValue="500"
            app:dialogTitle="@string/settings_covers_cache"
            app:entries="@array/pref_cache_size_titles"
            app:entryValues="@array/pref_cache_size_values"
            app:key="image_cache_size"
            app:title="@string/settings_covers_cache"
            app:useSimpleSummaryProvider="true" />

        <ListPreference
            app:defaultValue="-1"
            app:dialogTitle="@string/settings_image_size"
            app:entries="@array/pref_image_size_titles"
            app:entryValues="@array/pref_image_size_values"
            app:key="image_size"
            app:title="@string/settings_image_size"
            app:useSimpleSummaryProvider="true" />

        <SwitchPreference
            android:title="@string/settings_continuous_play_title"
            android:defaultValue="true"
            android:summary="@string/settings_continuous_play_summary"
            android:key="continuous_play" />

        <SwitchPreference
            android:title="@string/settings_wifi_only_title"
            android:defaultValue="false"
            android:summary="@string/settings_wifi_only_summary"
            android:key="wifi_only" />

        <SwitchPreference
            android:title="@string/settings_data_saving_mode_title"
            android:defaultValue="false"
            android:summary="@string/settings_data_saving_mode_summary"
            android:key="data_saving_mode" />

        <SwitchPreference
            android:title="@string/settings_sync_starred_tracks_for_offline_use_title"
            android:defaultValue="false"
            android:summary="@string/settings_sync_starred_tracks_for_offline_use_summary"
            android:key="sync_starred_tracks_for_offline_use" />

        <SwitchPreference
            android:title="@string/settings_sync_starred_albums_for_offline_use_title"
            android:defaultValue="false"
            android:summary="@string/settings_sync_starred_albums_for_offline_use_summary"
            android:key="sync_starred_albums_for_offline_use" />

        <SwitchPreference
            android:title="@string/settings_sync_starred_artists_for_offline_use_title"
            android:defaultValue="false"
            android:summary="@string/settings_sync_starred_artists_for_offline_use_summary"
            android:key="sync_starred_artists_for_offline_use" />

        <ListPreference
            app:defaultValue="1"
            app:dialogTitle="@string/settings_buffering_strategy"
            app:entries="@array/buffering_strategy_titles"
            app:entryValues="@array/buffering_strategy_values"
            app:key="buffering_strategy"
            app:title="@string/settings_buffering_strategy"
            app:summary="@string/settings_buffering_strategy_summary"
            app:useSimpleSummaryProvider="false" />

        <Preference
            android:key="streaming_cache_storage"
            app:title="@string/settings_streaming_cache_storage_title" />

        <Preference
            android:key="download_storage"
            app:title="@string/settings_download_storage_title" />

        <Preference
            android:key="set_download_directory"
            android:title="Set download folder"
            android:summary="Choose a folder for downloaded music files"
            android:icon="@drawable/ic_folder"
            android:order="104"
            app:isPreferenceVisible="false" />

        <Preference
            android:key="delete_download_storage"
            app:title="@string/settings_delete_download_storage_title"
            app:summary="@string/settings_delete_download_storage_summary"/>
    </PreferenceCategory>

    <PreferenceCategory app:title="@string/settings_title_transcoding">
        <Preference
            app:selectable="false"
            app:summary="@string/settings_summary_transcoding" />

        <SwitchPreference
            android:title="@string/settings_audio_transcode_priority_title"
            android:defaultValue="false"
            android:summary="@string/settings_audio_transcode_priority_summary"
            android:key="audio_transcode_priority" />

        <ListPreference
            app:defaultValue="raw"
            app:dialogTitle="@string/settings_audio_transcode_format_wifi"
            app:entries="@array/audio_transcode_format_wifi_list_titles"
            app:entryValues="@array/audio_transcode_format_wifi_list_values"
            app:key="audio_transcode_format_wifi"
            app:title="@string/settings_audio_transcode_format_wifi"
            app:useSimpleSummaryProvider="true" />

        <ListPreference
            app:defaultValue="0"
            app:dialogTitle="@string/settings_max_bitrate_wifi"
            app:entries="@array/max_bitrate_wifi_list_titles"
            app:entryValues="@array/max_bitrate_wifi_list_values"
            app:key="max_bitrate_wifi"
            app:title="@string/settings_max_bitrate_wifi"
            app:useSimpleSummaryProvider="true" />

        <ListPreference
            app:defaultValue="raw"
            app:dialogTitle="@string/settings_audio_transcode_format_mobile"
            app:entries="@array/audio_transcode_format_mobile_list_titles"
            app:entryValues="@array/audio_transcode_format_mobile_list_values"
            app:key="audio_transcode_format_mobile"
            app:title="@string/settings_audio_transcode_format_mobile"
            app:useSimpleSummaryProvider="true" />

        <ListPreference
            app:defaultValue="0"
            app:dialogTitle="@string/settings_max_bitrate_mobile"
            app:entries="@array/max_bitrate_mobile_list_titles"
            app:entryValues="@array/max_bitrate_mobile_list_values"
            app:key="max_bitrate_mobile"
            app:title="@string/settings_max_bitrate_mobile"
            app:useSimpleSummaryProvider="true" />

        <SwitchPreference
            android:title="@string/settings_audio_transcode_estimate_content_length_title"
            android:defaultValue="false"
            android:summary="@string/settings_audio_transcode_estimate_content_length_summary"
            android:key="estimate_content_length" />

        <Preference
            app:selectable="false"
            app:summary="@string/settings_summary_transcoding_estimate_content_length" />
    </PreferenceCategory>

    <PreferenceCategory app:title="@string/settings_title_transcoding_download">
        <Preference
            app:selectable="false"
            app:summary="@string/settings_summary_transcoding_download" />

        <SwitchPreference
            android:title="@string/settings_audio_transcode_download_title"
            android:defaultValue="false"
            android:summary="@string/settings_audio_transcode_download_summary"
            android:key="audio_transcode_download" />

        <SwitchPreference
            android:title="@string/settings_audio_transcode_download_priority_title"
            android:defaultValue="false"
            android:summary="@string/settings_audio_transcode_download_priority_summary"
            android:key="audio_transcode_download_priority" />

        <ListPreference
            app:defaultValue="raw"
            app:dialogTitle="@string/settings_audio_transcode_format_download"
            app:entries="@array/audio_transcode_format_download_list_titles"
            app:entryValues="@array/audio_transcode_format_download_list_values"
            app:key="audio_transcode_format_download"
            app:title="@string/settings_audio_transcode_format_download"
            app:useSimpleSummaryProvider="true" />

        <ListPreference
            app:defaultValue="0"
            app:dialogTitle="@string/settings_max_bitrate_download"
            app:entries="@array/max_bitrate_download_list_titles"
            app:entryValues="@array/max_bitrate_download_list_values"
            app:key="max_bitrate_download"
            app:title="@string/settings_max_bitrate_download"
            app:useSimpleSummaryProvider="true" />
    </PreferenceCategory>

    <PreferenceCategory app:title="@string/settings_title_replay_gain">
        <Preference
            app:selectable="false"
            app:summary="@string/settings_summary_replay_gain" />

        <ListPreference
            app:defaultValue="disabled"
            app:dialogTitle="@string/settings_replay_gain"
            app:entries="@array/replay_gain_titles"
            app:entryValues="@array/replay_gain_values"
            app:key="replay_gain_mode"
            app:title="@string/settings_replay_gain"
            app:useSimpleSummaryProvider="true" />

    </PreferenceCategory>

    <PreferenceCategory app:title="@string/settings_title_rating">
        <SeekBarPreference
            android:key="min_star_rating"
            app:defaultValue="0"
            app:min="0"
            android:max="4"
            app:seekBarIncrement="1"
            app:showSeekBarValue="true"
            app:summary="@string/settings_summary_skip_min_star_rating"
            app:title="@string/settings_title_skip_min_star_rating" />

    </PreferenceCategory>

    <PreferenceCategory app:title="@string/settings_title_scrobble">
        <Preference
            app:selectable="false"
            app:summary="@string/settings_summary_scrobble" />

        <Preference
            app:selectable="false"
            app:summary="@string/settings_sub_summary_scrobble" />

        <SwitchPreference
            android:title="@string/settings_scrobble_title"
            android:defaultValue="true"
            android:key="scrobbling" />

    </PreferenceCategory>

    <PreferenceCategory app:title="@string/settings_title_share">
        <Preference
            app:selectable="false"
            app:summary="@string/settings_summary_share" />

        <SwitchPreference
            android:title="@string/settings_share_title"
            android:defaultValue="false"
            android:key="share" />

    </PreferenceCategory>

    <PreferenceCategory app:title="@string/settings_title_syncing">
        <Preference
            app:selectable="false"
            app:summary="@string/settings_summary_syncing" />

        <SwitchPreference
            android:title="@string/settings_queue_syncing_title"
            android:defaultValue="false"
            android:summary="@string/settings_queue_syncing_summary"
            android:key="queue_syncing" />

        <ListPreference
            app:defaultValue="5"
            app:dialogTitle="@string/settings_queue_syncing_countdown"
            app:entries="@array/queue_syncing_countdown_titles"
            app:entryValues="@array/queue_syncing_countdown_values"
            app:key="queue_syncing_countdown"
            app:title="@string/settings_queue_syncing_countdown"
            app:useSimpleSummaryProvider="true" />
    </PreferenceCategory>

    <PreferenceCategory 
        android:key="settings_github_update_category_key"
        app:title="@string/settings_github_update">
        <Preference
            app:selectable="false"
            app:summary="@string/settings_github_update_summary" />
        <SwitchPreference
            android:title="@string/settings_github_update_title"
            android:defaultValue="true"
            android:key="github_update_check" />
    </PreferenceCategory>

    <PreferenceCategory app:title="@string/settings_about_title">
        <Preference
            app:selectable="false"
            app:summary="@string/settings_about_summary" />

        <Preference
            android:key="version"
            app:summary="@string/settings_version_summary"
            app:title="@string/settings_version_title" />

        <Preference
            app:summary="@string/settings_github_summary"
            app:title="@string/settings_github_title">
            <intent
                android:action="android.intent.action.VIEW"
                android:data="@string/settings_github_link" />
        </Preference>

        <Preference
            app:summary="@string/settings_support_summary"
            app:title="@string/settings_support_title">
            <intent
                android:action="android.intent.action.VIEW"
                android:data="@string/settings_support_discussion_link" />
        </Preference>

        <Preference
            app:summary="@string/undraw_thanks"
            app:title="@string/undraw_page">
            <intent
                android:action="android.intent.action.VIEW"
                android:data="@string/undraw_url" />
        </Preference>
    </PreferenceCategory>
</PreferenceScreen>