<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    tools:context=".activityandview.MainActivity">

    <androidx.drawerlayout.widget.DrawerLayout
        android:id="@+id/drawer_parent"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <!--主视图-->
        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/backgroundLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <!--tab-->
            <com.google.android.material.tabs.TabLayout
                android:id="@+id/tabLayout"
                android:layout_width="wrap_content"
                android:layout_height="52dp"
                android:layout_marginTop="8dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:tabIndicatorColor="@color/theme_color"
                app:tabIndicatorFullWidth="false"
                app:tabMode="scrollable" />

            <!--内容-->
            <androidx.viewpager.widget.ViewPager
                android:id="@+id/viewpager"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_marginTop="8dp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintTop_toBottomOf="@id/tabLayout" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <!--抽屉视图-->
        <RelativeLayout
            android:id="@+id/drawer_recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginEnd="-65dp"
            android:layout_gravity="end"
            android:background="@color/white">

            <ImageView
                android:id="@+id/drawer_back"
                android:layout_width="33dp"
                android:layout_height="33dp"
                android:layout_marginStart="8dp"
                android:layout_marginTop="10dp"
                android:padding="5dp"
                android:src="@drawable/svg_return"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <!--抽屉头部-->
            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/topPanel"
                android:layout_width="match_parent"
                android:layout_height="160dp"
                android:paddingBottom="14dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <!--appLog-->
                <androidx.cardview.widget.CardView
                    android:id="@+id/imageLogo"
                    android:layout_width="54dp"
                    android:layout_height="54dp"
                    android:layout_marginTop="40dp"
                    app:cardCornerRadius="12dp"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="parent">

                    <ImageView
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:src="@mipmap/png_logo_icon" />
                </androidx.cardview.widget.CardView>

                <!--AppName-->
                <TextView
                    android:id="@+id/text_app_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:text="@string/app_name"
                    android:textColor="@color/black"
                    android:textSize="18sp"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/imageLogo" />

                <!--Version-->
                <TextView
                    android:id="@+id/text_app_version"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:text="@string/app_name"
                    android:textColor="@color/black"
                    android:textSize="12sp"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintLeft_toLeftOf="@id/text_app_name"
                    app:layout_constraintRight_toRightOf="@id/text_app_name"
                    app:layout_constraintTop_toBottomOf="@id/text_app_name" />
            </androidx.constraintlayout.widget.ConstraintLayout>


            <LinearLayout
                android:id="@+id/layoutRate"
                android:layout_width="match_parent"
                android:layout_height="44dp"
                android:layout_below="@id/topPanel"
                android:layout_marginTop="20dp"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <ImageView
                    android:id="@+id/im_rate"
                    android:layout_width="27dp"
                    android:layout_height="27dp"
                    android:layout_marginStart="25dp"
                    android:src="@drawable/svg_google_play" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="20dp"
                    android:gravity="center"
                    android:text="@string/main_menu_rate"
                    android:textColor="@color/black"
                    android:textSize="15sp" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/layoutShare"
                android:layout_width="match_parent"
                android:layout_height="44dp"
                android:layout_below="@id/layoutRate"
                android:layout_marginTop="16dp"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <ImageView
                    android:id="@+id/im_share"
                    android:layout_width="27dp"
                    android:layout_height="27dp"
                    android:layout_marginStart="25dp"
                    android:src="@drawable/svg_share" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="20dp"
                    android:gravity="center"
                    android:text="@string/main_menu_share"
                    android:textColor="@color/black"
                    android:textSize="15sp" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/layoutSet"
                android:layout_width="match_parent"
                android:layout_height="44dp"
                android:layout_below="@id/layoutShare"
                android:layout_marginTop="16dp"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <ImageView
                    android:id="@+id/im_set"
                    android:layout_width="27dp"
                    android:layout_height="27dp"
                    android:layout_marginStart="25dp"
                    android:src="@drawable/svg_set" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="20dp"
                    android:gravity="center"
                    android:text="@string/main_menu_set"
                    android:textColor="@color/black"
                    android:textSize="15sp" />
            </LinearLayout>
        </RelativeLayout>

    </androidx.drawerlayout.widget.DrawerLayout>


    <!--    MaterialButtonToggleGroup实现的LinearLayout接口-->
    <com.google.android.material.button.MaterialButtonToggleGroup
        android:id="@+id/toggle_group"
        android:layout_width="180dp"
        android:layout_height="52dp"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginStart="32dp"
        android:layout_marginEnd="32dp"
        android:layout_marginBottom="32dp"
        android:gravity="center"
        app:checkedButton="@+id/bt1"
        app:selectionRequired="true"
        app:singleSelection="true">

        <!--        android:layout_weight="1"设置权重,宽度自定义-->
        <com.google.android.material.button.MaterialButton
            android:id="@+id/bt1"
            android:layout_width="0dp"
            android:layout_height="60dp"
            android:layout_weight="1"
            android:backgroundTint="@color/theme_color"
            android:text="@string/but_home"
            android:textColor="@color/white"
            android:textSize="10dp"
            app:cornerRadius="26dp"
            app:icon="@drawable/svg_home"
            app:iconGravity="textTop" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/bt2"
            android:layout_width="0dp"
            android:layout_height="60dp"
            android:layout_weight="1"
            android:backgroundTint="@color/theme_color"
            android:text="@string/but_info"
            android:textColor="@color/white"
            android:textSize="10dp"
            app:cornerRadius="26dp"
            app:icon="@drawable/svg_menu_main"
            app:iconGravity="textTop" />

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



