source_grid_item.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FrameLayout 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="wrap_content"
  7. android:background="?selectable_library_drawable"
  8. android:padding="4dp">
  9. <androidx.cardview.widget.CardView
  10. android:id="@+id/card"
  11. android:layout_width="wrap_content"
  12. android:layout_height="220dp"
  13. app:cardCornerRadius="@dimen/card_radius">
  14. <ImageView
  15. android:id="@+id/thumbnail"
  16. android:layout_width="match_parent"
  17. android:layout_height="match_parent"
  18. android:background="?attr/colorSurface"
  19. tools:background="?attr/colorSurface"
  20. tools:ignore="ContentDescription"
  21. tools:src="@mipmap/ic_launcher" />
  22. <View
  23. android:id="@+id/gradient"
  24. android:layout_width="match_parent"
  25. android:layout_height="wrap_content"
  26. android:layout_gravity="bottom"
  27. android:background="@drawable/gradient_shape" />
  28. <androidx.constraintlayout.widget.ConstraintLayout
  29. android:layout_width="wrap_content"
  30. android:layout_height="wrap_content"
  31. tools:layout_editor_absoluteX="7dp"
  32. tools:layout_editor_absoluteY="7dp">
  33. <TextView
  34. android:id="@+id/unread_text"
  35. style="@style/TextAppearance.Regular.Caption.Light"
  36. android:layout_width="wrap_content"
  37. android:layout_height="wrap_content"
  38. android:layout_marginStart="4dp"
  39. android:layout_marginTop="4dp"
  40. android:background="@color/colorAccentDark"
  41. android:paddingStart="3dp"
  42. android:paddingTop="1dp"
  43. android:paddingEnd="3dp"
  44. android:paddingBottom="1dp"
  45. android:visibility="gone"
  46. app:layout_constraintStart_toEndOf="@+id/download_text"
  47. app:layout_constraintTop_toTopOf="parent"
  48. tools:text="120"
  49. tools:visibility="visible" />
  50. <TextView
  51. android:id="@+id/download_text"
  52. style="@style/TextAppearance.Regular.Caption.Light"
  53. android:layout_width="wrap_content"
  54. android:layout_height="wrap_content"
  55. android:layout_marginStart="4dp"
  56. android:layout_marginTop="4dp"
  57. android:background="@color/md_red_500"
  58. android:paddingStart="3dp"
  59. android:paddingTop="1dp"
  60. android:paddingEnd="3dp"
  61. android:paddingBottom="1dp"
  62. android:visibility="gone"
  63. app:layout_constraintStart_toEndOf="@+id/local_text"
  64. app:layout_constraintTop_toTopOf="parent"
  65. tools:text="120"
  66. tools:visibility="visible" />
  67. <TextView
  68. android:id="@+id/local_text"
  69. style="@style/TextAppearance.Regular.Caption.Light"
  70. android:layout_width="wrap_content"
  71. android:layout_height="wrap_content"
  72. android:layout_marginStart="4dp"
  73. android:layout_marginTop="4dp"
  74. android:background="@color/md_teal_500"
  75. android:paddingStart="3dp"
  76. android:paddingTop="1dp"
  77. android:paddingEnd="3dp"
  78. android:paddingBottom="1dp"
  79. android:text="@string/local_source_badge"
  80. android:visibility="gone"
  81. app:layout_constraintStart_toStartOf="parent"
  82. app:layout_constraintTop_toTopOf="parent"
  83. tools:visibility="visible" />
  84. </androidx.constraintlayout.widget.ConstraintLayout>
  85. <TextView
  86. android:id="@+id/title"
  87. style="@style/TextAppearance.Regular.Body1.Light"
  88. android:layout_width="match_parent"
  89. android:layout_height="wrap_content"
  90. android:layout_gravity="bottom"
  91. android:ellipsize="end"
  92. android:fontFamily="@font/ptsans_narrow_bold"
  93. android:lineSpacingExtra="-4dp"
  94. android:maxLines="2"
  95. android:padding="8dp"
  96. android:shadowColor="@color/textColorPrimaryLight"
  97. android:shadowDx="0"
  98. android:shadowDy="0"
  99. android:shadowRadius="4"
  100. tools:text="Sample name" />
  101. <ProgressBar
  102. android:id="@+id/progress"
  103. style="?android:attr/progressBarStyleSmall"
  104. android:layout_width="wrap_content"
  105. android:layout_height="wrap_content"
  106. android:layout_gravity="center"
  107. android:visibility="gone" />
  108. </androidx.cardview.widget.CardView>
  109. </FrameLayout>