<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">


    <PreferenceCategory app:title="@string/downloading">
        <SwitchPreferenceCompat
            android:widgetLayout="@layout/preferece_material_switch"
            app:defaultValue="false"
            android:icon="@drawable/ic_nightly"
            android:key="incognito"
            app:summary="@string/incognito_summary"
            app:title="@string/incognito" />

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

        <SwitchPreferenceCompat
            android:widgetLayout="@layout/preferece_material_switch"
            app:defaultValue="false"
            android:icon="@drawable/ic_speed"
            android:key="quick_download"
            app:summary="@string/quick_download_summary"
            app:title="@string/quick_download" />
        
        <ListPreference
            android:defaultValue="url_type"
            android:entries="@array/prevent_duplicate_downloads"
            android:entryValues="@array/prevent_duplicate_downloads_values"
            android:icon="@drawable/baseline_archive_24"
            app:key="prevent_duplicate_downloads"
            app:useSimpleSummaryProvider="true"
            app:title="@string/prevent_duplicate_downloads" />

        <Preference
            android:defaultValue=""
            app:icon="@drawable/baseline_archive_24"
            app:key="download_archive_path"
            app:title="@string/download_archive_folder" />

        <SwitchPreferenceCompat
            android:widgetLayout="@layout/preferece_material_switch"
            app:defaultValue="true"
            android:icon="@drawable/metered_networks"
            android:key="metered_networks"
            app:summary="@string/download_over_metered_networks_summary"
            app:title="@string/download_over_metered_networks" />

        <SwitchPreferenceCompat
            android:widgetLayout="@layout/preferece_material_switch"
            app:defaultValue="false"
            android:icon="@drawable/ic_ipv4"
            android:key="force_ipv4"
            app:summary="@string/force_ipv4_desc"
            app:title="@string/force_ipv4" />


        <SwitchPreferenceCompat
            android:widgetLayout="@layout/preferece_material_switch"
            app:defaultValue="false"
            android:icon="@drawable/baseline_cookie_24"
            android:key="use_cookies"
            app:title="@string/use_cookies" />

        <SwitchPreferenceCompat
            android:widgetLayout="@layout/preferece_material_switch"
            app:defaultValue="false"
            android:icon="@drawable/baseline_note_24"
            android:key="no_check_certificates"
            app:title="@string/no_check_certificates" />

        <EditTextPreference
            android:icon="@drawable/baseline_network_locked_24"
            app:key="proxy"
            app:defaultValue=""
            app:summary="@string/socks5_proxy_summary"
            app:title="@string/socks5_proxy" />

        <ListPreference
            android:defaultValue="auto"
            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" />

        <SwitchPreferenceCompat
            android:widgetLayout="@layout/preferece_material_switch"
            app:defaultValue="false"
            android:icon="@drawable/ic_download_type"
            android:key="remember_download_type"
            app:summary="@string/remember_download_type_summary"
            app:title="@string/remember_download_type" />

        <Preference
            android:defaultValue="video"
            android:key="last_used_download_type"
            app:isPreferenceVisible="false" />

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

        <SeekBarPreference
            android:defaultValue="1"
            android:icon="@drawable/ic_concurrent_downloads"
            android:max="10"
            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_limitrate"
            app:key="limit_rate"
            app:summary="@string/limit_rate_summary"
            app:title="@string/limit_rate" />

        <EditTextPreference
            android:icon="@drawable/baseline_settings_input_component_24"
            app:key="buffer_size"
            app:summary="@string/buffer_size_summary"
            app:title="@string/buffer_size" />

        <EditTextPreference
            android:icon="@drawable/ic_clock"
            app:key="socket_timeout"
            android:summary="@string/socket_timeout_description"
            app:title="@string/socket_timeout"/>

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

        <SwitchPreferenceCompat
            android:widgetLayout="@layout/preferece_material_switch"
            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" />

        <ListPreference
            android:defaultValue=""
            android:entries="@array/cleanup_leftover_downloads"
            android:entryValues="@array/cleanup_leftover_downloads_values"
            android:icon="@drawable/ic_folder_delete"
            app:key="cleanup_leftover_downloads"
            app:useSimpleSummaryProvider="true"
            app:title="@string/cleanup_leftover_downloads" />

        <EditTextPreference
            app:key="retries"
            android:icon="@drawable/ic_retries"
            android:defaultValue=""
            app:useSimpleSummaryProvider="true"
            app:title="@string/retries" />

        <EditTextPreference
            app:key="fragment_retries"
            android:icon="@drawable/ic_retries"
            android:defaultValue=""
            app:useSimpleSummaryProvider="true"
            app:title="@string/fragment_retries" />
    </PreferenceCategory>

    <PreferenceCategory app:title="@string/scheduling">
        <SwitchPreferenceCompat
            android:widgetLayout="@layout/preferece_material_switch"
            app:defaultValue="false"
            android:icon="@drawable/baseline_access_alarm_24"
            android:key="use_alarm_for_scheduling"
            android:summary="@string/use_alarm_manager_summary"
            app:title="@string/use_alarm_manager" />


        <SwitchPreferenceCompat
            android:widgetLayout="@layout/preferece_material_switch"
            app:defaultValue="false"
            android:icon="@drawable/ic_clock"
            android:key="use_scheduler"
            app:title="@string/use_scheduler" />

        <Preference
            android:dependency="use_scheduler"
            android:icon="@drawable/ic_start"
            app:title="@string/start"
            app:defaultValue="00:00"
            app:summary="12:00"
            android:key="schedule_start"
        />

        <Preference
            android:dependency="use_scheduler"
            app:title="@string/end"
            android:icon="@drawable/ic_end"
            app:defaultValue="05:00"
            app:summary="05:00"
            android:key="schedule_end"
            />
    </PreferenceCategory>

    <Preference
        app:defaultValue=""
        android:key="use_header"
        app:isPreferenceVisible="false" />

    <Preference
        app:defaultValue=""
        android:key="useragent_header"
        app:isPreferenceVisible="false" />


</PreferenceScreen>