<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    android:key="pref_key_notifications"
    android:persistent="true"
    android:summary="@string/prefs_sum_notifications"
    android:title="@string/prefs_notifications">

    <!-- notification channel based settings -->
    <PreferenceCategory
        android:key="pref_key_notif_new"
        android:title="@string/notifications_settings">
        <Preference
            android:key="@string/preferences__chat_notification_settings"
            android:summary="@string/prefs_notification_settings_summary"
            android:title="@string/chats" />
        <Preference
            android:key="@string/preferences__group_notification_settings"
            android:summary="@string/prefs_notification_settings_summary"
            android:title="@string/group_chats" />
        <Preference
            android:key="@string/preferences__group_call_notification_settings"
            android:summary="@string/prefs_notification_settings_summary"
            android:title="@string/group_calls" />
    </PreferenceCategory>

    <!-- legacy notification settings -->
    <PreferenceCategory
        android:key="pref_key_system_notif"
        android:title="@string/prefs_system_notifications">
        <ch.threema.app.preference.RingtonePreference
            android:defaultValue="@string/default_notification_sound"
            android:icon="@drawable/ic_notifications_active_outline"
            android:key="@string/preferences__notification_sound"
            android:summary="@string/prefs_sum_notification_sound"
            android:title="@string/prefs_notification_sound" />
        <CheckBoxPreference
            android:defaultValue="true"
            android:icon="@drawable/ic_vibration_outline"
            android:key="@string/preferences__vibrate"
            android:summary="@string/prefs_sum_vibrate"
            android:title="@string/prefs_vibrate"
            android:widgetLayout="@layout/preference_switch_layout" />
    </PreferenceCategory>
    <PreferenceCategory
        android:key="pref_key_group_notif"
        android:title="@string/prefs_group_notifications">
        <ch.threema.app.preference.RingtonePreference
            android:defaultValue="@string/default_notification_sound"
            android:icon="@drawable/ic_notifications_active_outline"
            android:key="@string/preferences__group_notification_sound"
            android:summary="@string/prefs_sum_notification_sound"
            android:title="@string/prefs_notification_sound" />
        <CheckBoxPreference
            android:defaultValue="true"
            android:icon="@drawable/ic_vibration_outline"
            android:key="@string/preferences__group_vibrate"
            android:summary="@string/prefs_sum_vibrate"
            android:title="@string/prefs_vibrate"
            android:widgetLayout="@layout/preference_switch_layout" />
    </PreferenceCategory>
    <PreferenceCategory
        android:key="pref_key_voice_notif"
        android:title="@string/prefs_voice_call_notifications">
        <CheckBoxPreference
            android:defaultValue="false"
            android:disableDependentsState="true"
            android:key="@string/preferences__use_system_ringtone"
            android:title="@string/prefs_title_use_system_ringtone"
            android:widgetLayout="@layout/preference_switch_layout" />
        <ch.threema.app.preference.RingtonePreference
            android:defaultValue="null"
            android:dependency="@string/preferences__use_system_ringtone"
            android:icon="@drawable/ic_notifications_active_outline"
            android:key="@string/preferences__voip_ringtone"
            android:summary="@string/prefs_sum_voice_call_sound"
            android:title="@string/prefs_voice_call_sound" />
        <CheckBoxPreference
            android:defaultValue="true"
            android:icon="@drawable/ic_vibration_outline"
            android:key="@string/preferences__voip_vibration"
            android:summary="@string/prefs_sum_voice_call_vibrate"
            android:title="@string/prefs_vibrate"
            android:widgetLayout="@layout/preference_switch_layout" />
    </PreferenceCategory>
    <PreferenceCategory
        android:key="pref_key_groupcall_notif"
        android:title="@string/group_calls">
        <CheckBoxPreference
            android:defaultValue="false"
            android:disableDependentsState="true"
            android:key="@string/preferences__group_calls_use_system_ringtone"
            android:title="@string/prefs_title_use_system_ringtone"
            android:widgetLayout="@layout/preference_switch_layout" />
        <ch.threema.app.preference.RingtonePreference
            android:defaultValue="@string/default_ringtone"
            android:dependency="@string/preferences__group_calls_use_system_ringtone"
            android:icon="@drawable/ic_notifications_active_outline"
            android:key="@string/preferences__group_calls_ringtone"
            android:summary="@string/prefs_sum_notification_sound"
            android:title="@string/prefs_voice_call_sound" />
        <CheckBoxPreference
            android:defaultValue="true"
            android:icon="@drawable/ic_vibration_outline"
            android:key="@string/preferences__group_calls_vibration"
            android:summary="@string/prefs_sum_group_calls_vibration"
            android:title="@string/prefs_vibrate"
            android:widgetLayout="@layout/preference_switch_layout" />
    </PreferenceCategory>
    <PreferenceCategory
        android:key="pref_key_inapp"
        android:title="@string/prefs_inapp">
        <CheckBoxPreference
            android:defaultValue="true"
            android:icon="@drawable/ic_outline_music_note_24"
            android:key="@string/preferences__inapp_sounds"
            android:summaryOff="@string/prefs_inapp_sounds_off"
            android:summaryOn="@string/prefs_inapp_sounds_on"
            android:title="@string/prefs_inapp_sounds"
            android:widgetLayout="@layout/preference_switch_layout" />
        <CheckBoxPreference
            android:defaultValue="true"
            android:icon="@drawable/ic_vibration_outline"
            android:key="@string/preferences__inapp_vibrate"
            android:summaryOff="@string/prefs_inapp_vibrate_off"
            android:summaryOn="@string/prefs_inapp_vibrate_on"
            android:title="@string/prefs_inapp_vibrate"
            android:widgetLayout="@layout/preference_switch_layout" />
    </PreferenceCategory>
    <PreferenceCategory
        android:key="pref_key_other"
        android:title="@string/prefs_notifications">
        <CheckBoxPreference
            android:defaultValue="true"
            android:icon="@drawable/ic_outline_preview_24"
            android:key="@string/preferences__notification_preview"
            android:title="@string/prefs_notification_preview"
            android:widgetLayout="@layout/preference_switch_layout" />
        <DropDownPreference
            android:defaultValue="1"
            android:entries="@array/list_notification_priority"
            android:entryValues="@array/list_notification_priority_values"
            android:icon="@drawable/ic_baseline_priority_high_24"
            android:key="@string/preferences__notification_priority"
            android:summary="%s"
            android:title="@string/prefs_title_notification_priority" />
    </PreferenceCategory>
    <PreferenceCategory
        android:key="pref_key_work_life_balance"
        android:title="@string/prefs_work_life_balance">
        <CheckBoxPreference
            android:defaultValue="false"
            android:icon="@drawable/ic_do_not_disturb_filled"
            android:key="@string/preferences__working_days_enable"
            android:summary="@string/prefs_working_days_enable_sum"
            android:title="@string/prefs_working_days_enable_title"
            android:widgetLayout="@layout/preference_switch_layout" />
        <MultiSelectListPreference
            android:defaultValue="@array/working_days_default"
            android:dependency="@string/preferences__working_days_enable"
            android:entries="@array/working_days"
            android:entryValues="@array/working_days_values"
            android:key="@string/preferences__working_days"
            android:summary="@string/prefs_working_days_sum"
            android:title="@string/prefs_title_working_days" />

        <Preference
            android:dependency="@string/preferences__working_days_enable"
            android:key="@string/preferences__work_time_start"
            android:summary="@string/prefs_work_time_start_sum"
            android:title="@string/prefs_work_time_start" />

        <Preference
            android:dependency="@string/preferences__working_days_enable"
            android:key="@string/preferences__work_time_end"
            android:summary="@string/prefs_work_time_end_sum"
            android:title="@string/prefs_work_time_end" />

    </PreferenceCategory>
</PreferenceScreen>
