Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
3.7 kB
1
Indexable
Never
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:cardCornerRadius="15dp">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/layout_item_post"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        android:padding="10dp">

        <androidx.cardview.widget.CardView
            android:id="@+id/cv_img_post"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:cardCornerRadius="15dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <ImageView
                android:id="@+id/img_post"
                android:layout_width="100dp"
                android:layout_height="100dp"
                android:scaleType="centerCrop"
                android:src="@drawable/item1"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                tools:ignore="ContentDescription,MissingConstraints" />

        </androidx.cardview.widget.CardView>

        <TextView
            android:id="@+id/txt_title_post"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:text="The Caption Title"
            android:textAlignment="center"
            android:textColor="@color/blue"
            android:singleLine="true"
            android:textSize="14sp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0"
            app:layout_constraintStart_toEndOf="@+id/cv_img_post"
            app:layout_constraintTop_toTopOf="@+id/cv_img_post"
            tools:ignore="MissingConstraints"
            app:layout_constraintWidth_default="wrap"/>

        <TextView
            android:id="@+id/txt_body_post"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:ellipsize="end"
            android:maxLines="3"
            android:text="HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHello"
            android:textColor="@color/black"
            android:textSize="16sp"
            android:textStyle="bold"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0"
            app:layout_constraintStart_toEndOf="@+id/cv_img_post"
            app:layout_constraintTop_toBottomOf="@+id/txt_title_post"
            app:layout_constraintWidth_default="wrap" />

        <TextView
            android:id="@+id/txt_day_create_post"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:text="29-11-2023"
            android:textSize="14sp"
            android:textColor="@color/gray"
            app:layout_constraintBottom_toBottomOf="@+id/cv_img_post"
            app:layout_constraintStart_toEndOf="@+id/cv_img_post" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.cardview.widget.CardView>