<?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.appcompat.widget.LinearLayoutCompat 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:orientation="vertical"
    tools:context=".mastodon.activities.ProfileActivity">

    <ScrollView
        android:id="@+id/scroll_container"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <RelativeLayout
                android:id="@+id/banner_pp_container"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                app:layout_constraintDimensionRatio="16:9"
                app:layout_constraintTop_toTopOf="parent">

                <com.google.android.material.imageview.ShapeableImageView
                    android:id="@+id/banner_pp"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginStart="12dp"
                    android:layout_marginTop="12dp"
                    android:layout_marginEnd="12dp"
                    android:layout_marginBottom="12dp"
                    android:contentDescription="@string/profile_banner"
                    android:padding="1dp"
                    android:scaleType="centerCrop"
                    android:src="@drawable/default_banner"
                    app:strokeWidth="1dp" />

                <ProgressBar
                    android:id="@+id/header_progress"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:visibility="gone" />
            </RelativeLayout>


            <com.google.android.material.button.MaterialButton
                android:id="@+id/header_select"
                style="@style/Widget.Material3.Button.OutlinedButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/select"
                app:icon="@drawable/ic_menu_gallery"
                app:layout_constraintEnd_toEndOf="@id/banner_pp_container"
                app:layout_constraintTop_toBottomOf="@id/banner_pp_container" />

            <com.google.android.material.divider.MaterialDivider
                android:id="@+id/header_bottom_divider"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="6dp"
                app:layout_constraintTop_toBottomOf="@id/header_select" />

            <RelativeLayout
                android:id="@+id/account_pp_container"
                android:layout_width="0dp"
                android:layout_height="0dp"
                app:layout_constraintDimensionRatio="1:1"
                app:layout_constraintEnd_toEndOf="@id/banner_pp_container"
                app:layout_constraintHorizontal_bias="0"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/header_bottom_divider"
                app:layout_constraintWidth_percent="0.4">

                <com.google.android.material.imageview.ShapeableImageView
                    android:id="@+id/account_pp"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginStart="12dp"
                    android:layout_marginTop="12dp"
                    android:contentDescription="@string/profile_picture"
                    android:padding="1dp"
                    android:scaleType="centerCrop"
                    android:transitionName="@string/activity_porfile_pp"
                    app:srcCompat="@drawable/ic_person"
                    app:strokeWidth="1dp" />

                <ProgressBar
                    android:id="@+id/avatar_progress"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:visibility="gone" />
            </RelativeLayout>


            <com.google.android.material.button.MaterialButton
                android:id="@+id/avatar_select"
                style="@style/Widget.Material3.Button.OutlinedButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="6dp"
                android:text="@string/select"
                app:icon="@drawable/ic_menu_gallery"
                app:layout_constraintBottom_toBottomOf="@id/account_pp_container"
                app:layout_constraintStart_toEndOf="@id/account_pp_container" />

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/display_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="12dp"
                android:layout_marginTop="12dp"
                android:singleLine="true"
                android:textSize="22sp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/account_pp_container"
                tools:text="@tools:sample/first_names" />

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/acct"
                style="@style/TextAppearance.AppCompat.Caption"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="12dp"
                android:singleLine="true"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/display_name"
                tools:text="\@username\@instance.test" />

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/bio"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="12dp"
                android:layout_marginTop="12dp"
                android:lines="4"
                android:textSize="18sp"
                android:scrollbars="vertical"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/acct"
                tools:text="@tools:sample/lorem/random" />

            <androidx.appcompat.widget.LinearLayoutCompat
                android:id="@+id/fields"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="12dp"
                android:layout_marginTop="12dp"
                android:orientation="vertical"
                app:layout_constraintTop_toBottomOf="@id/bio">

                <androidx.appcompat.widget.LinearLayoutCompat
                    android:id="@+id/fields_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/add_field"
                    style="@style/Widget.Material3.Button.OutlinedButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="end"
                    android:layout_marginVertical="6dp"
                    android:text="@string/add_field"
                    app:icon="@drawable/ic_baseline_add_24" />

            </androidx.appcompat.widget.LinearLayoutCompat>

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/visibility_label"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="12dp"
                android:layout_marginTop="12dp"
                android:text="@string/toots_visibility_title"
                android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                app:layout_constraintTop_toBottomOf="@id/fields" />

            <com.google.android.material.button.MaterialButtonToggleGroup
                android:id="@+id/visibility_group"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="12dp"
                android:layout_marginTop="6dp"
                android:orientation="vertical"
                app:layout_constraintTop_toBottomOf="@id/visibility_label"
                app:selectionRequired="true"
                app:singleSelection="true">

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/visibility_public"
                    style="@style/Widget.Material3.Button.OutlinedButton.Icon"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/v_public"
                    android:textAlignment="textStart"
                    app:icon="@drawable/ic_compose_visibility_public" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/visibility_unlisted"
                    style="@style/Widget.Material3.Button.OutlinedButton.Icon"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="0dp"
                    android:text="@string/v_unlisted"
                    android:textAlignment="textStart"
                    app:icon="@drawable/ic_compose_visibility_unlisted" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/visibility_private"
                    style="@style/Widget.Material3.Button.OutlinedButton.Icon"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/v_private"
                    android:textAlignment="textStart"
                    app:icon="@drawable/ic_compose_visibility_private" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/visibility_direct"
                    style="@style/Widget.Material3.Button.OutlinedButton.Icon"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/v_direct"
                    android:textAlignment="textStart"
                    app:icon="@drawable/ic_compose_visibility_direct" />

            </com.google.android.material.button.MaterialButtonToggleGroup>

            <androidx.appcompat.widget.SwitchCompat
                android:id="@+id/sensitive"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="12dp"
                android:layout_marginTop="6dp"
                android:text="@string/set_sensitive_content"
                app:layout_constraintTop_toBottomOf="@id/visibility_group" />

            <androidx.appcompat.widget.SwitchCompat
                android:id="@+id/bot"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="12dp"
                android:layout_marginTop="6dp"
                android:text="@string/set_bot_content"
                app:layout_constraintTop_toBottomOf="@id/sensitive" />

            <androidx.appcompat.widget.SwitchCompat
                android:id="@+id/discoverable"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="12dp"
                android:layout_marginTop="6dp"
                android:text="@string/set_discoverable_content"
                app:layout_constraintTop_toBottomOf="@id/bot" />

            <com.google.android.material.textview.MaterialTextView
                android:id="@+id/lock_label"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="12dp"
                android:layout_marginTop="12dp"
                android:text="@string/set_lock_account"
                android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
                app:layout_constraintTop_toBottomOf="@id/discoverable" />

            <com.google.android.material.button.MaterialButtonToggleGroup
                android:id="@+id/lock_group"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginHorizontal="12dp"
                android:layout_marginTop="6dp"
                app:layout_constraintTop_toBottomOf="@id/lock_label"
                app:selectionRequired="true"
                app:singleSelection="true">

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/unlocked"
                    style="@style/Widget.Material3.Button.OutlinedButton.Icon"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/unlocked"
                    android:textAlignment="textStart"
                    app:icon="@drawable/ic_baseline_lock_open_24" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/locked"
                    style="@style/Widget.Material3.Button.OutlinedButton.Icon"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/locked"
                    android:textAlignment="textStart"
                    app:icon="@drawable/ic_baseline_lock_24" />

            </com.google.android.material.button.MaterialButtonToggleGroup>

        </androidx.constraintlayout.widget.ConstraintLayout>

    </ScrollView>

</androidx.appcompat.widget.LinearLayoutCompat>