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

    <PreferenceCategory android:title="@string/pref_general">
        <CheckBoxPreference
            android:defaultValue="true"
            android:key="grant_new_contacts"
            android:summary="@string/pref_grant_presence_updates_summary"
            android:title="@string/pref_grant_presence_updates"/>

        <ListPreference
            android:defaultValue="@string/default_resource"
            android:entries="@array/resources"
            android:entryValues="@array/resources"
            android:key="resource"
            android:summary="@string/pref_xmpp_resource_summary"
            android:title="@string/pref_xmpp_resource"/>
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/pref_privacy">
        <CheckBoxPreference
            android:defaultValue="true"
            android:key="confirm_messages"
            android:summary="@string/pref_confirm_messages_summary"
            android:title="@string/pref_confirm_messages"/>

        <CheckBoxPreference
            android:defaultValue="false"
            android:key="chat_states"
            android:summary="@string/pref_chat_states_summary"
            android:title="@string/pref_chat_states"/>
        <CheckBoxPreference
            android:defaultValue="false"
            android:key="last_activity"
            android:title="@string/pref_broadcast_last_activity"
            android:summary="@string/pref_broadcast_last_activity_summary"/>
        </PreferenceCategory>
    <PreferenceCategory android:title="@string/pref_notification_settings">
        <CheckBoxPreference
            android:defaultValue="true"
            android:key="show_notification"
            android:summary="@string/pref_notifications_summary"
            android:title="@string/pref_notifications"/>
        <CheckBoxPreference
            android:defaultValue="true"
            android:dependency="show_notification"
            android:key="vibrate_on_notification"
            android:summary="@string/pref_vibrate_summary"
            android:title="@string/pref_vibrate"/>
        <CheckBoxPreference
            android:defaultValue="true"
            android:dependency="show_notification"
            android:key="led"
            android:title="@string/pref_led"
            android:summary="@string/pref_led_summary"/>
        <RingtonePreference
            android:defaultValue="content://settings/system/notification_sound"
            android:dependency="show_notification"
            android:key="notification_ringtone"
            android:ringtoneType="notification"
            android:summary="@string/pref_sound_summary"
            android:title="@string/pref_sound"/>
        <PreferenceScreen
            android:dependency="show_notification"
            android:key="quiet_hours"
            android:summary="@string/pref_quiet_hours_summary"
            android:title="@string/title_pref_quiet_hours">
            <CheckBoxPreference
                android:defaultValue="false"
                android:key="enable_quiet_hours"
                android:summary="@string/pref_quiet_hours_summary"
                android:title="@string/title_pref_enable_quiet_hours"/>
            <eu.siacs.conversations.ui.TimePreference
                android:dependency="enable_quiet_hours"
                android:key="quiet_hours_start"
                android:negativeButtonText="@string/cancel"
                android:positiveButtonText="@string/set"
                android:title="@string/title_pref_quiet_hours_start_time"/>
            <eu.siacs.conversations.ui.TimePreference
                android:dependency="enable_quiet_hours"
                android:key="quiet_hours_end"
                android:negativeButtonText="@string/cancel"
                android:positiveButtonText="@string/set"
                android:title="@string/title_pref_quiet_hours_end_time"/>
        </PreferenceScreen>
        <ListPreference
            android:dependency="show_notification"
            android:key="grace_period_length"
            android:title="@string/pref_notification_grace_period"
            android:summary="@string/pref_notification_grace_period_summary"
            android:defaultValue="144"
            android:entries="@array/grace_periods"
            android:entryValues="@array/grace_periods_values"
            />
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/pref_attachments">
        <ListPreference
            android:defaultValue="524288"
            android:entries="@array/filesizes"
            android:entryValues="@array/filesizes_values"
            android:key="auto_accept_file_size"
            android:summary="@string/pref_accept_files_summary"
            android:title="@string/pref_accept_files"/>
        <ListPreference
            android:defaultValue="auto"
            android:entries="@array/picture_compression_entries"
            android:entryValues="@array/picture_compression_values"
            android:key="picture_compression"
            android:summary="@string/pref_picture_compression_summary"
            android:title="@string/pref_picture_compression"/>
        <CheckBoxPreference
            android:defaultValue="false"
            android:key="return_to_previous"
            android:title="@string/pref_return_to_previous"
            android:summary="@string/pref_return_to_previous_summary"/>
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/pref_ui_options">
        <ListPreference
            android:defaultValue="light"
            android:entries="@array/themes"
            android:entryValues="@array/themes_values"
            android:key="theme"
            android:summary="@string/pref_theme_options_summary"
            android:title="@string/pref_theme_options"/>
        <CheckBoxPreference
            android:defaultValue="true"
            android:key="use_subject"
            android:summary="@string/pref_conference_name_summary"
            android:title="@string/pref_conference_name"/>
        <CheckBoxPreference
            android:defaultValue="true"
            android:key="use_green_background"
            android:summary="@string/pref_use_green_background_summary"
            android:title="@string/pref_use_green_background"/>
        <CheckBoxPreference
            android:defaultValue="false"
            android:key="use_larger_font"
            android:summary="@string/pref_use_larger_font_summary"
            android:title="@string/pref_use_larger_font"/>
        <CheckBoxPreference
            android:defaultValue="false"
            android:key="send_button_status"
            android:summary="@string/pref_use_send_button_to_indicate_status_summary"
            android:title="@string/pref_use_send_button_to_indicate_status"/>
        <ListPreference
            android:defaultValue="recent"
            android:dialogTitle="@string/choose_quick_action"
            android:entries="@array/quick_actions"
            android:entryValues="@array/quick_action_values"
            android:key="quick_action"
            android:summary="@string/pref_quick_action_summary"
            android:title="@string/pref_quick_action"/>
        <CheckBoxPreference
            android:defaultValue="false"
            android:key="show_dynamic_tags"
            android:summary="@string/pref_show_dynamic_tags_summary"
            android:title="@string/pref_show_dynamic_tags"/>
    </PreferenceCategory>
    <PreferenceCategory
        android:key="advanced"
        android:title="@string/pref_advanced_options">
        <PreferenceScreen
            android:key="expert"
            android:summary="@string/pref_expert_options_summary"
            android:title="@string/pref_expert_options">
            <PreferenceCategory android:title="@string/pref_security_settings"
                android:key="security_options">
                <CheckBoxPreference
                    android:defaultValue="true"
                    android:key="btbv"
                    android:title="@string/pref_blind_trust_before_verification"
                    android:summary="@string/pref_blind_trust_before_verification_summary"/>
                <CheckBoxPreference
                    android:defaultValue="false"
                    android:key="dont_save_encrypted"
                    android:summary="@string/pref_dont_save_encrypted_summary"
                    android:title="@string/pref_dont_save_encrypted"/>
                <CheckBoxPreference
                    android:defaultValue="false"
                    android:key="dont_trust_system_cas"
                    android:summary="@string/pref_dont_trust_system_cas_summary"
                    android:title="@string/pref_dont_trust_system_cas_title"/>
                <Preference
                    android:key="remove_trusted_certificates"
                    android:summary="@string/pref_remove_trusted_certificates_summary"
                    android:title="@string/pref_remove_trusted_certificates_title"/>
                <CheckBoxPreference
                    android:defaultValue="true"
                    android:key="allow_message_correction"
                    android:title="@string/pref_allow_message_correction"
                    android:summary="@string/pref_allow_message_correction_summary"/>
                <Preference
                    android:key="clean_cache"
                    android:summary="@string/pref_clean_cache_summary"
                    android:title="@string/pref_clean_cache"/>
                <Preference
                    android:key="clean_private_storage"
                    android:summary="@string/pref_clean_private_storage_summary"
                    android:title="@string/pref_clean_private_storage"/>
                <Preference
                    android:key="delete_omemo_identities"
                    android:title="@string/pref_delete_omemo_identities"
                    android:summary="@string/pref_delete_omemo_identities_summary"/>
            </PreferenceCategory>
            <PreferenceCategory
                android:key="connection_options"
                android:title="@string/pref_connection_options">
                <CheckBoxPreference
                    android:defaultValue="false"
                    android:key="use_tor"
                    android:summary="@string/pref_use_tor_summary"
                    android:title="@string/pref_use_tor"/>
                <CheckBoxPreference
                    android:defaultValue="false"
                    android:key="show_connection_options"
                    android:summary="@string/pref_show_connection_options_summary"
                    android:title="@string/pref_show_connection_options"/>
            </PreferenceCategory>
            <PreferenceCategory android:title="@string/pref_input_options">
                <CheckBoxPreference
                    android:defaultValue="false"
                    android:key="enter_is_send"
                    android:summary="@string/pref_enter_is_send_summary"
                    android:title="@string/pref_enter_is_send"/>
                <CheckBoxPreference
                    android:defaultValue="false"
                    android:key="display_enter_key"
                    android:summary="@string/pref_display_enter_key_summary"
                    android:title="@string/pref_display_enter_key"/>
            </PreferenceCategory>
            <PreferenceCategory android:title="@string/pref_presence_settings">
                <CheckBoxPreference
                    android:defaultValue="false"
                    android:key="manually_change_presence"
                    android:title="@string/pref_manually_change_presence"
                    android:summary="@string/pref_manually_change_presence_summary"
                    android:disableDependentsState="true"/>
                <CheckBoxPreference
                    android:defaultValue="false"
                    android:key="away_when_screen_off"
                    android:summary="@string/pref_away_when_screen_off_summary"
                    android:title="@string/pref_away_when_screen_off"
                    android:dependency="manually_change_presence"/>
                <CheckBoxPreference
                    android:defaultValue="false"
                    android:key="xa_on_silent_mode"
                    android:summary="@string/pref_xa_on_silent_mode_summary"
                    android:title="@string/pref_xa_on_silent_mode"
                    android:dependency="manually_change_presence"/>
                <CheckBoxPreference
                    android:dependency="xa_on_silent_mode"
                    android:defaultValue="false"
                    android:key="treat_vibrate_as_silent"
                    android:title="@string/pref_treat_vibrate_as_silent"
                    android:summary="@string/pref_treat_vibrate_as_silent_summary"/>
            </PreferenceCategory>
            <PreferenceCategory android:title="@string/pref_expert_options_other">
                <CheckBoxPreference
                    android:key="autojoin"
                    android:defaultValue="true"
                    android:title="@string/pref_autojoin"
                    android:summary="@string/pref_autojoin_summary"
                    />
                <CheckBoxPreference
                    android:defaultValue="false"
                    android:key="indicate_received"
                    android:summary="@string/pref_use_indicate_received_summary"
                    android:title="@string/pref_use_indicate_received"/>
                <CheckBoxPreference
                    android:defaultValue="false"
                    android:key="enable_foreground_service"
                    android:summary="@string/pref_keep_foreground_service_summary"
                    android:title="@string/pref_keep_foreground_service"/>
                <Preference
                    android:key="export_logs"
                    android:summary="@string/pref_export_logs_summary"
                    android:title="@string/pref_export_logs"/>
            </PreferenceCategory>
        </PreferenceScreen>

        <CheckBoxPreference
            android:defaultValue="false"
            android:key="never_send"
            android:summary="@string/pref_never_send_crash_summary"
            android:title="@string/pref_never_send_crash"/>
    </PreferenceCategory>
    <eu.siacs.conversations.ui.AboutPreference
        android:summary="@string/pref_about_conversations_summary"
        android:title="@string/title_activity_about"/>
</PreferenceScreen>