activity_chapter_list.xml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. android:layout_width="match_parent"
  5. android:layout_height="match_parent">
  6. <com.google.android.material.appbar.AppBarLayout
  7. android:id="@+id/app_bar"
  8. android:layout_width="match_parent"
  9. android:layout_height="wrap_content"
  10. android:fitsSystemWindows="true"
  11. app:layout_constraintEnd_toEndOf="parent"
  12. app:layout_constraintStart_toStartOf="parent"
  13. app:layout_constraintTop_toTopOf="parent">
  14. <com.google.android.material.appbar.MaterialToolbar
  15. android:id="@+id/top_bar"
  16. android:layout_width="match_parent"
  17. android:layout_height="?attr/actionBarSize"
  18. app:layout_collapseMode="pin"
  19. app:navigationIcon="@drawable/ic_arrow_back"
  20. app:title="@string/chapter_list" />
  21. <com.google.android.material.tabs.TabLayout
  22. android:id="@+id/tab_layout"
  23. android:layout_width="match_parent"
  24. android:layout_height="wrap_content"
  25. android:layout_marginHorizontal="16dp"
  26. android:background="?attr/colorSurface"
  27. app:tabGravity="fill"
  28. app:tabMode="fixed" />
  29. </com.google.android.material.appbar.AppBarLayout>
  30. <!-- ViewPager 作为滚动内容 -->
  31. <androidx.viewpager.widget.ViewPager
  32. android:id="@+id/view_pager"
  33. android:layout_width="match_parent"
  34. android:layout_height="0dp"
  35. app:layout_behavior="@string/appbar_scrolling_view_behavior"
  36. app:layout_constraintBottom_toBottomOf="parent"
  37. app:layout_constraintTop_toBottomOf="@id/app_bar" />
  38. </androidx.constraintlayout.widget.ConstraintLayout>