<?xml version="1.0" encoding="utf-8"?><!--
    Copyright 2022 Thomas Schneider

    This file is a part of Fedilab

    This program 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.

    Fedilab 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 Fedilab; if not,
    see <http://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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context=".mastodon.activities.ProfileActivity">

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

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fitsSystemWindows="true"
            app:expandedTitleGravity="top"
            app:expandedTitleMarginEnd="64dp"
            app:expandedTitleMarginStart="48dp"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/profile_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingTop="?attr/actionBarSize">

                <com.google.android.material.card.MaterialCardView
                    android:id="@+id/banner_container"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/layout_height_header"
                    android:layout_margin="6dp"
                    app:cardElevation="4dp"
                    app:layout_constraintTop_toTopOf="parent">
                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">

                        <androidx.appcompat.widget.AppCompatImageView
                            android:id="@+id/banner_pp"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:contentDescription="@string/profile_banner"
                            android:scaleType="centerCrop"
                            android:src="@drawable/default_banner"
                            tools:src="@tools:sample/backgrounds/scenic" />
                        <com.google.android.material.button.MaterialButton
                            android:id="@+id/qr_code_generator"
                            style="@style/Widget.Material3.Button.ElevatedButton"
                            android:layout_width="48dp"
                            android:layout_height="36dp"
                            app:iconGravity="textStart"
                            app:iconPadding="0dp"
                            android:contentDescription="@string/qr_code_generator"
                            android:scaleType="fitCenter"
                            android:visibility="gone"
                            android:layout_marginEnd="10dp"
                            android:layout_marginBottom="5dp"
                            app:icon="@drawable/baseline_qr_code_24"
                            android:layout_alignParentBottom="true"
                            android:layout_alignParentEnd="true"
                            tools:visibility="visible" />
                    </RelativeLayout>



                </com.google.android.material.card.MaterialCardView>

                <com.google.android.material.card.MaterialCardView
                    android:id="@+id/avatar_container"
                    android:layout_width="108dp"
                    android:layout_height="108dp"
                    app:cardElevation="6dp"
                    app:layout_constraintBottom_toBottomOf="@id/banner_container"
                    app:layout_constraintEnd_toEndOf="@id/banner_container"
                    app:layout_constraintStart_toStartOf="@id/banner_container"
                    app:layout_constraintTop_toBottomOf="@id/banner_container">

                    <androidx.appcompat.widget.AppCompatImageView
                        android:id="@+id/account_pp"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:contentDescription="@string/profile_picture"
                        android:scaleType="centerCrop"
                        android:transitionName="@string/activity_porfile_pp"
                        app:layout_scrollFlags="scroll"
                        tools:src="@tools:sample/avatars" />

                </com.google.android.material.card.MaterialCardView>

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/account_follow"
                    style="@style/Widget.Material3.Button.Icon"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_marginStart="6dp"
                    android:layout_marginTop="6dp"
                    android:contentDescription="@string/make_an_action"
                    android:scaleType="fitCenter"
                    android:visibility="gone"
                    app:layout_constraintStart_toEndOf="@id/avatar_container"
                    app:layout_constraintTop_toBottomOf="@id/banner_container"
                    tools:icon="@drawable/ic_baseline_person_add_24"
                    tools:visibility="visible" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/account_notification"
                    style="@style/Widget.Material3.Button.Icon"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_marginTop="6dp"
                    android:layout_marginEnd="6dp"
                    android:contentDescription="@string/set_notify"
                    android:scaleType="fitCenter"
                    android:visibility="gone"
                    app:icon="@drawable/ic_baseline_notifications_off_24"
                    app:layout_constraintEnd_toStartOf="@id/avatar_container"
                    app:layout_constraintTop_toBottomOf="@id/banner_container"
                    tools:visibility="visible" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/header_edit_profile"
                    style="@style/Widget.Material3.Button.Icon"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:layout_marginStart="6dp"
                    android:layout_marginTop="6dp"
                    android:contentDescription="@string/edit_profile"
                    android:scaleType="fitCenter"
                    android:visibility="gone"
                    app:icon="@drawable/ic_baseline_edit_24"
                    app:layout_constraintStart_toEndOf="@id/avatar_container"
                    app:layout_constraintTop_toBottomOf="@id/banner_container"
                    tools:visibility="visible" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/account_dn"
                    style="@style/TextAppearance.AppCompat.Headline"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:singleLine="true"
                    app:layout_constraintEnd_toEndOf="@id/banner_container"
                    app:layout_constraintStart_toStartOf="@id/banner_container"
                    app:layout_constraintTop_toBottomOf="@id/avatar_container"
                    tools:text="@tools:sample/first_names" />

                <androidx.appcompat.widget.LinearLayoutCompat
                    android:id="@+id/account_un_container"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dp"
                    android:gravity="center"
                    app:layout_constraintEnd_toEndOf="@id/banner_container"
                    app:layout_constraintStart_toStartOf="@id/banner_container"
                    app:layout_constraintTop_toBottomOf="@id/account_dn">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/account_un"
                        style="@style/TextAppearance.AppCompat.Caption"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:singleLine="true"
                        tools:text="\@username\@instance.test" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/account_role"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"

                        android:layout_marginStart="5dp"
                        android:background="@drawable/blue_border"
                        android:textColor="?colorPrimary"
                        android:visibility="gone"
                        tools:text="Owner"
                        tools:visibility="visible" />
                </androidx.appcompat.widget.LinearLayoutCompat>


                <androidx.appcompat.widget.LinearLayoutCompat
                    android:id="@+id/names_container"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:gravity="center_horizontal"
                    android:orientation="vertical"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/account_un_container">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="5dp"
                        android:background="@drawable/red_border"
                        android:text="Peertube"
                        android:textColor="?colorError"
                        android:visibility="gone"
                        tools:ignore="HardcodedText" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/account_bot"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="5dp"
                        android:background="@drawable/blue_border"
                        android:text="@string/bot"
                        android:textColor="?colorPrimary"
                        android:visibility="gone" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/temp_mute"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:textColor="?colorError"
                        android:visibility="gone" />

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/account_moved"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_marginTop="5dp"
                        android:drawablePadding="4dp"
                        android:gravity="center"
                        android:textSize="16sp"
                        android:visibility="gone" />

                </androidx.appcompat.widget.LinearLayoutCompat>

                <ImageView
                    android:id="@+id/identity_proofs_indicator"
                    android:layout_width="45dp"
                    android:layout_height="45dp"
                    android:layout_marginStart="10dp"
                    android:contentDescription="@string/identity_proofs"
                    android:padding="8dp"
                    android:scaleType="fitCenter"
                    android:src="@drawable/ic_baseline_verified_24"
                    android:visibility="gone"
                    app:layout_constraintBottom_toBottomOf="@id/names_container"
                    app:layout_constraintStart_toEndOf="@id/names_container"
                    app:layout_constraintTop_toTopOf="@id/names_container" />


                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/account_note"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    android:gravity="center"
                    android:padding="10dp"
                    android:textIsSelectable="true"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/names_container" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/personal_note"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    android:drawablePadding="5dp"
                    android:gravity="center"
                    android:padding="10dp"
                    android:text="@string/action_add_notes"
                    android:textIsSelectable="true"
                    app:drawableStartCompat="@drawable/ic_baseline_note_24"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/account_note" />

                <HorizontalScrollView
                    android:id="@+id/info"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="10dp"
                    android:fillViewport="true"
                    android:scrollbars="none"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/personal_note">

                    <androidx.appcompat.widget.LinearLayoutCompat
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center_horizontal"
                        android:orientation="horizontal">

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/instance_info"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="3dp"
                            android:layout_marginEnd="3dp"
                            android:background="@drawable/blue_border"
                            android:singleLine="true"
                            android:textColor="?colorPrimary"
                            android:visibility="gone" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/account_date"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="3dp"
                            android:layout_marginEnd="3dp"
                            android:background="@drawable/blue_border"
                            android:singleLine="true"
                            android:textColor="?colorPrimary"
                            android:visibility="gone" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/account_followed_by"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="3dp"
                            android:layout_marginEnd="3dp"
                            android:background="@drawable/green_border"
                            android:singleLine="true"
                            android:text="@string/followed_by"
                            android:textColor="@color/verified_text"
                            android:visibility="gone" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/account_requested_by"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="3dp"
                            android:layout_marginEnd="3dp"
                            android:background="@drawable/red_border"
                            android:singleLine="true"
                            android:text="@string/requested_by"
                            android:textColor="?colorError"
                            android:visibility="gone" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/account_follow_request"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="3dp"
                            android:layout_marginEnd="3dp"
                            android:background="@drawable/blue_border"
                            android:singleLine="true"
                            android:text="@string/request_sent"
                            android:textColor="?colorPrimary"
                            android:visibility="gone" />
                    </androidx.appcompat.widget.LinearLayoutCompat>

                </HorizontalScrollView>
                <!-- Fields container -->
                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/fields_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/info" />
                <androidx.appcompat.widget.LinearLayoutCompat
                    android:id="@+id/featured_hashtags_container"
                    android:layout_marginTop="10dp"
                    android:layout_marginBottom="10dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:visibility="gone"
                    tools:visibility="visible"
                    android:gravity="center"
                    android:orientation="horizontal"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/fields_container">
                    <com.google.android.material.chip.ChipGroup
                        android:id="@+id/featured_hashtags"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        app:chipSpacingHorizontal="6dp"
                        app:chipSpacingVertical="6dp"
                        />
                </androidx.appcompat.widget.LinearLayoutCompat>


                <androidx.appcompat.widget.LinearLayoutCompat
                    android:id="@+id/familiar_followers"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="6dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    android:padding="10dp"
                    android:visibility="gone"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/featured_hashtags_container"
                    tools:visibility="visible">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/type_of_concat"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical"
                        android:text="@string/also_followed_by" />

                    <HorizontalScrollView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="10dp"
                        android:layout_weight="1"
                        android:gravity="center_vertical">

                        <androidx.appcompat.widget.LinearLayoutCompat
                            android:id="@+id/related_accounts"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal" />
                    </HorizontalScrollView>
                </androidx.appcompat.widget.LinearLayoutCompat>

                <!-- End Fields container -->
                <androidx.appcompat.widget.LinearLayoutCompat
                    android:id="@+id/warning_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:visibility="gone"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/familiar_followers"
                    tools:visibility="visible">

                    <androidx.appcompat.widget.AppCompatTextView
                        android:id="@+id/warning_message"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:text="@string/disclaimer_full" />

                    <com.google.android.material.button.MaterialButton
                        android:id="@+id/open_remote_profile"
                        style="@style/Widget.Material3.Button.Icon"
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:layout_marginStart="6dp"
                        android:layout_marginTop="6dp"
                        android:contentDescription="@string/display_remote_profile"
                        android:scaleType="fitCenter"
                        app:icon="@drawable/ic_baseline_manage_search_24" />
                </androidx.appcompat.widget.LinearLayoutCompat>


            </androidx.constraintlayout.widget.ConstraintLayout>

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:layout_gravity="top"
                app:contentInsetStartWithNavigation="0dp"
                app:layout_collapseMode="pin"
                app:layout_scrollFlags="scroll|enterAlways">

                <androidx.appcompat.widget.AppCompatImageView
                    android:id="@+id/profile_picture"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_marginEnd="10dp"
                    android:contentDescription="@string/profile_picture" />

                <androidx.appcompat.widget.AppCompatTextView
                    android:id="@+id/title"
                    style="@style/TextAppearance.AppCompat.Title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:ellipsize="end"
                    android:singleLine="true" />

            </androidx.appcompat.widget.Toolbar>

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

        <com.google.android.material.tabs.TabLayout
            android:id="@+id/account_tabLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:tabGravity="fill"
            app:tabMode="fixed" />
    </com.google.android.material.appbar.AppBarLayout>

    <androidx.viewpager.widget.ViewPager
        android:id="@+id/account_viewpager"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>