Created
August 3, 2021 03:23
-
-
Save SamueldaCostaAraujoNunes/8ddabb610d6346db224dbf03b2cfb6b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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="200dp" | |
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="100dp"> | |
<ImageView | |
android:id="@+id/image" | |
android:layout_width="200dp" | |
android:layout_height="200dp" | |
android:contentDescription="@{character.name}" | |
android:elevation="20dp" | |
app:layout_constraintEnd_toEndOf="parent" | |
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:paddingTop="23dp" | |
android:textSize="27sp" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
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="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginHorizontal="50dp" | |
app:layout_constraintTop_toBottomOf="@+id/nome"> | |
<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: Alive" /> | |
<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="Specie: Human" /> | |
<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: Male" /> | |
<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: Potato" /> | |
</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