source_comfortable_grid_item.xml 4.6 KB

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