<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/root"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/shared_contact_details_header_background">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="?attr/actionBarSize"
                android:orientation="vertical"
                android:gravity="center">

                <ImageView
                    android:id="@+id/contact_details_avatar"
                    android:layout_width="125dp"
                    android:layout_height="125dp"
                    android:padding="8dp"
                    android:transitionName="avatar"
                    app:layout_collapseMode="parallax"
                    app:layout_collapseParallaxMultiplier="0.7"/>

                <org.thoughtcrime.securesms.components.emoji.EmojiTextView
                    android:id="@+id/contact_details_name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:transitionName="name"
                    android:gravity="center"
                    android:textSize="20sp"
                    tools:text="Peter Parker"/>

                <TextView
                    android:id="@+id/contact_details_number"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:transitionName="number"
                    android:layout_marginBottom="14dp"
                    android:gravity="center"
                    tools:text="(610) 555-5555"/>

                <Button
                    android:id="@+id/contact_details_add_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:layout_gravity="center"
                    style="@style/Button.Primary"
                    android:text="@string/SharedContactDetailsActivity_add_to_contacts" />

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

                    <Button
                        android:id="@+id/contact_details_invite_button"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="10dp"
                        android:layout_gravity="center"
                        style="@style/Button.Borderless"
                        android:text="@string/SharedContactDetailsActivity_invite_to_signal"
                        android:visibility="gone"
                        tools:visibility="gone"/>

                    <LinearLayout
                        android:id="@+id/contact_details_engage_container"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:orientation="horizontal"
                        style="?attr/buttonBarStyle"
                        android:visibility="gone"
                        tools:visibility="visible">

                        <LinearLayout
                            android:id="@+id/contact_details_message_button"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:orientation="vertical"
                            android:gravity="center"
                            android:padding="10dp">

                            <ImageView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginBottom="6dp"
                                android:tint="@color/signal_primary"
                                android:src="@drawable/message_24dp"/>

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="@string/SharedContactDetailsActivity_signal_message"
                                android:textColor="@color/signal_primary"/>

                        </LinearLayout>

                        <LinearLayout
                            android:id="@+id/contact_details_call_button"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:orientation="vertical"
                            android:gravity="center"
                            android:padding="10dp">

                            <ImageView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginBottom="6dp"
                                android:tint="@color/signal_primary"
                                android:src="@drawable/phone_24dp"/>

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="@string/SharedContactDetailsActivity_signal_call"
                                android:textColor="@color/signal_primary"/>

                        </LinearLayout>

                    </LinearLayout>

                </FrameLayout>

            </LinearLayout>

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:theme="@style/TextSecure.LightActionBar.DarkText"
                android:background="@color/transparent"
                app:layout_collapseMode="pin" />

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

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

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/contact_details_fields"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>