source_compact_grid_item.xml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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="wrap_content"
  7. android:layout_margin="2dp"
  8. android:background="@drawable/library_item_selector"
  9. android:foreground="@drawable/library_item_selector_overlay"
  10. android:padding="4dp">
  11. <com.google.android.material.imageview.ShapeableImageView
  12. android:id="@+id/thumbnail"
  13. android:layout_width="0dp"
  14. android:layout_height="0dp"
  15. android:scaleType="centerCrop"
  16. android:foreground="@drawable/card_gradient_shape"
  17. app:layout_constraintBottom_toBottomOf="parent"
  18. app:layout_constraintDimensionRatio="w,2:3"
  19. app:layout_constraintEnd_toEndOf="parent"
  20. app:layout_constraintStart_toStartOf="parent"
  21. app:layout_constraintTop_toTopOf="parent"
  22. app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Cover"
  23. tools:ignore="ContentDescription"
  24. tools:src="@mipmap/ic_launcher" />
  25. <include
  26. android:id="@+id/badges"
  27. layout="@layout/source_grid_item_badges"
  28. android:layout_width="match_parent"
  29. android:layout_height="wrap_content"
  30. android:layout_marginHorizontal="4dp"
  31. android:layout_marginTop="4dp"
  32. app:layout_constraintEnd_toEndOf="@+id/thumbnail"
  33. app:layout_constraintStart_toStartOf="@+id/thumbnail"
  34. app:layout_constraintTop_toTopOf="@+id/thumbnail" />
  35. <TextView
  36. android:id="@+id/title"
  37. android:layout_width="match_parent"
  38. android:layout_height="wrap_content"
  39. android:layout_gravity="bottom"
  40. android:ellipsize="end"
  41. android:maxLines="2"
  42. android:padding="8dp"
  43. android:shadowColor="@color/md_black_1000"
  44. android:shadowDx="0"
  45. android:shadowDy="0"
  46. android:shadowRadius="4"
  47. android:textAppearance="?attr/textAppearanceTitleSmall"
  48. android:textColor="@color/md_white_1000"
  49. android:textSize="12sp"
  50. app:layout_constraintBottom_toBottomOf="@+id/thumbnail"
  51. app:layout_constraintEnd_toEndOf="parent"
  52. app:layout_constraintStart_toStartOf="parent"
  53. tools:text="Sample name" />
  54. </androidx.constraintlayout.widget.ConstraintLayout>