<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Nextcloud - Android Client
  ~
  ~ SPDX-FileCopyrightText: 2017 Tobias Kaminsky <tobias@kaminsky.me>
  ~ SPDX-FileCopyrightText: 2017 Nextcloud GmbH
  ~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-->
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    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:layout_margin="@dimen/standard_margin"
        android:orientation="vertical">

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/data_to_back_up_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/data_to_back_up"
            android:textStyle="bold" />

        <com.google.android.material.materialswitch.MaterialSwitch
            android:id="@+id/contacts"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="48dp"
            android:text="@string/contacts"
            android:textColor="@color/text_color"
            android:textSize="@dimen/two_line_primary_text_size" />

        <com.google.android.material.materialswitch.MaterialSwitch
            android:id="@+id/calendar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="48dp"
            android:text="@string/calendar"
            android:textColor="@color/text_color"
            android:textSize="@dimen/two_line_primary_text_size" />

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

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/backup_settings_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingBottom="@dimen/standard_quarter_padding"
                android:text="@string/backup_settings"
                android:textStyle="bold" />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="48dp">

                <com.google.android.material.materialswitch.MaterialSwitch
                    android:id="@+id/daily_backup"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentEnd="true"
                    android:layout_centerVertical="true"
                    android:textColor="@color/text_color"
                    android:textSize="@dimen/two_line_primary_text_size" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_toStartOf="@id/daily_backup"
                    android:orientation="vertical"
                    android:gravity="center_vertical">

                    <com.google.android.material.textview.MaterialTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/daily_backup"
                        android:textColor="@color/text_color"
                        android:textSize="@dimen/two_line_primary_text_size" />

                    <com.google.android.material.textview.MaterialTextView
                        android:id="@+id/last_backup_with_date"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/last_backup"
                        android:textSize="12sp" />

                </LinearLayout>

            </RelativeLayout>

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="@dimen/standard_margin"
            android:gravity="end"
            android:orientation="horizontal">

            <com.google.android.material.button.MaterialButton
                android:id="@+id/contacts_datepicker"
                style="@style/Widget.Material3.Button.OutlinedButton"
                android:layout_width="@dimen/backup_button_width"
                android:layout_height="match_parent"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:text="@string/restore_backup"
                android:visibility="invisible"
                tools:visibility="visible" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/backup_now"
                android:layout_width="@dimen/backup_button_width"
                android:layout_height="match_parent"
                android:layout_marginStart="@dimen/standard_half_margin"
                android:minHeight="@dimen/minimum_size_for_touchable_area"
                android:text="@string/contacts_backup_button"
                android:theme="@style/Widget.Material3.Button.IconButton.Filled" />

        </LinearLayout>

    </LinearLayout>

</ScrollView>
