<?xml version="1.0" encoding="utf-8"?>
<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:id="@+id/cl"
    android:background="@color/background_white"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

        <ImageView
            android:id="@+id/background"
            android:layout_width="match_parent"
            android:layout_height="400dp"
            android:background="@drawable/bg_energy_house"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintLeft_toLeftOf="parent" />

        <com.gh.gamecenter.common.view.StatusBarView
            android:id="@+id/statusBarView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintLeft_toLeftOf="parent" />

        <com.gh.gamecenter.common.view.AvatarBorderView
            android:id="@+id/userIcon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="56dp"
            android:layout_marginLeft="4dp"
            app:avatar_width="64dp"
            app:badge_width="18dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/statusBarView"
            tools:layout_width="96dp"
            tools:layout_height="96dp" />

        <TextView
            android:id="@+id/loginTipTv"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="92dp"
            android:textColor="@color/white"
            android:textStyle="bold"
            android:textSize="14sp"
            android:text="@string/energy_house_login_tip"
            app:layout_constraintTop_toTopOf="@+id/userIcon"
            app:layout_constraintBottom_toBottomOf="@+id/userIcon"
            app:layout_constraintLeft_toLeftOf="parent" />

        <RelativeLayout
            android:visibility="gone"
            android:id="@+id/userEnergyContainer"
            android:layout_width="73dp"
            android:layout_height="22dp"
            android:layout_marginTop="13dp"
            android:layout_marginLeft="92dp"
            android:gravity="center_vertical"
            app:layout_constraintTop_toTopOf="@+id/userIcon"
            app:layout_constraintBottom_toBottomOf="@+id/userIcon"
            app:layout_constraintLeft_toLeftOf="parent">

            <TextView
                android:id="@+id/userEnergy"
                android:layout_width="72dp"
                android:layout_height="20dp"
                android:layout_marginLeft="1dp"
                android:gravity="center"
                android:layout_centerVertical="true"
                android:background="@drawable/bg_energy_value"
                android:textColor="@color/white"
                android:textSize="14sp"
                android:text="1520" />

            <ImageView
                android:layout_width="8dp"
                android:layout_height="12dp"
                android:layout_marginRight="9dp"
                android:layout_centerVertical="true"
                android:layout_alignParentRight="true"
                android:src="@drawable/ic_energy_more" />

            <ImageView
                android:layout_width="22dp"
                android:layout_height="22dp"
                android:src="@drawable/ic_energy_center_top_energy" />
        </RelativeLayout>

        <ImageView
            android:id="@+id/earnEnergy"
            android:layout_width="58dp"
            android:layout_height="20dp"
            android:layout_marginRight="16dp"
            android:src="@drawable/pic_earn_energy"
            app:layout_constraintTop_toTopOf="@+id/userIcon"
            app:layout_constraintBottom_toBottomOf="@+id/userIcon"
            app:layout_constraintRight_toRightOf="parent" />

        <LinearLayout
            android:id="@+id/rollNotice"
            tools:visibility="visible"
            android:visibility="gone"
            android:layout_width="264dp"
            android:layout_height="30dp"
            android:layout_marginTop="8dp"
            android:layout_marginLeft="16dp"
            android:paddingLeft="12dp"
            android:paddingRight="12dp"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:background="@drawable/bg_energy_house_roll_notice"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/userIcon">

            <ImageView
                android:layout_width="12dp"
                android:layout_height="12dp"
                android:src="@drawable/ic_energy_house_notice" />

            <com.gh.gamecenter.common.view.MarqueeView
                android:id="@+id/rollNoticeMV"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_marginLeft="8dp"
                app:mvAnimDuration="1000"
                app:mvInterval="3000"
                app:mvSingleLine="true"
                app:mvTextColor="@color/text_title"
                app:mvTextSize="11sp" />
        </LinearLayout>

        <ImageView
            android:id="@+id/exchangeCommodity"
            android:layout_width="52dp"
            android:layout_height="52dp"
            android:layout_marginTop="28dp"
            android:layout_marginLeft="16dp"
            android:src="@drawable/ic_exchange_commodity"
            app:layout_constraintTop_toBottomOf="@+id/rollNotice"
            app:layout_constraintLeft_toLeftOf="parent" />

        <ImageView
            android:id="@+id/lotteryParadise"
            android:layout_width="52dp"
            android:layout_height="52dp"
            android:layout_marginTop="28dp"
            android:layout_marginLeft="24dp"
            android:src="@drawable/ic_lottery_paradise"
            app:layout_constraintTop_toBottomOf="@+id/rollNotice"
            app:layout_constraintLeft_toRightOf="@+id/exchangeCommodity" />
    </androidx.constraintlayout.widget.ConstraintLayout>

    <RelativeLayout
        android:id="@+id/bottomSheet"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/transparent"
        android:orientation="vertical"
        app:behavior_hideable="false"
        app:behavior_peekHeight="300dp"
        app:layout_behavior="@string/bottom_sheet_behavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <View
                android:id="@+id/collapsedBg"
                android:layout_width="match_parent"
                android:layout_height="320dp"
                android:background="@drawable/bg_house_bottom_sheet_collapses" />

            <View
                android:visibility="gone"
                android:id="@+id/expandedBg"
                android:layout_width="match_parent"
                android:layout_height="280dp"
                android:background="@drawable/bg_bottom_sheet_expanded" />

            <View
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#FF4DCCD3" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="32dp"
            android:orientation="vertical">

            <RelativeLayout
                android:id="@+id/tabContainer"
                android:layout_width="match_parent"
                android:layout_height="44dp"
                android:paddingBottom="8dp">

                <com.gh.gamecenter.common.view.TabIndicatorView
                    android:id="@+id/indicatorView"
                    android:layout_width="match_parent"
                    android:layout_height="8dp"
                    android:layout_alignParentBottom="true"
                    app:disableIndicatorScaling="true"
                    app:indicatorDrawable="@drawable/ic_energy_tab_indicator" />

                <com.google.android.material.tabs.TabLayout
                    android:id="@+id/tabLayout"
                    android:layout_width="match_parent"
                    android:layout_height="36dp"
                    app:tabMaxWidth="0dp"
                    app:tabMinWidth="0dp"
                    app:tabMode="scrollable"
                    app:tabIndicator="@null"
                    app:tabTextAppearance="@style/TabLayoutTextAppearance" />
            </RelativeLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="#CCFCFF" />

            <HorizontalScrollView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:scrollbars="none">

                <LinearLayout
                    android:id="@+id/sizeContainer"
                    android:layout_width="wrap_content"
                    android:layout_height="48dp"
                    android:paddingLeft="13dp"
                    android:orientation="horizontal"
                    android:gravity="center_vertical" />
            </HorizontalScrollView>

            <androidx.viewpager.widget.ViewPager
                android:id="@+id/viewpager"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </LinearLayout>
    </RelativeLayout>

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_collapseMode="pin"
        app:navigationIcon="@null">

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

            <com.gh.gamecenter.common.view.StatusBarView
                android:id="@+id/statusBar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <RelativeLayout
                android:layout_below="@+id/statusBar"
                android:layout_width="match_parent"
                android:layout_height="48dp">

                <ImageView
                    android:id="@+id/backIv"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:padding="12dp"
                    android:layout_centerVertical="true"
                    android:src="@drawable/ic_toolbar_back_white" />

                <TextView
                    android:id="@+id/title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:gravity="center_vertical"
                    android:drawablePadding="4dp"
                    android:textColor="@color/white"
                    android:textStyle="bold"
                    android:textSize="16sp"
                    android:text="@string/energy_house" />

                <ImageView
                    android:id="@+id/exchangeRuleTv"
                    android:layout_width="74dp"
                    android:layout_height="20dp"
                    android:layout_marginTop="13dp"
                    android:layout_marginRight="16dp"
                    android:layout_alignParentRight="true"
                    android:gravity="center_vertical"
                    android:src="@drawable/pic_exchange_rule" />
            </RelativeLayout>
        </RelativeLayout>
    </androidx.appcompat.widget.Toolbar>
</androidx.coordinatorlayout.widget.CoordinatorLayout>