<?xml version="1.0" encoding="utf-8"?>
<me.grishka.appkit.views.RecursiveSwipeRefreshLayout 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/refresh_layout"
	android:layout_width="match_parent"
	android:layout_height="match_parent">

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

		<org.joinmastodon.android.ui.views.NestedRecyclerScrollView
			android:id="@+id/scroller"
			android:layout_width="match_parent"
			android:layout_height="match_parent"
			android:nestedScrollingEnabled="true">

			<org.joinmastodon.android.ui.views.CustomDrawingOrderLinearLayout
				android:id="@+id/scrollable_content"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:clipChildren="false"
				android:orientation="vertical">

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

					<org.joinmastodon.android.ui.views.CoverImageView
						android:id="@+id/cover"
						android:layout_width="match_parent"
						android:layout_height="144dp"
						android:background="?colorProfileHeaderBackground"
						android:contentDescription="@string/profile_header"
						android:scaleType="centerCrop" />

					<TextView
						android:id="@+id/follows_you"
						android:layout_width="wrap_content"
						android:layout_height="28dp"
						android:layout_alignEnd="@id/cover"
						android:layout_alignBottom="@id/cover"
						android:layout_margin="16dp"
						android:background="@drawable/bg_profile_follows_you"
						android:fontFamily="sans-serif-medium"
						android:gravity="center"
						android:paddingLeft="8dp"
						android:paddingRight="8dp"
						android:text="@string/follows_you"
						android:textAllCaps="true"
						android:textColor="#fff"
						android:textSize="14dp"
						android:visibility="gone"
						tools:visibility="visible" />

					<FrameLayout
						android:id="@+id/avatar_border"
						android:layout_width="108dp"
						android:layout_height="108dp"
						android:layout_below="@id/cover"
						android:layout_alignParentStart="true"
						android:layout_marginStart="12dp"
						android:layout_marginTop="-44dp"
						android:background="?colorM3Surface">

						<ImageView
							android:id="@+id/avatar"
							android:layout_width="100dp"
							android:layout_height="100dp"
							android:layout_gravity="center"
							android:contentDescription="@string/profile_picture"
							android:scaleType="centerCrop"
							tools:src="#0f0" />

					</FrameLayout>

					<LinearLayout
						android:id="@+id/profile_action_btn_wrap"
						android:layout_width="wrap_content"
						android:layout_height="wrap_content"
						android:layout_below="@id/cover"
						android:layout_alignParentEnd="true">

						<FrameLayout
							android:layout_width="wrap_content"
							android:layout_height="wrap_content"
							android:layout_marginTop="16dp"
							android:layout_marginEnd="4dp">

							<org.joinmastodon.android.ui.views.ProgressBarButton
								android:id="@+id/notify_btn"
								android:layout_width="48dp"
								android:layout_height="48dp"
								style="@style/Widget.Mastodon.M3.Button.Tonal"
								android:background="@drawable/bg_button_m3_tonal_circle_selector"
								android:paddingStart="12dp"
								android:drawableStart="@drawable/ic_fluent_alert_24_selector" />

							<ProgressBar
								android:id="@+id/notify_progress"
								style="?android:progressBarStyleSmall"
								android:layout_width="wrap_content"
								android:layout_height="wrap_content"
								android:layout_gravity="center"
								android:elevation="10dp"
								android:indeterminate="true"
								android:outlineProvider="none"
								android:visibility="gone" />
						</FrameLayout>

						<FrameLayout
							android:layout_width="wrap_content"
							android:layout_height="wrap_content"
							android:layout_marginTop="16dp"
							android:layout_marginStart="4dp"
							android:layout_marginEnd="16dp">

							<org.joinmastodon.android.ui.views.ProgressBarButton
								android:id="@+id/profile_action_btn"
								android:layout_width="wrap_content"
								android:layout_height="wrap_content"
								android:minHeight="48dp"
								style="@style/Widget.Mastodon.M3.Button.Filled"
								android:paddingHorizontal="16dp"
								tools:text="@string/save_changes" />

							<ProgressBar
								android:id="@+id/action_progress"
								style="?android:progressBarStyleSmall"
								android:layout_width="wrap_content"
								android:layout_height="wrap_content"
								android:layout_gravity="center"
								android:elevation="10dp"
								android:indeterminate="true"
								android:outlineProvider="none"
								android:visibility="gone" />
						</FrameLayout>
					</LinearLayout>

				</RelativeLayout>

				<org.joinmastodon.android.ui.views.AutoOrientationLinearLayout
					android:id="@+id/name_wrap"
					android:layout_width="match_parent"
					android:layout_height="wrap_content"
					android:layout_marginHorizontal="16dp"
					android:layout_marginTop="12dp">

					<TextView
						android:id="@+id/name"
						android:layout_width="wrap_content"
						android:layout_height="wrap_content"
						android:fontFamily="sans-serif"
						android:textAlignment="viewStart"
						android:textAppearance="@style/m3_title_large"
						android:textColor="?colorM3OnSurface"
						tools:text="Eugen" />

					<LinearLayout
						android:id="@+id/roles"
						android:layout_width="wrap_content"
						android:layout_height="wrap_content"
						android:layout_gravity="bottom"
						android:orientation="horizontal"
						android:visibility="gone" />

				</org.joinmastodon.android.ui.views.AutoOrientationLinearLayout>

				<LinearLayout
					android:id="@+id/username_wrap"
					android:orientation="horizontal"
					android:layout_width="wrap_content"
					android:layout_height="wrap_content"
					android:layout_marginStart="16dp"
					android:layout_marginEnd="12dp"
					android:layout_marginTop="2dp"
					android:layout_marginBottom="8dp">

					<TextView
						android:id="@+id/username"
						android:layout_width="0dp"
						android:layout_height="wrap_content"
						android:layout_weight="1"
						android:layout_marginEnd="4dp"
						android:maxLines="1"
						android:ellipsize="end"
						android:textAppearance="@style/m3_title_small"
						android:textColor="?colorM3OnSurfaceVariant"
						tools:text="\@Gargron" />

					<ImageView
						android:id="@+id/lock_icon"
						android:layout_width="18sp"
						android:layout_height="18sp"
						android:layout_marginEnd="4dp"
						android:layout_gravity="center_vertical"
						android:visibility="gone"
						android:importantForAccessibility="no"
						android:contentDescription="@string/manually_approves_followers"
						android:src="@drawable/ic_fluent_lock_closed_20_filled" />

					<ImageView
						android:id="@+id/bot_icon"
						android:layout_width="18sp"
						android:layout_height="18sp"
						android:layout_marginEnd="4dp"
						android:layout_gravity="center_vertical"
						android:visibility="gone"
						android:importantForAccessibility="no"
						android:contentDescription="@string/sk_icon_bot"
						android:src="@drawable/ic_fluent_bot_20_filled" />

				</LinearLayout>

				<org.joinmastodon.android.ui.views.LinkedTextView
					android:id="@+id/bio"
					android:layout_width="match_parent"
					android:layout_height="wrap_content"
					android:layout_marginLeft="16dp"
					android:layout_marginRight="16dp"
					android:textAppearance="@style/m3_body_medium"
					android:textColor="?colorM3OnSurface"
					android:textSize="16sp"
					tools:text="Founder, CEO and lead developer @Mastodon, Germany." />

				<org.joinmastodon.android.ui.views.FloatingHintEditTextLayout
					android:id="@+id/name_edit_wrap"
					android:layout_width="match_parent"
					android:layout_height="80dp"
					android:foreground="@drawable/bg_m3_outlined_text_field"
					android:paddingTop="4dp"
					android:visibility="gone"
					app:labelTextColor="@color/m3_outlined_text_field_label">

					<EditText
						android:id="@+id/name_edit"
						android:layout_width="match_parent"
						android:layout_height="56dp"
						android:layout_marginStart="16dp"
						android:layout_marginTop="8dp"
						android:layout_marginEnd="16dp"
						android:background="@null"
						android:elevation="0dp"
						android:hint="@string/display_name"
						android:inputType="textPersonName|textCapWords"
						android:padding="16dp"
						tools:text="Eugen" />
				</org.joinmastodon.android.ui.views.FloatingHintEditTextLayout>

				<org.joinmastodon.android.ui.views.FloatingHintEditTextLayout
					android:id="@+id/bio_edit_wrap"
					android:layout_width="match_parent"
					android:layout_height="wrap_content"
					android:layout_marginTop="-8dp"
					android:layout_marginBottom="-4dp"
					android:paddingBottom="12dp"
					android:foreground="@drawable/bg_m3_outlined_text_field"
					android:paddingTop="4dp"
					android:visibility="gone"
					app:labelTextColor="@color/m3_outlined_text_field_label">

					<EditText
						android:id="@+id/bio_edit"
						android:layout_width="match_parent"
						android:layout_height="wrap_content"
						android:layout_marginStart="16dp"
						android:layout_marginTop="8dp"
						android:layout_marginEnd="16dp"
						android:background="@null"
						android:elevation="0dp"
						android:hint="@string/profile_bio"
						android:inputType="textMultiLine|textCapSentences"
						android:padding="16dp"
						tools:text="Founder, CEO and lead developer @Mastodon, Germany." />
				</org.joinmastodon.android.ui.views.FloatingHintEditTextLayout>

				<View
					android:layout_width="match_parent"
					android:layout_height="1dp"
					android:layout_marginTop="16dp"
					android:background="?colorM3SurfaceVariant"/>

				<me.grishka.appkit.views.UsableRecyclerView
					android:id="@+id/metadata"
					android:layout_width="match_parent"
					android:layout_height="wrap_content"
					android:paddingTop="4dp" />

				<LinearLayout
					android:id="@+id/profile_counters"
					android:layout_width="match_parent"
					android:layout_height="wrap_content"
					android:layout_marginHorizontal="4dp">

					<LinearLayout
						style="@style/Widget.Mastodon.M3.Button.Text"
						android:id="@+id/followers_btn"
						android:layout_width="wrap_content"
						android:layout_height="wrap_content"
						android:minHeight="48dp"
						android:gravity="center_horizontal"
						android:orientation="horizontal"
						android:paddingStart="12dp"
						android:paddingEnd="12dp">

						<TextView
							android:id="@+id/followers_count"
							android:layout_width="wrap_content"
							android:layout_height="match_parent"
							android:layout_marginEnd="4dp"
							android:ellipsize="end"
							android:textAppearance="@style/m3_label_large"
							android:fontFamily="sans-serif-black"
							android:gravity="center_vertical"
							android:singleLine="true"
							android:textColor="?colorM3OnSurfaceVariant"
							tools:text="123" />

						<TextView
							android:id="@+id/followers_label"
							android:layout_width="wrap_content"
							android:layout_height="match_parent"
							android:ellipsize="middle"
							android:gravity="center_vertical"
							android:singleLine="true"
							android:textAppearance="@style/m3_label_large"
							android:textColor="?colorM3OnSurfaceVariant"
							tools:text="followers" />
					</LinearLayout>

					<TextView
						android:id="@+id/profile_counters_separator"
						android:layout_width="wrap_content"
						android:layout_height="48dp"
						android:layout_marginHorizontal="-4dp"
						android:gravity="center"
						android:text="@string/sk_separator"
						android:textAppearance="@style/m3_label_large"
						android:fontFamily="sans-serif-black"
						android:textColor="?colorM3OnSurfaceVariant" />

					<LinearLayout
						style="@style/Widget.Mastodon.M3.Button.Text"
						android:id="@+id/following_btn"
						android:layout_width="wrap_content"
						android:layout_height="wrap_content"
						android:minHeight="48dp"
						android:gravity="center_horizontal"
						android:orientation="horizontal"
						android:paddingStart="12dp"
						android:paddingEnd="12dp">

						<TextView
							android:id="@+id/following_count"
							android:layout_width="wrap_content"
							android:layout_height="match_parent"
							android:layout_marginEnd="4dp"
							android:ellipsize="end"
							android:textAppearance="@style/m3_label_large"
							android:fontFamily="sans-serif-black"
							android:gravity="center_vertical"
							android:singleLine="true"
							android:textColor="?colorM3OnSurfaceVariant"
							tools:text="123" />

						<TextView
							android:id="@+id/following_label"
							android:layout_width="wrap_content"
							android:layout_height="match_parent"
							android:ellipsize="middle"
							android:gravity="center_vertical"
							android:singleLine="true"
							android:textAppearance="@style/m3_label_large"
							android:textColor="?colorM3OnSurfaceVariant"
							tools:text="following" />
					</LinearLayout>
				</LinearLayout>

				<org.joinmastodon.android.ui.tabs.TabLayout
					android:id="@+id/tabbar"
					android:layout_width="match_parent"
					android:layout_height="48dp"
					android:background="@drawable/bg_onboarding_panel"
					android:clipToPadding="false"
					android:paddingHorizontal="4dp"
					app:tabGravity="start"
					app:tabIndicator="@drawable/tab_indicator_m3"
					app:tabIndicatorAnimationMode="elastic"
					app:tabIndicatorColor="?colorM3Primary"
					app:tabIndicatorFullWidth="false"
					app:tabMinWidth="0dp"
					app:tabMode="scrollable" />

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

					<androidx.viewpager2.widget.ViewPager2
						android:id="@+id/pager"
						android:layout_width="match_parent"
						android:layout_height="match_parent" />

					<View
						android:id="@+id/tabs_divider"
						android:layout_width="match_parent"
						android:layout_height="1dp"
						android:background="?colorM3SurfaceVariant"/>

				</FrameLayout>
			</org.joinmastodon.android.ui.views.CustomDrawingOrderLinearLayout>
		</org.joinmastodon.android.ui.views.NestedRecyclerScrollView>

		<include layout="@layout/compose_fab" />

	</FrameLayout>

</me.grishka.appkit.views.RecursiveSwipeRefreshLayout>