学考乐离线App
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main_item_coursepack.xml 6.3KB

2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <layout 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. <data>
  6. <variable
  7. name="coursePack"
  8. type="com.xkl.cdl.data.bean.course.CoursePack" />
  9. </data>
  10. <androidx.cardview.widget.CardView
  11. android:layout_width="match_parent"
  12. android:layout_height="100dp"
  13. android:layout_marginStart="16dp"
  14. android:layout_marginEnd="16dp"
  15. app:cardBackgroundColor="@color/white"
  16. app:cardCornerRadius="8dp"
  17. app:cardElevation="0dp">
  18. <androidx.constraintlayout.widget.ConstraintLayout
  19. android:layout_width="match_parent"
  20. android:layout_height="match_parent">
  21. <!--https://juejin.cn/post/6971647089503633438 玩转ShapeableImageView -->
  22. <com.google.android.material.imageview.ShapeableImageView
  23. android:id="@+id/img_cover"
  24. android:layout_width="75dp"
  25. android:layout_height="match_parent"
  26. android:scaleType="fitXY"
  27. app:imageByteArray="@{coursePack.cover}"
  28. app:layout_constraintBottom_toBottomOf="parent"
  29. app:layout_constraintStart_toStartOf="parent"
  30. app:layout_constraintTop_toTopOf="parent"
  31. app:shapeAppearance="@style/roundedCornerStyle"
  32. tools:src="@mipmap/img_default" />
  33. <com.google.android.material.textview.MaterialTextView
  34. android:id="@+id/textview_coursePack"
  35. android:layout_width="0dp"
  36. android:layout_height="wrap_content"
  37. android:layout_marginStart="12dp"
  38. android:layout_marginTop="4dp"
  39. android:layout_marginEnd="10dp"
  40. android:ellipsize="end"
  41. android:maxLines="2"
  42. android:minHeight="48dp"
  43. android:text="@{coursePack.coursePackName}"
  44. android:textColor="@color/main_text_color"
  45. android:textSize="@dimen/normalSize"
  46. app:layout_constraintEnd_toStartOf="@+id/my_ranking_view"
  47. app:layout_constraintStart_toEndOf="@+id/img_cover"
  48. app:layout_constraintTop_toTopOf="parent"
  49. tools:text="人教版·小学三年级" />
  50. <com.google.android.material.imageview.ShapeableImageView
  51. android:id="@+id/image_view_type_discern"
  52. android:layout_width="24dp"
  53. android:layout_height="24dp"
  54. android:layout_marginTop="8dp"
  55. android:layout_marginEnd="8dp"
  56. android:padding="3dp"
  57. android:src="@drawable/ic_course_discern"
  58. android:visibility="gone"
  59. app:layout_constraintEnd_toStartOf="@+id/image_view_type_spell"
  60. app:layout_constraintHorizontal_bias="0"
  61. app:layout_constraintHorizontal_chainStyle="packed"
  62. app:layout_constraintStart_toStartOf="@+id/textview_coursePack"
  63. app:layout_constraintTop_toBottomOf="@+id/textview_coursePack"
  64. app:shapeAppearance="@style/roundedCornerStyle"
  65. app:strokeColor="#1A5082E6"
  66. app:strokeWidth="5dp"
  67. tools:visibility="visible" />
  68. <com.google.android.material.imageview.ShapeableImageView
  69. android:id="@+id/image_view_type_spell"
  70. android:layout_width="24dp"
  71. android:layout_height="24dp"
  72. android:layout_marginTop="8dp"
  73. android:layout_marginEnd="8dp"
  74. android:padding="3dp"
  75. android:src="@drawable/ic_course_spell"
  76. android:visibility="gone"
  77. app:layout_constraintEnd_toStartOf="@+id/image_view_type_voice"
  78. app:layout_constraintStart_toEndOf="@+id/image_view_type_discern"
  79. app:layout_constraintTop_toBottomOf="@+id/textview_coursePack"
  80. app:shapeAppearance="@style/roundedCornerStyle"
  81. app:strokeColor="#1AF26255"
  82. app:strokeWidth="5dp"
  83. tools:visibility="visible" />
  84. <com.google.android.material.imageview.ShapeableImageView
  85. android:id="@+id/image_view_type_voice"
  86. android:layout_width="24dp"
  87. android:layout_height="24dp"
  88. android:layout_marginTop="8dp"
  89. android:layout_marginEnd="8dp"
  90. android:padding="3dp"
  91. android:src="@drawable/ic_course_voice"
  92. android:visibility="gone"
  93. app:layout_constraintEnd_toEndOf="parent"
  94. app:layout_constraintStart_toEndOf="@+id/image_view_type_spell"
  95. app:layout_constraintTop_toBottomOf="@+id/textview_coursePack"
  96. app:shapeAppearance="@style/roundedCornerStyle"
  97. app:strokeColor="#1A52CC52"
  98. app:strokeWidth="8dp"
  99. tools:visibility="visible" />
  100. <!--进度-->
  101. <com.xkl.cdl.widget.MyRankingView
  102. android:id="@+id/my_ranking_view"
  103. android:layout_width="50dp"
  104. android:layout_height="50dp"
  105. app:layout_constraintTop_toTopOf="parent"
  106. app:layout_constraintBottom_toBottomOf="parent"
  107. app:layout_constraintEnd_toEndOf="parent"
  108. android:layout_marginEnd="16dp"
  109. app:normalColor="@color/gray_1"
  110. app:progressColor="@color/blue_1"
  111. app:borderWidth="3dp"
  112. app:progressNumber="@{(int)coursePack.learnProgress}"
  113. >
  114. <TextView
  115. android:id="@+id/tv_learning_percent"
  116. android:layout_width="match_parent"
  117. android:layout_height="match_parent"
  118. android:gravity="center"
  119. android:textColor="@color/gray_2"
  120. android:textSize="@dimen/smallerSize"
  121. app:coursePackLearnProgressFormat="@{coursePack.learnProgress}"/>
  122. </com.xkl.cdl.widget.MyRankingView>
  123. </androidx.constraintlayout.widget.ConstraintLayout>
  124. </androidx.cardview.widget.CardView>
  125. </layout>