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

    <PreferenceScreen
        android:key="pref_about"
        android:title="@string/about_title" />

    <PreferenceCategory android:title="@string/preference_category__my_apps">
        <PreferenceScreen android:title="@string/preference_manage_installed_apps">
            <intent
                android:action="android.intent.action.MAIN"
                android:targetClass="org.fdroid.fdroid.views.installed.InstalledAppsActivity"
                android:targetPackage="@string/applicationId" />
        </PreferenceScreen>
        <PreferenceScreen
            android:summary="@string/repositories_summary"
            android:title="@string/menu_manage">
            <intent
                android:action="android.intent.action.MAIN"
                android:targetClass="org.fdroid.fdroid.views.ManageReposActivity"
                android:targetPackage="@string/applicationId" />
        </PreferenceScreen>
        <PreferenceScreen
            android:key="installHistory"
            android:summary="@string/install_history_summary"
            android:title="@string/install_history"
            android:visible="false">
            <intent
                android:action="android.intent.action.MAIN"
                android:targetClass="org.fdroid.fdroid.views.InstallHistoryActivity"
                android:targetPackage="@string/applicationId" />
        </PreferenceScreen>
    </PreferenceCategory>

    <PreferenceCategory android:title="@string/updates">
        <org.fdroid.fdroid.views.LiveSeekBarPreference
            android:defaultValue="@integer/defaultOverWifi"
            android:key="overWifi"
            android:layout="@layout/preference_seekbar"
            android:title="@string/over_wifi" />
        <org.fdroid.fdroid.views.LiveSeekBarPreference
            android:defaultValue="@integer/defaultOverData"
            android:key="overData"
            android:layout="@layout/preference_seekbar"
            android:title="@string/over_data" />
        <SwitchPreferenceCompat
            android:key="updateAutoDownload"
            android:summary="@string/update_auto_download_summary"
            android:title="@string/update_auto_download" />
        <org.fdroid.fdroid.views.LiveSeekBarPreference
            android:defaultValue="@integer/defaultUpdateInterval"
            android:key="updateIntervalSeekBarPosition"
            android:layout="@layout/preference_seekbar"
            android:title="@string/update_interval" />
        <SwitchPreferenceCompat
            android:defaultValue="true"
            android:key="updateNotify"
            android:title="@string/notify" />
    </PreferenceCategory>

    <PreferenceCategory
        android:key="pref_category_display"
        android:title="@string/display">
        <ListPreference
            android:key="language"
            android:title="@string/pref_language" />
        <ListPreference
            android:defaultValue="@string/defaultTheme"
            android:entries="@array/themeNames"
            android:entryValues="@array/themeValues"
            android:key="theme"
            android:title="@string/theme" />
        <SwitchPreferenceCompat
            android:defaultValue="false"
            android:key="usePureBlackDarkTheme"
            android:summary="@string/use_pure_black_dark_theme_summary"
            android:title="@string/use_pure_black_dark_theme" />
    </PreferenceCategory>

    <PreferenceCategory
        android:key="pref_category_appcompatibility"
        android:title="@string/appcompatibility">
        <SwitchPreferenceCompat
            android:defaultValue="false"
            android:key="incompatibleVersions"
            android:title="@string/show_incompat_versions" />
        <MultiSelectListPreference
            android:title="@string/show_anti_feature_apps"
            android:defaultValue="@array/antifeaturesValuesDefault"
            android:key="showAntiFeatures"
            android:entries="@array/antifeaturesNames"
            android:entryValues="@array/antifeaturesValues"/>
        <SwitchPreferenceCompat
            android:defaultValue="false"
            android:key="ignoreTouchscreen"
            android:title="@string/force_touch_apps" />
    </PreferenceCategory>

    <PreferenceCategory android:title="@string/local_repo">
        <EditTextPreference
            android:key="localRepoName"
            android:title="@string/local_repo_name" />
        <SwitchPreferenceCompat
            android:defaultValue="true"
            android:key="scanRemovableStorage"
            android:summary="@string/scan_removable_storage_summary"
            android:title="@string/scan_removable_storage_title" />
    </PreferenceCategory>

    <PreferenceCategory android:title="@string/proxy">
        <SwitchPreferenceCompat
            android:key="useTor"
            android:summary="@string/useTorSummary"
            android:title="@string/useTor" />
        <SwitchPreferenceCompat
            android:defaultValue="false"
            android:key="enableProxy"
            android:summary="@string/enable_proxy_summary"
            android:title="@string/enable_proxy_title" />
        <EditTextPreference
            android:dependency="enableProxy"
            android:key="proxyHost"
            android:summary="@string/proxy_host_summary"
            android:title="@string/proxy_host" />
        <EditTextPreference
            android:dependency="enableProxy"
            android:key="proxyPort"
            android:summary="@string/proxy_port_summary"
            android:title="@string/proxy_port" />
    </PreferenceCategory>

    <PreferenceCategory
        android:key="pref_category_privacy"
        android:title="@string/privacy">
        <SwitchPreferenceCompat
            android:defaultValue="true"
            android:key="promptToSendCrashReports"
            android:summary="@string/prompt_to_send_crash_reports_summary"
            android:title="@string/prompt_to_send_crash_reports" />
        <SwitchPreferenceCompat
            android:defaultValue="false"
            android:key="preventScreenshots"
            android:summary="@string/preventScreenshots_summary"
            android:title="@string/preventScreenshots_title" />

        <SwitchPreferenceCompat
            android:defaultValue="false"
            android:key="hideOnLongPressSearch"
            android:summary="@string/hide_on_long_search_press_summary"
            android:title="@string/hide_on_long_search_press_title" />

        <PreferenceScreen
            android:summary="@string/panic_settings_summary"
            android:title="@string/panic_settings">
            <intent
                android:action="android.intent.action.MAIN"
                android:targetClass="org.fdroid.fdroid.panic.PanicPreferencesActivity"
                android:targetPackage="@string/applicationId" />
        </PreferenceScreen>
    </PreferenceCategory>

    <PreferenceCategory
        android:key="pref_category_other"
        android:title="@string/other">
        <ListPreference
            android:defaultValue="86400000"
            android:entries="@array/keepCacheNames"
            android:entryValues="@array/keepCacheValues"
            android:key="keepCacheFor"
            android:title="@string/cache_downloaded" />
        <SwitchPreferenceCompat
            android:defaultValue="false"
            android:key="expert"
            android:title="@string/expert" />
        <CheckBoxPreference
            android:defaultValue="false"
            android:dependency="expert"
            android:key="unstableUpdates"
            android:summary="@string/unstable_updates_summary"
            android:title="@string/unstable_updates" />
        <CheckBoxPreference
            android:defaultValue="false"
            android:dependency="expert"
            android:key="keepInstallHistory"
            android:summary="@string/keep_install_history_summary"
            android:title="@string/keep_install_history" />
        <CheckBoxPreference
            android:key="sendToFdroidMetrics"
            android:title="@string/send_to_fdroid_metrics"
            android:summary="@string/send_to_fdroid_metrics_summary"
            android:defaultValue="false"
            android:dependency="expert" />
        <CheckBoxPreference
            android:key="hideAllNotifications"
            android:title="@string/hide_all_notifications"
            android:summary="@string/hide_all_notifications_summary"
            android:defaultValue="false"
            android:dependency="expert" />
        <CheckBoxPreference
            android:defaultValue="false"
            android:dependency="expert"
            android:key="sendVersionAndUUIDToServers"
            android:summary="@string/send_version_and_uuid_summary"
            android:title="@string/send_version_and_uuid" />
        <CheckBoxPreference
            android:defaultValue="false"
            android:dependency="expert"
            android:key="forceOldIndex"
            android:summary="@string/force_old_index_summary"
            android:title="@string/force_old_index" />
        <CheckBoxPreference
            android:dependency="expert"
            android:key="privilegedInstaller"
            android:persistent="false"
            android:title="@string/system_installer" />
    </PreferenceCategory>

</PreferenceScreen>
