<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <ListPreference
        android:entries="@array/language_values"
        android:entryValues="@array/language_values"
        android:icon="@drawable/ic_language"
        app:key="app_language"
        app:summary="en"
        app:title="@string/language" />

    <PreferenceCategory android:title="@string/directories">
        <Preference
            app:icon="@drawable/ic_music_downloaded"
            app:key="music_path"
            app:defaultValue="@string/music_path"
            app:title="@string/music_directory" />

        <Preference
            app:icon="@drawable/ic_video_downloaded"
            app:key="video_path"
            app:defaultValue="@string/video_path"
            app:title="@string/video_directory" />

        <Preference
            app:icon="@drawable/ic_baseline_keyboard_arrow_right_24"
            app:key="command_path"
            app:defaultValue="@string/command_path"
            app:title="@string/command_directory" />

    </PreferenceCategory>

    <PreferenceCategory app:title="@string/downloading">
        <SwitchPreferenceCompat
            app:defaultValue="false"
            android:icon="@drawable/ic_incognito"
            android:key="incognito"
            app:summary="@string/incognito_summary"
            app:title="Incognito" />

        <SwitchPreferenceCompat
            app:defaultValue="true"
            android:icon="@drawable/ic_card"
            android:key="download_card"
            app:summary="@string/download_card_summary"
            app:title="@string/show_download_card" />

        <ListPreference
            android:dependency="download_card"
            android:defaultValue="video"
            android:entries="@array/download_types"
            android:entryValues="@array/download_types_values"
            android:icon="@drawable/ic_download_type"
            app:key="preferred_download_type"
            app:summary="@string/preferred_download_type_summary"
            app:title="@string/preferred_download_type" />

        <EditTextPreference
            android:icon="@drawable/ic_key"
            app:key="api_key"
            app:defaultValue=""
            app:summary="@string/api_key_summary"
            app:title="@string/api_key" />

        <SeekBarPreference
            app:dependency="aria2"
            android:defaultValue="1"
            android:icon="@drawable/ic_lines"
            android:max="10"
            app:key="concurrent_fragments"
            app:min="1"
            app:showSeekBarValue="true"
            android:dependency="aria2"
            app:summary="@string/concurrent_fragments_summary"
            app:title="@string/concurrent_fragments" />

        <SeekBarPreference
            android:defaultValue="1"
            android:icon="@drawable/ic_concurrent_downloads"
            android:max="5"
            app:key="concurrent_downloads"
            app:min="1"
            app:showSeekBarValue="true"
            app:summary="@string/concurrent_downloads_summary"
            app:title="@string/concurrent_downloads" />

        <EditTextPreference
            android:icon="@drawable/ic_down"
            app:key="limit_rate"
            app:summary="@string/limit_rate_summary"
            app:title="@string/limit_rate" />

        <SwitchPreferenceCompat
            app:defaultValue="false"
            android:icon="@drawable/ic_speed"
            android:key="aria2"
            app:summary="@string/aria2_summary"
            android:disableDependentsState="true"
            app:title="Aria2" />

        <SwitchPreferenceCompat
            app:defaultValue="false"
            android:icon="@drawable/ic_baseline_file_open_24"
            android:key="log_downloads"
            app:summary="@string/log_downloads_summary"
            app:title="@string/log_downloads" />

    </PreferenceCategory>


    <PreferenceCategory android:title="@string/processing">
        <MultiSelectListPreference
            app:defaultValue="@array/sponsorblock_settings_default"
            app:icon="@drawable/ic_money"
            app:dialogTitle="@string/select_sponsorblock_filtering"
            app:entries="@array/sponsorblock_settings_entries"
            app:entryValues="@array/sponsorblock_settings_values"
            app:key="sponsorblock_filter"
            app:summary="@string/select_sponsorblock_filtering"
            app:title="SponsorBlock" />

        <EditTextPreference
            android:icon="@drawable/ic_textformat"
            app:key="file_name_template"
            app:defaultValue="%(uploader)s - %(title)s"
            app:title="@string/file_name_template" />

        <SwitchPreferenceCompat
            app:defaultValue="false"
            app:icon="@drawable/ic_clock"
            app:key="mtime"
            app:summary="@string/enable_mtime_summary"
            app:title="@string/enable_mtime" />

        <SwitchPreferenceCompat
            app:defaultValue="true"
            app:icon="@drawable/ic_subtitles"
            app:key="embed_subtitles"
            app:summary="@string/embed_subs_summary"
            app:title="@string/embed_subtitles" />

        <SwitchPreferenceCompat
            app:defaultValue="true"
            app:icon="@drawable/ic_image"
            app:key="embed_thumbnail"
            app:summary="@string/embed_thumb_summary"
            app:title="@string/embed_thumb" />

        <SwitchPreferenceCompat
            app:defaultValue="true"
            app:icon="@drawable/ic_chapters"
            app:key="add_chapters"
            app:summary="@string/add_chapters_summary"
            app:title="@string/add_chapters" />

        <SwitchPreferenceCompat
            app:defaultValue="false"
            app:icon="@drawable/ic_image"
            app:key="write_thumbnail"
            app:summary="@string/save_thumb_summary"
            app:title="@string/save_thumb" />

        <ListPreference
            android:defaultValue="mp3"
            android:entries="@array/audio_containers"
            android:entryValues="@array/audio_containers"
            android:icon="@drawable/ic_code"
            app:key="audio_format"
            app:summary="mp3"
            app:title="@string/audio_format" />

        <ListPreference
            android:defaultValue="mkv"
            android:entries="@array/video_containers"
            android:entryValues="@array/video_containers"
            android:icon="@drawable/ic_code"
            app:key="video_format"
            app:summary="DEFAULT"
            app:title="@string/video_format" />


        <SeekBarPreference
            android:defaultValue="0"
            android:icon="@drawable/ic_music"
            android:max="10"
            app:key="audio_quality"
            app:min="0"
            app:showSeekBarValue="true"
            app:summary="@string/audio_quality_summary"
            app:title="@string/audio_quality" />

        <ListPreference
            android:defaultValue="Best Quality"
            android:entries="@array/video_formats"
            android:entryValues="@array/video_formats"
            android:icon="@drawable/ic_video"
            app:key="video_quality"
            app:summary="Best Quality"
            app:title="@string/video_quality" />

    </PreferenceCategory>


    <PreferenceCategory android:title="@string/updating">
        <Preference
            app:icon="@drawable/ic_update"
            app:key="update_ytdl"
            app:summary="@string/ytdl_update_hint"
            app:title="@string/update_ytdl" />

        <SwitchPreferenceCompat
            android:defaultValue="false"
            app:icon="@drawable/ic_nightly"
            app:key="nightly_ytdl"
            android:title="@string/update_ytdl_nightly"
            />

        <SwitchPreferenceCompat
            app:defaultValue="true"
            android:icon="@drawable/ic_update_app"
            android:key="update_app"
            app:summary="@string/update_app_summary"
            app:title="@string/update_app" />

    </PreferenceCategory>

    <Preference
        app:allowDividerAbove="true"
        app:icon="@drawable/ic_info"
        app:key="version"
        app:title="@string/version"/>

</PreferenceScreen>