activity_main.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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. xmlns:tools="http://schemas.android.com/tools"
  5. android:layout_width="match_parent"
  6. android:layout_height="match_parent"
  7. tools:context=".ui.main.MainActivity">
  8. <androidx.viewpager2.widget.ViewPager2
  9. android:id="@+id/view_pager"
  10. android:layout_width="match_parent"
  11. android:layout_height="0dp"
  12. app:layout_constraintBottom_toTopOf="@+id/cs_bottom"
  13. app:layout_constraintTop_toTopOf="parent" />
  14. <com.google.android.material.bottomnavigation.BottomNavigationView
  15. android:id="@+id/navigation"
  16. android:layout_width="match_parent"
  17. android:layout_height="wrap_content"
  18. android:background="@color/white"
  19. android:visibility="invisible"
  20. app:itemBackground="@null"
  21. app:itemIconSize="24dp"
  22. app:itemTextAppearanceActive="@style/bottom_tab_title_active"
  23. app:itemTextAppearanceInactive="@style/bottom_tab_title_inactive"
  24. app:labelVisibilityMode="labeled"
  25. app:layout_constraintBottom_toBottomOf="parent"
  26. app:layout_constraintTop_toBottomOf="@+id/view_pager"
  27. app:menu="@menu/bottom_nav_item"
  28. tools:ignore="MissingConstraints"
  29. tools:visibility="gone" />
  30. <androidx.constraintlayout.widget.ConstraintLayout
  31. android:id="@+id/cs_bottom"
  32. android:layout_width="match_parent"
  33. android:layout_height="wrap_content"
  34. android:background="@color/white"
  35. android:elevation="5dp"
  36. android:orientation="vertical"
  37. android:paddingBottom="10dp"
  38. app:layout_constraintBottom_toBottomOf="parent">
  39. <com.cooleshow.base.widgets.TabAnimationView
  40. android:layout_marginTop="10dp"
  41. android:id="@+id/tab_home"
  42. android:layout_width="24dp"
  43. android:layout_height="24dp"
  44. android:layout_marginStart="27dp"
  45. app:layout_constraintHorizontal_chainStyle="spread_inside"
  46. app:layout_constraintLeft_toLeftOf="parent"
  47. app:layout_constraintRight_toLeftOf="@+id/tab_course"
  48. app:layout_constraintTop_toTopOf="parent"
  49. app:lottie_autoPlay="false"
  50. app:lottie_loop="false"
  51. app:lottie_rawRes="@raw/shouye" />
  52. <com.cooleshow.base.widgets.TabAnimationView
  53. android:id="@+id/tab_course"
  54. android:layout_width="24dp"
  55. android:layout_height="24dp"
  56. app:layout_constraintLeft_toRightOf="@+id/tab_home"
  57. app:layout_constraintRight_toLeftOf="@+id/tab_chat"
  58. app:layout_constraintTop_toTopOf="@+id/tab_home"
  59. app:lottie_autoPlay="false"
  60. app:lottie_loop="false"
  61. app:lottie_rawRes="@raw/kebiao" />
  62. <com.cooleshow.base.widgets.TabAnimationView
  63. android:id="@+id/tab_chat"
  64. android:layout_width="24dp"
  65. android:layout_height="24dp"
  66. app:layout_constraintLeft_toRightOf="@+id/tab_course"
  67. app:layout_constraintRight_toLeftOf="@+id/tab_mall"
  68. app:layout_constraintTop_toTopOf="@+id/tab_home"
  69. app:lottie_autoPlay="false"
  70. app:lottie_loop="false"
  71. app:lottie_rawRes="@raw/liaotian" />
  72. <com.cooleshow.base.widgets.UnreadCountTextView
  73. app:layout_constraintCircleAngle="45"
  74. app:layout_constraintCircleRadius="12dp"
  75. app:layout_constraintCircle="@+id/tab_chat"
  76. android:includeFontPadding="false"
  77. android:id="@+id/tv_msg_count"
  78. android:layout_width="wrap_content"
  79. android:layout_height="wrap_content"
  80. android:layout_gravity="center"
  81. android:gravity="center"
  82. android:paddingStart="@dimen/dp_4"
  83. android:paddingEnd="@dimen/dp_4"
  84. android:text=""
  85. android:textColor="@color/white"
  86. android:textSize="@dimen/sp_12"
  87. android:visibility="gone"
  88. />
  89. <com.cooleshow.base.widgets.TabAnimationView
  90. android:id="@+id/tab_mall"
  91. android:layout_width="24dp"
  92. android:layout_height="24dp"
  93. app:layout_constraintLeft_toRightOf="@+id/tab_chat"
  94. app:layout_constraintRight_toLeftOf="@+id/tab_mine"
  95. app:layout_constraintTop_toTopOf="@+id/tab_home"
  96. app:lottie_autoPlay="false"
  97. app:lottie_loop="false"
  98. app:lottie_rawRes="@raw/shangcheng" />
  99. <com.cooleshow.base.widgets.TabAnimationView
  100. android:id="@+id/tab_mine"
  101. android:layout_width="24dp"
  102. android:layout_height="24dp"
  103. android:layout_marginEnd="27dp"
  104. app:layout_constraintLeft_toRightOf="@+id/tab_mall"
  105. app:layout_constraintRight_toRightOf="parent"
  106. app:layout_constraintTop_toTopOf="@+id/tab_home"
  107. app:lottie_autoPlay="false"
  108. app:lottie_loop="false"
  109. app:lottie_rawRes="@raw/wode" />
  110. <TextView
  111. android:id="@+id/tv_home"
  112. android:layout_width="0dp"
  113. android:layout_height="wrap_content"
  114. android:gravity="center"
  115. android:includeFontPadding="false"
  116. android:paddingTop="4dp"
  117. android:text="首页"
  118. android:textColor="@color/color_999999"
  119. android:textSize="@dimen/sp_10"
  120. app:layout_constraintBottom_toBottomOf="parent"
  121. app:layout_constraintLeft_toLeftOf="@+id/tab_home"
  122. app:layout_constraintRight_toRightOf="@+id/tab_home"
  123. app:layout_constraintTop_toBottomOf="@+id/tab_home" />
  124. <TextView
  125. android:id="@+id/tv_course"
  126. android:layout_width="0dp"
  127. android:layout_height="wrap_content"
  128. android:gravity="center"
  129. android:includeFontPadding="false"
  130. android:text="课表"
  131. android:textColor="@color/color_999999"
  132. android:textSize="@dimen/sp_10"
  133. app:layout_constraintBottom_toBottomOf="@+id/tv_home"
  134. app:layout_constraintLeft_toLeftOf="@+id/tab_course"
  135. app:layout_constraintRight_toRightOf="@+id/tab_course"
  136. app:layout_constraintTop_toTopOf="@+id/tv_home" />
  137. <TextView
  138. android:id="@+id/tv_chat"
  139. android:layout_width="0dp"
  140. android:layout_height="wrap_content"
  141. android:gravity="center"
  142. android:includeFontPadding="false"
  143. android:text="聊天"
  144. android:textColor="@color/color_999999"
  145. android:textSize="@dimen/sp_10"
  146. app:layout_constraintBottom_toBottomOf="@+id/tv_home"
  147. app:layout_constraintLeft_toLeftOf="@+id/tab_chat"
  148. app:layout_constraintRight_toRightOf="@+id/tab_chat"
  149. app:layout_constraintTop_toTopOf="@+id/tv_home" />
  150. <TextView
  151. android:id="@+id/tv_mall"
  152. android:layout_width="0dp"
  153. android:layout_height="wrap_content"
  154. android:gravity="center"
  155. android:includeFontPadding="false"
  156. android:text="商城"
  157. android:textColor="@color/color_999999"
  158. android:textSize="@dimen/sp_10"
  159. app:layout_constraintBottom_toBottomOf="@+id/tv_home"
  160. app:layout_constraintLeft_toLeftOf="@+id/tab_mall"
  161. app:layout_constraintRight_toRightOf="@+id/tab_mall"
  162. app:layout_constraintTop_toTopOf="@+id/tv_home" />
  163. <TextView
  164. android:id="@+id/tv_mine"
  165. android:layout_width="0dp"
  166. android:layout_height="wrap_content"
  167. android:gravity="center"
  168. android:includeFontPadding="false"
  169. android:text="我的"
  170. android:textColor="@color/color_999999"
  171. android:textSize="@dimen/sp_10"
  172. app:layout_constraintBottom_toBottomOf="@+id/tv_home"
  173. app:layout_constraintLeft_toLeftOf="@+id/tab_mine"
  174. app:layout_constraintRight_toRightOf="@+id/tab_mine"
  175. app:layout_constraintTop_toTopOf="@+id/tv_home" />
  176. <View
  177. android:onClick="onTabClick"
  178. android:id="@+id/view_home"
  179. android:layout_width="0dp"
  180. android:layout_height="0dp"
  181. app:layout_constraintBottom_toBottomOf="parent"
  182. app:layout_constraintLeft_toLeftOf="parent"
  183. app:layout_constraintRight_toLeftOf="@+id/view_course"
  184. app:layout_constraintTop_toTopOf="parent" />
  185. <View
  186. android:onClick="onTabClick"
  187. android:id="@+id/view_course"
  188. android:layout_width="0dp"
  189. android:layout_height="0dp"
  190. app:layout_constraintBottom_toBottomOf="parent"
  191. app:layout_constraintLeft_toRightOf="@+id/view_home"
  192. app:layout_constraintRight_toLeftOf="@+id/view_chat"
  193. app:layout_constraintTop_toTopOf="parent" />
  194. <View
  195. android:onClick="onTabClick"
  196. android:id="@+id/view_chat"
  197. android:layout_width="0dp"
  198. android:layout_height="0dp"
  199. app:layout_constraintBottom_toBottomOf="parent"
  200. app:layout_constraintLeft_toRightOf="@+id/view_course"
  201. app:layout_constraintRight_toLeftOf="@+id/view_mall"
  202. app:layout_constraintTop_toTopOf="parent" />
  203. <View
  204. android:onClick="onTabClick"
  205. android:id="@+id/view_mall"
  206. android:layout_width="0dp"
  207. android:layout_height="0dp"
  208. app:layout_constraintBottom_toBottomOf="parent"
  209. app:layout_constraintLeft_toRightOf="@+id/view_chat"
  210. app:layout_constraintRight_toLeftOf="@+id/view_mine"
  211. app:layout_constraintTop_toTopOf="parent" />
  212. <View
  213. android:onClick="onTabClick"
  214. android:id="@+id/view_mine"
  215. android:layout_width="0dp"
  216. android:layout_height="0dp"
  217. app:layout_constraintBottom_toBottomOf="parent"
  218. app:layout_constraintLeft_toRightOf="@+id/view_mall"
  219. app:layout_constraintRight_toRightOf="parent"
  220. app:layout_constraintTop_toTopOf="parent" />
  221. </androidx.constraintlayout.widget.ConstraintLayout>
  222. </androidx.constraintlayout.widget.ConstraintLayout>