item_member_goods.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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="goodsBean"
  8. type="com.datarecovery.master.data.api.bean.MemberGoodsBean" />
  9. <import type="com.atmob.common.ui.SizeUtil" />
  10. <import type="com.atmob.common.text.TextUtil" />
  11. </data>
  12. <androidx.constraintlayout.widget.ConstraintLayout
  13. android:layout_width="match_parent"
  14. android:layout_height="wrap_content"
  15. android:layout_marginBottom="5dp">
  16. <Space
  17. android:id="@+id/space1"
  18. android:layout_width="match_parent"
  19. android:layout_height="0dp"
  20. app:layout_constraintDimensionRatio="328:11"
  21. app:layout_constraintTop_toTopOf="parent" />
  22. <ImageView
  23. android:id="@+id/iv_bg"
  24. imageDraw="@{goodsBean.select ? @drawable/bg_member_goods_type_selected : @drawable/bg_member_goods_type_normal}"
  25. android:layout_width="match_parent"
  26. android:layout_height="0dp"
  27. app:layout_constraintBottom_toBottomOf="@+id/space_bottom"
  28. app:layout_constraintTop_toBottomOf="@+id/space1"
  29. tools:src="@drawable/bg_member_goods_type_selected" />
  30. <TextView
  31. android:id="@+id/tv_member_buy_price"
  32. android:layout_width="wrap_content"
  33. android:layout_height="wrap_content"
  34. android:layout_marginEnd="15dp"
  35. android:text="@{TextUtil.formatFloatWithout0End(goodsBean.RMBAmount, 2)}"
  36. android:textColor="#2C3986"
  37. android:textSize="28sp"
  38. android:textStyle="bold"
  39. app:layout_constraintBottom_toTopOf="@+id/iv_aging"
  40. app:layout_constraintRight_toRightOf="@+id/iv_bg"
  41. app:layout_constraintTop_toTopOf="@id/iv_bg"
  42. app:layout_constraintVertical_bias="0.4186046511627907"
  43. tools:text="66"
  44. tools:textColor="#404040" />
  45. <TextView
  46. deleteLine="@{Boolean.TRUE}"
  47. android:layout_width="wrap_content"
  48. android:layout_height="wrap_content"
  49. android:layout_marginTop="-3dp"
  50. android:text="@{@string/member_price(TextUtil.formatFloatWithout0End(goodsBean.originalAmount, 1))}"
  51. android:textColor="#66233D6F"
  52. android:textSize="11sp"
  53. app:layout_constraintEnd_toEndOf="@+id/tv_member_buy_price"
  54. app:layout_constraintTop_toBottomOf="@+id/tv_member_buy_price"
  55. tools:text="¥299" />
  56. <TextView
  57. android:layout_width="wrap_content"
  58. android:layout_height="wrap_content"
  59. android:layout_marginEnd="2dp"
  60. android:text="@string/rmb"
  61. android:textColor="#2C3986"
  62. android:textSize="15sp"
  63. android:textStyle="bold"
  64. app:layout_constraintBaseline_toBaselineOf="@+id/tv_member_buy_price"
  65. app:layout_constraintEnd_toStartOf="@+id/tv_member_buy_price" />
  66. <TextView
  67. android:id="@+id/tv_member_buy_tag"
  68. isInvisible="@{!goodsBean.popular}"
  69. android:layout_width="wrap_content"
  70. android:layout_height="wrap_content"
  71. android:background="@drawable/bg_member_tag"
  72. android:gravity="center"
  73. android:paddingHorizontal="12dp"
  74. android:paddingVertical="2dp"
  75. android:text="@string/member_buy_tag_txt"
  76. android:textColor="@color/white"
  77. android:textSize="12dp"
  78. app:layout_constraintStart_toStartOf="parent"
  79. app:layout_constraintTop_toTopOf="parent" />
  80. <Space
  81. android:id="@+id/space2"
  82. android:layout_width="match_parent"
  83. android:layout_height="0dp"
  84. app:layout_constraintDimensionRatio="328:14"
  85. app:layout_constraintTop_toTopOf="@+id/iv_bg" />
  86. <TextView
  87. android:id="@+id/tv_goods_name"
  88. android:layout_width="wrap_content"
  89. android:layout_height="wrap_content"
  90. android:layout_marginStart="12dp"
  91. android:text="@{goodsBean.name}"
  92. android:textColor="#2C3986"
  93. android:textSize="16sp"
  94. android:textStyle="bold"
  95. app:layout_constraintStart_toStartOf="@id/iv_bg"
  96. app:layout_constraintTop_toBottomOf="@+id/space2"
  97. tools:text="超级恢复" />
  98. <TextView
  99. android:id="@+id/tv_goods_desc"
  100. android:layout_width="0dp"
  101. android:layout_height="wrap_content"
  102. android:layout_marginTop="3dp"
  103. android:text="@{goodsBean.copywriting}"
  104. android:textColor="#2C3986"
  105. android:textSize="11sp"
  106. app:layout_constraintStart_toStartOf="@+id/tv_goods_name"
  107. app:layout_constraintTop_toBottomOf="@+id/tv_goods_name"
  108. app:layout_constraintWidth_percent="0.6067073170731707"
  109. tools:text="解锁全部恢复功能 (微信消息、微信好友、图片、视频、文件、音频)" />
  110. <Space
  111. android:id="@+id/space3"
  112. android:layout_width="match_parent"
  113. android:layout_height="0dp"
  114. app:layout_constraintDimensionRatio="328:12"
  115. app:layout_constraintTop_toBottomOf="@+id/tv_goods_desc" />
  116. <View
  117. android:id="@+id/iv_aging"
  118. android:layout_width="match_parent"
  119. android:layout_height="0dp"
  120. android:layout_marginHorizontal="2dp"
  121. android:background="@drawable/bg_member_aging"
  122. app:layout_constraintDimensionRatio="924:87"
  123. app:layout_constraintTop_toBottomOf="@+id/space3" />
  124. <ImageView
  125. android:id="@+id/iv_member_unlimited"
  126. imageRes="@{goodsBean.unlimitedImg}"
  127. android:layout_width="wrap_content"
  128. android:layout_height="wrap_content"
  129. android:layout_marginStart="10dp"
  130. app:layout_constraintBottom_toBottomOf="@+id/iv_aging"
  131. app:layout_constraintStart_toStartOf="@+id/iv_aging"
  132. app:layout_constraintTop_toTopOf="@+id/iv_aging"
  133. tools:src="@drawable/bg_member_recover_unlimited" />
  134. <ImageView
  135. imageRes="@{goodsBean.validityPeriod}"
  136. android:layout_width="wrap_content"
  137. android:layout_height="wrap_content"
  138. android:layout_marginStart="12dp"
  139. app:layout_constraintBottom_toBottomOf="@+id/iv_aging"
  140. app:layout_constraintStart_toEndOf="@+id/iv_member_unlimited"
  141. app:layout_constraintTop_toTopOf="@+id/iv_aging"
  142. tools:src="@drawable/bg_member_permanent" />
  143. <ImageView
  144. isGone="@{!goodsBean.select}"
  145. android:layout_width="0dp"
  146. android:layout_height="0dp"
  147. android:src="@drawable/icon_member_goods_checked"
  148. app:layout_constraintBottom_toBottomOf="@id/iv_bg"
  149. app:layout_constraintDimensionRatio="102:66"
  150. app:layout_constraintEnd_toEndOf="@id/iv_bg"
  151. app:layout_constraintWidth_percent="0.1036585365853659" />
  152. <Space
  153. android:id="@+id/space_bottom"
  154. android:layout_width="match_parent"
  155. android:layout_height="2dp"
  156. app:layout_constraintTop_toBottomOf="@+id/iv_aging" />
  157. </androidx.constraintlayout.widget.ConstraintLayout>
  158. </layout>