<?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/.
  -->
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:id="@+id/contact_details_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/background_norm"
    android:fitsSystemWindows="true"
    tools:context=".contacts.ContactsActivity">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appbar_contact_details"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fitsSystemWindows="true"
            app:collapsedTitleGravity="center"
            app:contentScrim="@color/background_norm"
            app:statusBarScrim="@color/background_norm"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:titleEnabled="false"
            app:toolbarId="@+id/toolbar">

            <ch.protonmail.android.views.ListItemThumbnail
                android:id="@+id/thumbnail_contact_details"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginTop="@dimen/padding_4xl"
                android:layout_marginBottom="@dimen/padding_l"
                app:circleSize="@dimen/avatar_size"
                app:layout_collapseMode="parallax" />

            <ImageView
                android:id="@+id/image_view_contact_details_thumbnail"
                android:layout_width="@dimen/avatar_size"
                android:layout_height="@dimen/avatar_size"
                android:layout_gravity="center"
                android:layout_marginTop="@dimen/padding_4xl"
                android:layout_marginBottom="@dimen/padding_l"
                android:contentDescription="@string/contact_details"
                android:scaleType="fitXY"
                android:visibility="gone"
                app:layout_collapseMode="parallax" />

            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@android:color/transparent"
                android:minHeight="?attr/actionBarSize"
                app:contentInsetStartWithNavigation="0dp"
                app:layout_collapseMode="pin"
                app:menu="@menu/menu_contact_details"
                app:navigationIcon="@drawable/ic_proton_arrow_left"
                tools:title="Title" />

        </com.google.android.material.appbar.CollapsingToolbarLayout>

    </com.google.android.material.appbar.AppBarLayout>

    <androidx.core.widget.NestedScrollView
        android:id="@+id/scroll_view_contact_details"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/appbar_contact_details"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

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

            <TextView
                android:id="@+id/text_view_contact_details_contact_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginVertical="@dimen/padding_m"
                android:gravity="center"
                android:textAppearance="@style/Proton.Text.Headline"
                app:layout_collapseMode="pin"
                tools:text="@tools:sample/full_names" />

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

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/recycler_view_contacts_details"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                tools:listitem="@layout/list_item_contact_detail" />

        </LinearLayout>

    </androidx.core.widget.NestedScrollView>

    <ProgressBar
        android:id="@+id/progress_bar_contact_details"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:visibility="gone"
        tools:visibility="visible" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
