<?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"
    android:title="@string/database">

    <Preference
        android:icon="@drawable/ic_database"
        android:key="pref_debug_database_count"
        android:persistent="false"
        android:selectable="false"
        android:title="Number of records" />

    <Preference
        android:icon="@drawable/ic_file_upload"
        android:key="pref_debug_export_table"
        android:persistent="false"
        android:title="@string/file_export" />

    <Preference
        android:icon="@drawable/ic_download"
        android:key="pref_debug_import_table"
        android:persistent="false"
        android:title="@string/file_import" />

    <PreferenceCategory
        android:key="pref_header_dangerous_actions"
        android:title="@string/dangerous_actions">

        <SwitchPreferenceCompat
            android:defaultValue="false"
            android:icon="@drawable/ic_warning_gray"
            android:key="dangerous_actions"
            android:layout="@layout/preference_checkbox"
            android:persistent="false"
            android:title="@string/dangerous_actions" />

        <Preference
            android:dependency="dangerous_actions"
            android:icon="@drawable/ic_delete"
            android:key="pref_debug_clear_table"
            android:persistent="false"
            android:summary="Warning! By pushing this button all data from the table will be deleted."
            android:title="Clear table" />

        <!-- only in debug builds -->
        <Preference
            android:dependency="dangerous_actions"
            android:icon="@drawable/ic_delete_forever"
            android:key="pref_debug_drop_table"
            android:persistent="false"
            android:summary="Warning! By pushing this button the table will be dropped to the database and must be re-created."
            android:title="Drop table"
            app:isPreferenceVisible="false" />
    </PreferenceCategory>

    <PreferenceCategory
        android:key="pref_header_sql"
        android:title="SQL"
        app:iconSpaceReserved="false" />

</androidx.preference.PreferenceScreen>
