<!--
  ~ Copyright (c) 2022 Proton AG
  ~
  ~ This file is part of Proton Mail.
  ~
  ~ Proton Mail 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.
  ~
  ~ Proton Mail 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 Proton Mail. If not, see https://www.gnu.org/licenses/.
  -->

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/settingsItemWrapper"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_gravity="center_vertical">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/headingContainer"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_centerVertical="true"
        android:duplicateParentState="true"
        android:gravity="start|center_vertical"
        android:orientation="vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <TextView
            android:id="@+id/headingText"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:textAppearance="@style/Proton.Text.Default"
            app:layout_constraintEnd_toEndOf="@+id/guideline_03"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/valueText"
            style="@style/Proton.Text.DefaultSmall.Weak"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/padding_xxl"
            android:duplicateParentState="true"
            android:orientation="vertical"
            android:paddingTop="@dimen/padding_s"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/headingText" />

        <Spinner
            android:id="@+id/timeoutSpinner"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:clickable="false"
            android:duplicateParentState="true"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/headingText" />


        <androidx.constraintlayout.widget.Guideline
            android:id="@+id/guideline_03"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="vertical"
            app:layout_constraintGuide_percent="0.8" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.appcompat.widget.SwitchCompat
        android:id="@+id/actionSwitch"
        style="@style/ProtonSwitch"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_gravity="end|center_vertical"
        android:duplicateParentState="true"
        android:visibility="gone"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="1"
        app:layout_constraintStart_toStartOf="@+id/guideline_01"
        app:layout_constraintTop_toTopOf="@id/headingContainer" />

    <LinearLayout
        android:id="@+id/buttonsContainer"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:duplicateParentState="true"
        android:gravity="end|center_vertical"
        android:orientation="vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="1"
        app:layout_constraintStart_toStartOf="@+id/guideline_01"
        app:layout_constraintTop_toTopOf="parent">

        <Button
            android:id="@+id/clearCacheButton"
            style="@style/ProtonButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|center_vertical"
            android:duplicateParentState="true"
            android:maxLines="1"
            android:text="@string/empty_data"
            android:visibility="gone" />

        <ImageView
            android:id="@+id/icon"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="end|center_vertical"
            android:duplicateParentState="true"
            app:srcCompat="@drawable/ic_proton_arrow_out_square"
            app:tint="@color/icon_hint"
            android:visibility="invisible" />
    </LinearLayout>

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.9" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline_01"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.8" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline_02"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.6" />

</androidx.constraintlayout.widget.ConstraintLayout>
