<?xml version="1.0" encoding="utf-8"?><!--
  ~ 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/.
  -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="@dimen/fields_default_space"
    android:orientation="vertical">

    <TextView
        android:id="@+id/title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?selectableItemBackground"
        android:clickable="true"
        android:drawablePadding="@dimen/padding_m"
        android:focusable="true"
        android:gravity="start|center_vertical"
        android:padding="@dimen/padding_m"
        android:textAllCaps="true"
        android:textColor="?attr/brand_norm"
        app:drawableStartCompat="@drawable/ic_proton_plus"
        tools:text="Option title" />

    <LinearLayout
        android:id="@+id/fields_parent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/fields_default_space"
        android:orientation="vertical"
        android:visibility="gone"
        tools:visibility="visible">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/relativeLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/optionTitle"
                style="@style/Proton.Text.Default"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginStart="@dimen/padding_m"
                android:background="?selectableItemBackground"
                android:clickable="true"
                android:focusable="true"
                android:gravity="center_vertical"
                android:padding="@dimen/padding_s"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                tools:text="option title" />

            <ImageButton
                android:id="@+id/btnOptionType"
                android:layout_width="@dimen/padding_xl"
                android:layout_height="@dimen/padding_xl"
                android:background="?android:selectableItemBackground"
                app:srcCompat="@drawable/ic_proton_chevron_down_filled"
                app:tint="@color/icon_hint"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintBottom_toBottomOf="parent"
                tools:ignore="ContentDescription" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/padding_l">

            <ImageButton
                android:id="@+id/btn_clear"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_alignParentEnd="true"
                android:layout_centerVertical="true"
                android:background="@android:color/transparent"
                app:srcCompat="@drawable/ic_proton_cross_circle" />

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_toStartOf="@id/btn_clear">

                <TextView
                    android:id="@+id/address_full_combined"
                    style="@style/ProtonEditText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:clickable="true"
                    android:enabled="true"
                    android:focusable="false"
                    android:gravity="center_vertical"
                    android:hint="@string/address"
                    android:paddingBottom="@dimen/padding_s"
                    android:layout_marginHorizontal="@dimen/margin_m"
                    android:singleLine="true"
                    android:textColor="@color/text_norm"
                    android:textStyle="bold"
                    android:visibility="gone"
                    tools:visibility="visible" />

                <include layout="@layout/contact_address_detailed" />
            </FrameLayout>
        </RelativeLayout>
    </LinearLayout>
</LinearLayout>
