<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:validate="http://schemas.android.com/apk/res-auto">
    <PreferenceCategory
        android:key="@string/key_omnipod_common_preferences_category_confirmation_beeps"
        android:title="@string/omnipod_common_preferences_category_confirmation_beeps"
        app:initialExpandedChildrenCount="0">

        <SwitchPreference
            android:defaultValue="true"
            android:key="@string/key_omnipod_common_bolus_beeps_enabled"
            android:title="@string/omnipod_common_preferences_bolus_beeps_enabled" />

        <SwitchPreference
            android:defaultValue="true"
            android:key="@string/key_omnipod_common_basal_beeps_enabled"
            android:title="@string/omnipod_common_preferences_basal_beeps_enabled" />

        <SwitchPreference
            android:defaultValue="true"
            android:key="@string/key_omnipod_common_smb_beeps_enabled"
            android:title="@string/omnipod_common_preferences_smb_beeps_enabled" />

        <SwitchPreference
            android:defaultValue="false"
            android:key="@string/key_omnipod_common_tbr_beeps_enabled"
            android:title="@string/omnipod_common_preferences_tbr_beeps_enabled" />

    </PreferenceCategory>

    <PreferenceCategory
        android:key="@string/key_common_preferences_category_alerts_settings"
        android:title="@string/omnipod_common_preferences_category_alerts"
        app:initialExpandedChildrenCount="0">

        <SwitchPreference
            android:defaultValue="true"
            android:key="@string/key_omnipod_common_expiration_reminder_enabled"
            android:title="@string/omnipod_common_preferences_expiration_reminder_enabled" />

        <info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
            android:defaultValue="9"
            android:dependency="@string/key_omnipod_common_expiration_reminder_enabled"
            android:digits="0123456789"
            android:inputType="number"
            android:key="@string/key_omnipod_common_expiration_reminder_hours_before_shutdown"
            android:title="@string/omnipod_common_preferences_expiration_reminder_hours_before_shutdown"
            validate:maxNumber="24"
            validate:minNumber="2"
            validate:testType="numericRange" />

        <SwitchPreference
            android:defaultValue="true"
            android:key="@string/key_omnipod_common_low_reservoir_alert_enabled"
            android:title="@string/omnipod_common_preferences_low_reservoir_alert_enabled" />

        <info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
            android:defaultValue="20"
            android:dependency="@string/key_omnipod_common_low_reservoir_alert_enabled"
            android:digits="0123456789"
            android:inputType="number"
            android:key="@string/key_omnipod_common_low_reservoir_alert_units"
            android:title="@string/omnipod_common_preferences_low_reservoir_alert_units"
            validate:maxNumber="50"
            validate:minNumber="5"
            validate:testType="numericRange" />

        <SwitchPreference
            android:defaultValue="false"
            android:key="@string/key_omnipod_common_automatically_silence_alerts_enabled"
            android:title="@string/omnipod_common_preferences_automatically_silence_alerts" />

    </PreferenceCategory>

    <PreferenceCategory
        android:key="@string/key_common_preferences_category_other_settings"
        android:title="@string/omnipod_common_preferences_category_other"
        app:initialExpandedChildrenCount="0">

        <SwitchPreference
            android:defaultValue="false"
            android:key="@string/key_omnipod_common_suspend_delivery_button_enabled"
            android:title="@string/omnipod_common_preferences_suspend_delivery_button_enabled" />

        <SwitchPreference
            android:defaultValue="true"
            android:key="@string/key_omnipod_common_time_change_event_enabled"
            android:title="@string/omnipod_common_preferences_time_change_enabled" />

    </PreferenceCategory>

</androidx.preference.PreferenceScreen>