Advertisement
SyauqiAlif

Untitled

Nov 16th, 2022
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 3.98 KB | Source Code | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
  3.     android:id="@+id/cv_headline"
  4.     xmlns:android="http://schemas.android.com/apk/res/android"
  5.     android:layout_width="match_parent"
  6.     android:layout_height="wrap_content"
  7.     xmlns:app="http://schemas.android.com/apk/res-auto"
  8.     android:clickable="true"
  9.     android:focusable="true"
  10.     app:cardBackgroundColor="@android:color/transparent"
  11.     app:cardElevation="0dp"
  12.     app:layout_constraintTop_toTopOf="parent">
  13.  
  14.     <androidx.constraintlayout.widget.ConstraintLayout
  15.         android:layout_width="match_parent"
  16.         android:layout_height="match_parent"
  17.         android:padding="16dp">
  18.  
  19.         <com.google.android.material.card.MaterialCardView
  20.             android:id="@+id/card_image"
  21.             android:layout_width="match_parent"
  22.             android:layout_height="180dp"
  23.             app:cardCornerRadius="20dp"
  24.             app:layout_constraintTop_toTopOf="parent">
  25.  
  26.             <ImageView
  27.                 android:id="@+id/img_headline"
  28.                 android:layout_width="match_parent"
  29.                 android:layout_height="180dp"
  30.                 android:scaleType="centerCrop"
  31.                 android:contentDescription="@string/image_new_headline"
  32.                 android:src="@drawable/news_3"/>
  33.  
  34.         </com.google.android.material.card.MaterialCardView>
  35.  
  36.         <TextView
  37.             android:id="@+id/tv_title_headline"
  38.             android:layout_width="match_parent"
  39.             android:layout_height="wrap_content"
  40.             android:layout_marginTop="8dp"
  41.             android:maxLines="3"
  42.             android:textAllCaps="false"
  43.             android:textColor="@color/black"
  44.             android:textSize="18sp"
  45.             app:layout_constraintTop_toBottomOf="@+id/card_image" />
  46.  
  47.         <TextView
  48.             android:id="@+id/tv_desc_headline"
  49.             android:layout_width="match_parent"
  50.             android:layout_height="wrap_content"
  51.             android:layout_marginTop="8dp"
  52.             android:maxLines="2"
  53.             android:textAllCaps="false"
  54.             android:textColor="@color/gray_text"
  55.             app:layout_constraintTop_toBottomOf="@id/tv_title_headline"
  56.             tools:layout_editor_absoluteX="16dp" />
  57.  
  58.         <TextView
  59.             android:id="@+id/tv_date_headline"
  60.             android:layout_width="wrap_content"
  61.             android:layout_height="wrap_content"
  62.             android:layout_marginTop="8dp"
  63.             android:textAllCaps="false"
  64.             android:textColor="@color/gray_text"
  65.             app:layout_constraintStart_toStartOf="parent"
  66.             app:layout_constraintTop_toBottomOf="@id/tv_desc_headline"/>
  67.  
  68.         <TextView
  69.             android:id="@+id/tv_seperate"
  70.             android:layout_width="wrap_content"
  71.             android:layout_height="wrap_content"
  72.             android:layout_marginStart="8dp"
  73.             android:textAllCaps="false"
  74.             android:textColor="@color/gray_text"
  75.             android:text="@string/separate"
  76.             app:layout_constraintBaseline_toBaselineOf="@id/tv_date_headline"
  77.             app:layout_constraintStart_toEndOf="@id/tv_date_headline"
  78.             app:layout_constraintTop_toBottomOf="@id/tv_desc_headline"
  79.             app:layout_constraintEnd_toStartOf="@id/tv_author_headline"/>
  80.  
  81.         <TextView
  82.             android:id="@+id/tv_author_headline"
  83.             android:layout_width="wrap_content"
  84.             android:layout_height="wrap_content"
  85.             android:layout_marginStart="8dp"
  86.             android:textAllCaps="false"
  87.             android:textColor="@color/gray_text"
  88.             app:layout_constraintBaseline_toBaselineOf="@+id/tv_date_headline"
  89.             app:layout_constraintStart_toEndOf="@id/tv_seperate"
  90.             app:layout_constraintTop_toBottomOf="@id/tv_desc_headline"/>
  91.  
  92.     </androidx.constraintlayout.widget.ConstraintLayout>
  93.  
  94. </androidx.constraintlayout.widget.ConstraintLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement