<?xml version="1.0" encoding="utf-8"?>
<!--
  Nextcloud Android client application

  Copyright (C) 2017 Tobias Kaminsky
  Copyright (C) 2017 Nextcloud.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  License as published by the Free Software Foundation; either
  version 3 of the License, or 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 AFFERO GENERAL PUBLIC LICENSE for more details.

  You should have received a copy of the GNU Affero General Public
  License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/contacts_linear_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <androidx.appcompat.widget.SwitchCompat
            android:id="@+id/contacts_automatic_backup"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/standard_margin"
            android:text="@string/contacts_automatic_backup"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="@color/text_color" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/contacts_last_backup"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/standard_margin"
                android:layout_weight="1"
                android:text="@string/contacts_last_backup"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="@color/text_color"/>

            <TextView
                android:id="@+id/contacts_last_backup_timestamp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/standard_margin"
                android:layout_weight="1"
                android:gravity="end"
                android:text="@string/contacts_preference_backup_never"
                android:textAppearance="?android:attr/textAppearanceMedium"/>
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="horizontal">

            <com.google.android.material.button.MaterialButton
                android:id="@+id/contacts_backup_now"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/standard_margin"
                android:layout_weight="1"
                android:text="@string/contacts_backup_button"
                android:theme="@style/Button.Primary"
                app:cornerRadius="@dimen/button_corner_radius" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/contacts_datepicker"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/standard_margin"
                android:layout_weight="1"
                android:text="@string/contacts_preference_choose_date"
                android:theme="@style/Button"
                android:visibility="gone"
                app:cornerRadius="@dimen/button_corner_radius" />
        </LinearLayout>

    </LinearLayout>

</ScrollView>
