Make the music models inherit a base data class that contains the ID & name to reduce redundant code.
78 lines
3.4 KiB
XML
78 lines
3.4 KiB
XML
<?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="song"
|
|
type="org.oxycblt.auxio.music.Song" />
|
|
</data>
|
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:background="@drawable/ripple"
|
|
android:clickable="true"
|
|
android:focusable="true"
|
|
android:padding="@dimen/padding_medium">
|
|
|
|
<androidx.appcompat.widget.AppCompatTextView
|
|
android:id="@+id/track_number"
|
|
android:layout_width="@dimen/track_number_width"
|
|
android:layout_height="wrap_content"
|
|
android:text="@{String.valueOf(song.track)}"
|
|
android:textAlignment="center"
|
|
android:textAppearance="?android:attr/textAppearanceListItem"
|
|
android:textColor="?android:attr/textColorTertiary"
|
|
android:textSize="@dimen/track_number_text_size_max"
|
|
android:maxLines="1"
|
|
android:contentDescription="@{@string/description_track_number(song.track)}"
|
|
app:autoSizeMaxTextSize="@dimen/detail_header_size_max"
|
|
app:autoSizeMinTextSize="@dimen/generic_size_min"
|
|
app:autoSizeStepGranularity="@dimen/generic_size_increment"
|
|
android:gravity="center"
|
|
app:autoSizeTextType="uniform"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
tools:text="1" />
|
|
|
|
<TextView
|
|
android:id="@+id/song_name"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="@dimen/margin_medium"
|
|
android:layout_marginEnd="@dimen/margin_medium"
|
|
android:ellipsize="end"
|
|
android:maxLines="1"
|
|
android:text="@{song.name}"
|
|
android:textAppearance="?android:attr/textAppearanceListItem"
|
|
android:textColor="?android:attr/textColorPrimary"
|
|
app:layout_constraintBottom_toTopOf="@+id/duration"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toEndOf="@+id/track_number"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
app:layout_constraintVertical_chainStyle="packed"
|
|
tools:text="Song Name" />
|
|
|
|
<TextView
|
|
android:id="@+id/duration"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="@dimen/margin_medium"
|
|
android:layout_marginEnd="@dimen/margin_medium"
|
|
android:ellipsize="end"
|
|
android:maxLines="1"
|
|
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
|
|
android:textColor="?android:attr/textColorSecondary"
|
|
android:text="@{song.formattedDuration}"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toEndOf="@+id/track_number"
|
|
app:layout_constraintTop_toBottomOf="@+id/song_name"
|
|
tools:text="16:16" />
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
</layout> |