Skip to content

Instantly share code, notes, and snippets.

@burhanrashid52
Created January 19, 2018 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burhanrashid52/191701e066d6c0d0473fb80d95ee0d55 to your computer and use it in GitHub Desktop.
Save burhanrashid52/191701e066d6c0d0473fb80d95ee0d55 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="4dp"
android:layout_margin="4dp">
<android.support.constraint.ConstraintLayout
android:id="@+id/parentContsraint"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imgSource"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
android:src="@drawable/placeholder"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/txtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:text="TextView"
android:textColor="@android:color/black"
android:textStyle="italic"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imgSource" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment