Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SamueldaCostaAraujoNunes/1d2da0d82334f7b87c6f182ac6e83fba to your computer and use it in GitHub Desktop.
Save SamueldaCostaAraujoNunes/1d2da0d82334f7b87c6f182ac6e83fba to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="character"
type="br.com.samuelnunes.rickandmortyapp.data.entities.Character" />
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBackground">
<View
android:id="@+id/viewColor"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:background="@color/colorPrimary" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="50dp">
<ImageView
android:id="@+id/image"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_marginStart="50dp"
android:contentDescription="@{character.name}"
android:elevation="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:url="@{character.image}"
tools:src="@tools:sample/avatars" />
<TextView
android:id="@+id/nome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="27sp"
android:maxLines="3"
app:layout_constraintEnd_toEndOf="@+id/image"
app:layout_constraintStart_toStartOf="@+id/image"
app:layout_constraintTop_toBottomOf="@+id/image"
app:text="@{character.name}"
tools:text="@tools:sample/full_names" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/card_view"
style="@style/MyCardView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="50dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/image"
app:layout_constraintTop_toTopOf="@+id/image">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:layout_marginStart="16dp"
android:text="@{@string/character_status(character.status)}"
android:textSize="18sp"
tools:text="Status" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:layout_marginStart="16dp"
android:text="@{@string/character_species(character.species)}"
android:textSize="18sp"
tools:text="Especie" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:layout_marginStart="16dp"
android:text="@{@string/character_gender(character.gender)}"
android:textSize="18sp"
tools:text="gender" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="8dp"
android:layout_marginStart="16dp"
android:text="@{@string/character_type(character.type)}"
android:textSize="18sp"
app:visibleIf="@{!character.type.empty}"
tools:text="type" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
</layout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment