Skip to content

Instantly share code, notes, and snippets.

@Nimrodda
Created June 6, 2019 07:13
Show Gist options
  • Save Nimrodda/506f587aa785d7599243a7f20ae89654 to your computer and use it in GitHub Desktop.
Save Nimrodda/506f587aa785d7599243a7f20ae89654 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable name="genre" type="com.nimroddayan.epoxysample.Genre"/>
<variable name="onHeaderExpanded" type="android.view.View.OnClickListener"/>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="?android:attr/selectableItemBackground"
android:onClick="@{onHeaderExpanded}">
<ImageView
android:id="@+id/icon"
android:layout_width="24dp"
android:layout_height="match_parent"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:src="@mipmap/ic_launcher"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/subtitle"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:gravity="center_vertical"
android:text="@{genre.name}"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/icon"
app:layout_constraintTop_toTopOf="parent"
tools:text="Genre name"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment