<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:key="optionPrefs">

    <PreferenceCategory
        android:key="normalCategory"
        android:title="@string/pref_category_normal">

        <EditTextPreference
            android:key="textSize"
            android:title="@string/text_size"
            app:useSimpleSummaryProvider="true"
            android:defaultValue="20"
            android:persistent="false" />

        <rikka.preference.SimpleMenuPreference
            app:key="fontFamilies"
            app:title="@string/font_family"
            app:defaultValue="default"
            app:entries="@array/font_families"
            app:entryValues="@array/font_family_values"
            app:summary="%s"
            android:persistent="false" />

        <EditTextPreference
            android:key="ttcIndex"
            app:isPreferenceVisible="false"
            android:title="@string/ttc_index"
            app:useSimpleSummaryProvider="true"
            android:defaultValue="0"
            android:persistent="false"
            android:enabled="false" />

        <Preference
            android:key="customFont"
            app:isPreferenceVisible="false"
            android:title="@string/choose_font"
            android:icon="@drawable/ic_baseline_open_in_new_24" />

    </PreferenceCategory>

    <!-- https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg#registered-axis-tags -->
    <!-- https://fonts.google.com/variablefonts#axis-definitions -->
    <PreferenceCategory
        android:key="variations"
        android:title="@string/pref_category_variations"
        android:enabled="false" >

        <Preference
            android:key="unsupportedAndroid"
            app:isPreferenceVisible="true"
            android:enabled="false"
            android:title="@string/unsupported_android" />

        <SeekBarPreference
            android:key="italAxis"
            android:summary="ital"
            android:title="@string/variation_italic"
            app:min="0"
            android:max="10"
            android:defaultValue="0"
            app:updatesContinuously="true"
            android:persistent="false" />

        <SeekBarPreference
            android:key="opszAxis"
            android:summary="opsz"
            android:title="@string/variation_optical_size"
            app:min="1"
            android:max="1440"
            android:defaultValue="1"
            app:updatesContinuously="true"
            android:persistent="false" />

        <SeekBarPreference
            android:key="slntAxis"
            android:summary="slnt"
            android:title="@string/variation_slant"
            app:min="0"
            android:max="180"
            android:defaultValue="90"
            app:updatesContinuously="true"
            android:persistent="false" />

        <SeekBarPreference
            android:key="wdthAxis"
            android:summary="wdth"
            android:title="@string/variation_width"
            app:min="0"
            android:max="2000"
            android:defaultValue="1000"
            app:updatesContinuously="true"
            android:persistent="false" />

        <SeekBarPreference
            android:key="wghtAxis"
            android:summary="wght"
            android:title="@string/variation_weight"
            app:min="1"
            android:max="1000"
            android:defaultValue="400"
            app:showSeekBarValue="true"
            app:adjustable="true"
            app:updatesContinuously="true"
            android:persistent="false" />

        <EditTextPreference
            android:key="variationEditor"
            android:title="@string/variation_editor"
            app:useSimpleSummaryProvider="true"
            android:persistent="false"
            app:isPreferenceVisible="false" />

        <Preference
            android:key="addVariation"
            android:title="@string/add_font_variation"
            android:icon="@drawable/baseline_add_24" />

        <Preference
            android:key="editVariation"
            android:title="@string/edit_variation_text"
            android:icon="@drawable/ic_baseline_edit_24" />

    </PreferenceCategory>

    <PreferenceCategory
        android:key="fontFeatures"
        android:title="@string/pref_category_features">

        <SwitchPreferenceCompat
            android:key="chwsFeature"
            android:title="@string/feature_chws"
            android:summary="@string/chws_description"
            android:defaultValue="true"
            android:persistent="false" />

        <SwitchPreferenceCompat
            android:key="haltFeature"
            android:title="@string/feature_halt"
            android:summary="@string/halt_description"
            android:defaultValue="false"
            android:persistent="false" />

        <SwitchPreferenceCompat
            android:key="fracFeature"
            android:title="@string/feature_frac"
            android:summary="@string/frac_description"
            android:defaultValue="false"
            android:persistent="false" />

        <EditTextPreference
            android:key="featureEditor"
            android:title="@string/feature_editor"
            app:useSimpleSummaryProvider="true"
            android:persistent="false"
            app:isPreferenceVisible="false" />

        <Preference
            android:key="addFeature"
            android:title="@string/add_font_feature"
            android:icon="@drawable/baseline_add_24" />

        <Preference
            android:key="editFeature"
            android:title="@string/edit_feature_text"
            android:icon="@drawable/ic_baseline_edit_24" />

    </PreferenceCategory>

    <PreferenceCategory
        android:key="about"
        android:title="@string/pref_category_about">

        <Preference
            android:key="sourceCode"
            android:title="@string/pref_source_code"
            android:icon="@drawable/ic_baseline_code_24">

            <intent android:action="android.intent.action.VIEW"
                android:data="@string/project_homepage" />

        </Preference>

        <Preference
            android:key="translators"
            android:summary="@string/pref_translator_list"
            android:title="@string/pref_translators"
            android:icon="@drawable/translate_24px">

            <intent android:action="android.intent.action.VIEW"
                android:data="@string/project_translators" />

        </Preference>
    </PreferenceCategory>

</PreferenceScreen>
