Newer
Older
dcms_cr_app / app / src / main / res / layout / activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/rootView"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

        <TextView
            android:id="@+id/titleView"
            android:layout_width="match_parent"
            android:layout_height="@dimen/titleViewHeight"
            android:background="@color/mainThemeColor"
            android:gravity="center"
            android:text="@string/app_name"
            android:textColor="@color/white"
            android:textSize="@dimen/sp_16" />

        <com.pengxh.androidx.lite.widget.NoScrollViewPager
            android:id="@+id/mainViewPager"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <com.google.android.material.bottomnavigation.BottomNavigationView
            android:id="@+id/bottomNavigation"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?android:attr/windowBackground"
            app:itemIconTint="@drawable/bottom_text_color"
            app:itemTextColor="@drawable/bottom_text_color"
            app:labelVisibilityMode="labeled"
            app:menu="@menu/bottom_nav_menu" />
    </LinearLayout>

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

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/itemLayoutHeight"
            android:layout_alignParentBottom="true"
            android:orientation="horizontal">

            <!--占位-->
            <View
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1" />

            <!--占位-->
            <View
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1" />

            <TextView
                android:id="@+id/messageNumView"
                android:layout_width="20dp"
                android:layout_height="20dp"
                android:background="@drawable/bg_text_tag"
                android:gravity="center"
                android:text="1"
                android:textColor="@color/white"
                android:visibility="gone" />

            <!--占位-->
            <View
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1" />
        </LinearLayout>
    </RelativeLayout>
</FrameLayout>