wanjingy.github.io / hw9 / EventFinder / app / src / main / res / layout / activity_main.xml
activity_main.xml
Raw
<?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=".MainActivity"
    android:id="@+id/rootView">


    <com.google.android.material.tabs.TabLayout
        android:id="@+id/mainTab"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabBackground="@color/black"
        app:tabTextColor="@color/white"
        app:tabSelectedTextColor="@color/green"
        app:tabIndicatorColor="@color/green"
        >

        <com.google.android.material.tabs.TabItem
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="SEARCH" />

        <com.google.android.material.tabs.TabItem
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="FAVORITES" />

    </com.google.android.material.tabs.TabLayout>

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

</RelativeLayout>