<?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/.
  -->
<RelativeLayout 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="match_parent"
    android:background="@color/background_norm"
    android:descendantFocusability="beforeDescendants"
    android:fitsSystemWindows="true"
    android:focusableInTouchMode="true"
    tools:context=".contacts.ContactsActivity"
    tools:layoutDirection="ltr">

    <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar" />

    <FrameLayout
        android:id="@+id/layout_no_connectivity_info"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" />


    <ScrollView
        android:id="@+id/scroll_parent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/toolbar"
        android:fillViewport="true">

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

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/padding_m"
                android:layout_marginBottom="@dimen/padding_m">

                <ch.protonmail.android.views.ListItemThumbnail
                    android:id="@+id/contactInitials"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="@dimen/padding_6xl"
                    app:circleSize="@dimen/avatar_size"
                    app:icon="@drawable/ic_proton_camera"
                    app:tint="@color/icon_norm"
                    app:layout_collapseMode="parallax"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <ImageView
                    android:id="@+id/contactPhoto"
                    android:layout_width="@dimen/avatar_size"
                    android:layout_height="@dimen/avatar_size"
                    android:layout_gravity="center"
                    android:layout_marginTop="@dimen/padding_l"
                    android:layout_marginBottom="@dimen/padding_5xl"
                    android:contentDescription="@string/contact_details"
                    android:scaleType="fitXY"
                    android:visibility="gone"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <Button
                    android:id="@+id/addPhotoBtn"
                    style="@style/ProtonButton.OutlinedButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/padding_l"
                    android:text="@string/add_photo"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="1px"
                android:layout_margin="@dimen/padding_s"
                android:background="@color/separator_norm" />

            <LinearLayout
                android:id="@+id/card_view_top_part"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:orientation="vertical">

                <LinearLayout
                    android:id="@+id/top_panel"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    tools:ignore="UselessParent">

                    <!-- Display name edit text -->
                    <me.proton.core.presentation.ui.view.ProtonInput
                        android:id="@+id/contact_display_name"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginHorizontal="@dimen/padding_l"
                        android:layout_marginVertical="@dimen/padding_s"
                        android:hint="@string/contact_display_name"
                        app:label="@string/contact_display_name" />

                    <ch.protonmail.android.views.VCardLinearLayout
                        android:id="@+id/emailAddressesContainer"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical"
                        android:paddingStart="@dimen/fields_default_space"
                        android:paddingLeft="@dimen/fields_default_space"
                        android:paddingEnd="@dimen/fields_default_space"
                        android:paddingRight="@dimen/fields_default_space" />
                </LinearLayout>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/card_view_bottom_part"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:orientation="vertical">

                <FrameLayout
                    android:id="@+id/encrypted_contact_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@color/background_secondary">

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="start"
                        android:gravity="start"
                        android:paddingStart="@dimen/padding_l"
                        android:paddingTop="@dimen/padding_m"
                        android:paddingEnd="@dimen/padding_l"
                        android:paddingBottom="@dimen/padding_m"
                        android:text="@string/encrypted_contact_details" />

                </FrameLayout>

                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <LinearLayout
                        android:id="@+id/encryptedDataContainer"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:paddingStart="@dimen/fields_default_space"
                        android:paddingLeft="@dimen/fields_default_space"
                        android:paddingTop="@dimen/fields_default_space_large"
                        android:paddingEnd="@dimen/fields_default_space"
                        android:paddingRight="@dimen/fields_default_space"
                        android:paddingBottom="@dimen/fields_default_space_large">

                        <ch.protonmail.android.views.VCardLinearLayout
                            android:id="@+id/encrypted_data_phone"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="vertical" />

                        <ch.protonmail.android.views.VCardLinearLayout
                            android:id="@+id/encrypted_data_address"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="vertical" />

                        <ch.protonmail.android.views.VCardLinearLayout
                            android:id="@+id/encrypted_data_other"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="vertical" />

                        <ch.protonmail.android.views.VCardLinearLayout
                            android:id="@+id/encrypted_data_note"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="vertical" />
                    </LinearLayout>

                </FrameLayout>
            </LinearLayout>
        </LinearLayout>
    </ScrollView>

    <FrameLayout
        android:id="@+id/progress_bar"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/background_norm"
        android:visibility="gone">

        <ProgressBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:indeterminate="true" />
    </FrameLayout>
</RelativeLayout>
