Advertisement
SyauqiAlif

Untitled

Nov 16th, 2022
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 4.22 KB | Source Code | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
  3.     android:layout_width="match_parent"
  4.     android:layout_height="wrap_content"
  5.     xmlns:app="http://schemas.android.com/apk/res-auto"
  6.     xmlns:tools="http://schemas.android.com/tools"
  7.     android:layout_marginStart="16dp"
  8.     android:layout_marginEnd="16dp"
  9.     android:layout_marginTop="4dp"
  10.     android:layout_marginBottom="4dp"
  11.     android:clickable="true"
  12.     android:focusable="true"
  13.     app:cardBackgroundColor="@color/white"
  14.     android:elevation="0dp">
  15.  
  16.     <androidx.constraintlayout.widget.ConstraintLayout
  17.         android:layout_width="match_parent"
  18.         android:layout_height="match_parent"
  19.         android:background="@android:color/transparent">
  20.  
  21.         <com.google.android.material.card.MaterialCardView
  22.             android:layout_width="150dp"
  23.             android:layout_height="120dp"
  24.             app:cardBackgroundColor="@android:color/transparent"
  25.             app:cardCornerRadius="20dp"
  26.             app:layout_constraintStart_toStartOf="parent"
  27.             app:layout_constraintTop_toTopOf="parent">
  28.  
  29.             <ImageView
  30.                 android:id="@+id/img_news"
  31.                 android:layout_width="match_parent"
  32.                 android:layout_height="match_parent"
  33.                 android:contentDescription="Image News"
  34.                 android:scaleType="centerCrop"
  35.                 android:src="@drawable/news_3"/>
  36.  
  37.         </com.google.android.material.card.MaterialCardView>
  38.  
  39.         <androidx.constraintlayout.widget.Guideline
  40.             android:id="@+id/guideline"
  41.             android:layout_width="wrap_content"
  42.             android:layout_height="wrap_content"
  43.             android:orientation="vertical"
  44.             app:layout_constraintGuide_begin="165dp"/>
  45.  
  46.         <TextView
  47.             android:id="@+id/tv_category"
  48.             android:layout_width="wrap_content"
  49.             android:layout_height="wrap_content"
  50.             android:layout_marginTop="4dp"
  51.             android:maxLines="1"
  52.             android:textColor="@color/orange"
  53.             app:layout_constraintStart_toStartOf="@id/guideline"
  54.             app:layout_constraintTop_toTopOf="parent"
  55.             tools:text="@string/app_name"/>
  56.  
  57.         <TextView
  58.             android:id="@+id/tv_title"
  59.             android:layout_width="0dp"
  60.             android:layout_height="wrap_content"
  61.             android:layout_marginTop="4dp"
  62.             android:maxLines="3"
  63.             android:textColor="@color/black"
  64.             android:textSize="18sp"
  65.             app:layout_constraintEnd_toEndOf="parent"
  66.             app:layout_constraintStart_toStartOf="@id/guideline"
  67.             app:layout_constraintTop_toBottomOf="@id/tv_category"/>
  68.  
  69.         <TextView
  70.             android:id="@+id/tv_date"
  71.             android:layout_width="0dp"
  72.             android:layout_height="wrap_content"
  73.             android:layout_marginBottom="4dp"
  74.             android:maxLines="1"
  75.             android:textAlignment="textStart"
  76.             android:textAllCaps="false"
  77.             android:textColor="@color/gray_text"
  78.             app:layout_constraintBottom_toBottomOf="parent"
  79.             app:layout_constraintHorizontal_chainStyle="spread"
  80.             app:layout_constraintHorizontal_weight="3"
  81.             app:layout_constraintEnd_toStartOf="@id/tv_time"
  82.             app:layout_constraintStart_toStartOf="@id/guideline"/>
  83.  
  84.         <TextView
  85.             android:id="@+id/tv_time"
  86.             android:layout_width="0dp"
  87.             android:layout_height="wrap_content"
  88.             android:layout_marginBottom="4dp"
  89.             android:maxLines="1"
  90.             android:textAlignment="textStart"
  91.             android:textAllCaps="false"
  92.             android:textColor="@color/gray_text"
  93.             app:layout_constraintBaseline_toBaselineOf="@id/tv_date"
  94.             app:layout_constraintEnd_toEndOf="parent"
  95.             app:layout_constraintHorizontal_chainStyle="spread"
  96.             app:layout_constraintHorizontal_weight="2"
  97.             app:layout_constraintStart_toEndOf="@id/tv_date"/>
  98.  
  99.     </androidx.constraintlayout.widget.ConstraintLayout>
  100.  
  101. </com.google.android.material.card.MaterialCardView>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement