<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".ui.activities.PrefsActivity"
        android:orientation="vertical"
        android:background="?attr/colorContentBackground">

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

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="?attr/actionBarSize"
                android:background="?attr/colorContentBackground"
                app:layout_scrollFlags="scroll|enterAlways"
                style="@style/Toolbar.Modern"
                app:popupTheme="@style/Theme.AppCompat.DayNight">
                <RelativeLayout
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_marginEnd="16dp">

                    <TextView
                        android:id="@+id/toolbar_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:ellipsize="end"
                        android:maxLines="1"
                        android:singleLine="true"
                        android:layout_toStartOf="@id/toolbar_accessory_container"
                        android:layout_alignParentStart="true"
                        style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
                        tools:text="Habitica"/>

                    <FrameLayout
                        android:id="@+id/toolbar_accessory_container"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:scaleType="centerCrop"
                        android:adjustViewBounds="true"
                        android:layout_centerVertical="true"
                        android:layout_alignParentEnd="true"/>

                </RelativeLayout>
            </androidx.appcompat.widget.Toolbar>

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

        <com.google.android.material.tabs.TabLayout
            android:id="@+id/tab_layout"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:layout_gravity="bottom"
            android:background="?headerOffsetColor"
            android:elevation="0dp"
            android:fillViewport="false"

            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            app:layout_anchor="@+id/collapsing_toolbar"
            app:layout_anchorGravity="bottom"

            app:layout_collapseMode="pin"
            app:tabGravity="fill"
            app:tabIndicatorColor="?colorPrimary"
            app:tabMode="fixed" />

        <androidx.viewpager2.widget.ViewPager2
            android:id="@+id/viewPager"
            android:layout_width="match_parent"
            android:layout_height="0px"
            android:layout_weight="1"
            android:background="?attr/colorContentBackground" />
    </LinearLayout>
</FrameLayout>
