<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Nextcloud Talk application
  ~
  ~ @author Mario Danic
  ~ Copyright (C) 2017 Mario Danic
  ~
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<com.yarolegovich.mp.MaterialPreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                                              xmlns:apc="http://schemas.android.com/apk/res-auto"
                                              android:id="@+id/settings_screen"
                                              android:layout_width="match_parent"
                                              android:layout_height="match_parent"
                                              android:layout_marginBottom="48dp">

    <com.yarolegovich.mp.MaterialPreferenceCategory
        android:id="@+id/message_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:animateLayoutChanges="true">

        <TextView
            android:id="@+id/message_text"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"/>
    </com.yarolegovich.mp.MaterialPreferenceCategory>

    <com.yarolegovich.mp.MaterialPreferenceCategory
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:animateLayoutChanges="true">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView
                android:id="@+id/avatar_image"
                android:layout_width="@dimen/avatar_size_big"
                android:layout_height="@dimen/avatar_size_big"
                android:layout_centerHorizontal="true"/>

            <TextView
                android:id="@+id/display_name_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/avatar_image"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="@dimen/margin_between_elements"/>

            <TextView
                android:id="@+id/base_url_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/display_name_text"
                android:layout_centerHorizontal="true"
                android:layout_margin="4dp"/>


            <com.yarolegovich.mp.MaterialStandardPreference
                android:id="@+id/settings_switch"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/base_url_text"
                android:tag="switchAccountButton"
                apc:mp_title="@string/nc_settings_switch_account"/>

            <com.yarolegovich.mp.MaterialStandardPreference
                android:id="@+id/settings_reauthorize"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/settings_switch"
                apc:mp_title="@string/nc_settings_reauthorize"/>

            <com.yarolegovich.mp.MaterialStandardPreference
                android:id="@+id/settings_client_cert"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/settings_reauthorize"
                apc:mp_title="@string/nc_client_cert_setup"/>

            <com.yarolegovich.mp.MaterialStandardPreference
                android:id="@+id/settings_remove_account"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/settings_client_cert"
                apc:mp_title="@string/nc_settings_remove_account"/>

            <com.yarolegovich.mp.MaterialStandardPreference
                android:id="@+id/settings_add_account"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/settings_remove_account"
                apc:mp_title="@string/nc_settings_add_account"/>

        </RelativeLayout>

    </com.yarolegovich.mp.MaterialPreferenceCategory>

    <com.yarolegovich.mp.MaterialPreferenceCategory
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:animateLayoutChanges="true"
        apc:mpc_title="@string/nc_settings_notification_sounds"
        apc:mpc_title_color="@color/colorPrimary">

        <com.yarolegovich.mp.MaterialStandardPreference
            android:id="@+id/settings_call_sound"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_key="@string/nc_settings_call_ringtone_key"
            apc:mp_title="@string/nc_settings_call_ringtone"/>

        <com.yarolegovich.mp.MaterialStandardPreference
            android:id="@+id/settings_message_sound"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_key="@string/nc_settings_message_ringtone_key"
            apc:mp_title="@string/nc_settings_other_notifications_ringtone"/>

        <com.yarolegovich.mp.MaterialSwitchPreference
            android:id="@+id/settings_always_vibrate"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_key="@string/nc_settings_vibrate_key"
            apc:mp_title="@string/nc_settings_vibrate"
            apc:mp_summary="@string/nc_settings_vibrate_desc"
            apc:mp_default_value="true"/>

    </com.yarolegovich.mp.MaterialPreferenceCategory>


    <com.yarolegovich.mp.MaterialPreferenceCategory
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:animateLayoutChanges="true"
        apc:mpc_title="@string/nc_settings_proxy_title"
        apc:mpc_title_color="@color/colorPrimary">

        <com.yarolegovich.mp.MaterialChoicePreference
            android:id="@+id/settings_proxy_choice"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_default_value="@string/nc_no_proxy"
            apc:mp_entry_descriptions="@array/proxy_type_descriptions"
            apc:mp_key="@string/nc_settings_proxy_type_key"
            apc:mp_show_value="onRight"
            apc:mp_title="@string/nc_settings_proxy_type_title">
        </com.yarolegovich.mp.MaterialChoicePreference>

        <com.yarolegovich.mp.MaterialEditTextPreference
            android:id="@+id/settings_proxy_host_edit"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_key="@string/nc_settings_proxy_host_key"
            apc:mp_show_value="onRight"
            apc:mp_title="@string/nc_settings_proxy_host_title"/>

        <com.yarolegovich.mp.MaterialEditTextPreference
            android:id="@+id/settings_proxy_port_edit"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_key="@string/nc_settings_proxy_port_key"
            apc:mp_show_value="onRight"
            apc:mp_title="@string/nc_settings_proxy_port_title"/>

        <com.yarolegovich.mp.MaterialSwitchPreference
            android:id="@+id/settings_proxy_use_credentials"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_default_value="false"
            apc:mp_key="@string/nc_settings_use_credentials_key"
            apc:mp_show_value="onRight"
            apc:mp_title="@string/nc_settings_use_credentials_title">

        </com.yarolegovich.mp.MaterialSwitchPreference>

        <com.yarolegovich.mp.MaterialEditTextPreference
            android:id="@+id/settings_proxy_username_edit"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_key="@string/nc_settings_proxy_username_key"
            apc:mp_show_value="onRight"
            apc:mp_title="@string/nc_username"/>

        <com.yarolegovich.mp.MaterialEditTextPreference
            android:id="@+id/settings_proxy_password_edit"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_key="@string/nc_settings_proxy_password_key"
            apc:mp_show_value="onRight"
            apc:mp_title="@string/nc_password"/>

    </com.yarolegovich.mp.MaterialPreferenceCategory>

    <com.yarolegovich.mp.MaterialPreferenceCategory
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:animateLayoutChanges="true"
        apc:mpc_title="@string/nc_about"
        apc:mpc_title_color="@color/colorPrimary">

        <com.yarolegovich.mp.MaterialStandardPreference
            android:id="@+id/settings_privacy"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_title="@string/nc_privacy"/>

        <com.yarolegovich.mp.MaterialStandardPreference
            android:id="@+id/settings_source_code"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_title="@string/nc_get_source_code">
        </com.yarolegovich.mp.MaterialStandardPreference>

        <com.yarolegovich.mp.MaterialStandardPreference
            android:id="@+id/settings_licence"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_summary="@string/nc_license_summary"
            apc:mp_title="@string/nc_license_title">
        </com.yarolegovich.mp.MaterialStandardPreference>

        <com.yarolegovich.mp.MaterialStandardPreference
            android:id="@+id/settings_version"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            apc:mp_summary="v0.1"
            apc:mp_title="@string/nc_app_name">
        </com.yarolegovich.mp.MaterialStandardPreference>

    </com.yarolegovich.mp.MaterialPreferenceCategory>

</com.yarolegovich.mp.MaterialPreferenceScreen>
