<!--
  ~ Copyright 2018 The app Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<PreferenceScreen
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <PreferenceCategory app:title="@string/prefs_header_connection">

        <EditTextPreference
            app:icon="@drawable/ic_server"
            app:key="cryptServer"
            app:title="@string/pref_cryptServer_title"
            app:useSimpleSummaryProvider="true" />

        <EditTextPreference
            app:key="cryptUsername"
            app:icon="@drawable/ic_person"
            app:title="@string/pref_cryptUsername_title"
            app:useSimpleSummaryProvider="true" />

        <EditTextPreference
            app:key="cryptPassword"
            app:icon="@drawable/ic_lock_open"
            app:title="@string/pref_cryptPassword_title"
            app:summary="@string/password_mask" />

        <EditTextPreference
            app:key="requestLink"
            app:title="@string/pref_requestLink_title"
            app:useSimpleSummaryProvider="true" />

        <EditTextPreference
            app:key="interval"
            app:icon="@drawable/ic_timer"
            app:title="@string/pref_interval_title"
            app:useSimpleSummaryProvider="true" />

        <EditTextPreference
            app:key="minUpdateDistance"
            app:icon="@drawable/ic_directions_walk"
            app:title="@string/pref_minUpdateDistance_title"
            app:useSimpleSummaryProvider="true" />

        <SwitchPreference
            app:key="enableE2E"
            app:title="@string/pref_enableE2E_title"
            app:summaryOff="@string/pref_enableE2E_off"
            app:summaryOn="@string/pref_enableE2E_on" />

        <EditTextPreference
            app:key="e2ePassword"
            app:title="@string/pref_e2ePassword_title"
            app:summary="@string/password_mask"
            app:dependency="enableE2E" />

        <ListPreference
            app:key="proxyType"
            app:icon="@drawable/ic_proxy"
            app:title="@string/pref_proxyType_title"
            app:useSimpleSummaryProvider="true"
            app:entries="@array/proxy_types"
            app:entryValues="@array/proxy_type_values" />

        <EditTextPreference
            app:key="proxyHost"
            app:title="@string/pref_proxyHost_title"
            app:useSimpleSummaryProvider="true" />

        <EditTextPreference
            app:key="proxyPort"
            app:title="@string/pref_proxyPort_title"
            app:useSimpleSummaryProvider="true" />

        <EditTextPreference
            app:key="connectTimeout"
            app:icon="@drawable/ic_no_connection"
            app:title="@string/pref_connectTimeout_title"
            app:useSimpleSummaryProvider="true" />

        <EditTextPreference
            app:key="noGnssFallback"
            app:icon="@drawable/ic_location_disabled"
            app:title="@string/pref_noGnssFallback_title"
            app:useSimpleSummaryProvider="true" />

        <ListPreference
            app:key="tlsCertValidation"
            app:icon="@drawable/ic_security"
            app:title="@string/pref_tlsCertValidation_title"
            app:useSimpleSummaryProvider="true"
            app:entries="@array/tls_validation_types"
            app:entryValues="@array/tls_validation_type_values" />

    </PreferenceCategory>

    <PreferenceCategory app:title="@string/prefs_header_appearance">

        <ListPreference
            app:key="nightMode"
            app:icon="@drawable/ic_brightness_3"
            app:title="@string/prefs_nightMode_title"
            app:useSimpleSummaryProvider="true"
            app:entries="@array/night_mode_modes"
            app:entryValues="@array/night_mode_mode_values" />

        <SwitchPreference
            app:key="confirmStop"
            app:title="@string/pref_confirmStop_title"
            app:summaryOff="@string/pref_confirmStop_off"
            app:summaryOn="@string/pref_confirmStop_on" />

        <SwitchPreference
            app:key="hideLogo"
            app:icon="@drawable/ic_image"
            app:title="@string/prefs_hideLogo_title"
            app:summaryOff="@string/pref_hideLogo_off"
            app:summaryOn="@string/pref_hideLogo_on" />

    </PreferenceCategory>

    <PreferenceCategory app:title="@string/prefs_header_about">

        <Preference
            app:key="dummy_version"
            app:enabled="false"
            app:title="@string/about_version_title" />

        <Preference
            app:key="dummy_sourceCode"
            app:icon="@drawable/ic_code"
            app:title="@string/about_source_code_title"
            app:summary="@string/label_source_link" />

        <Preference
            app:key="dummy_reportIssue"
            app:icon="@drawable/ic_bug_report"
            app:title="@string/about_report_issue_title" />

    </PreferenceCategory>

</PreferenceScreen>
