Auxio/app/src/main/res/layout/item_album.xml
OxygenCobalt df49e2765f
music: refactor model usage
Refactor the way music models are constructed to achieve the following:
- Add a unified interface for resolving display names of artists
- Disambiguate the role of Header in the music objects
- Eliminate the need to load strings in with a context when creating
Header instances
2021-10-28 19:09:54 -06:00

51 lines
No EOL
2.2 KiB
XML

<?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"
tools:context=".ui.AlbumViewHolder">
<data>
<variable
name="album"
type="org.oxycblt.auxio.music.Album" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout style="@style/Widget.Auxio.ItemLayout">
<ImageView
android:id="@+id/album_cover"
style="@style/Widget.Auxio.Image.Normal"
android:contentDescription="@{@string/desc_album_cover(album.name)}"
app:albumArt="@{album}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_album" />
<TextView
android:id="@+id/album_name"
style="@style/Widget.Auxio.TextView.Item.Primary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@{album.name}"
app:layout_constraintBottom_toTopOf="@+id/album_info"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/album_cover"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Album Name" />
<TextView
android:id="@+id/album_info"
style="@style/Widget.Auxio.TextView.Item.Secondary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@{@string/fmt_two(album.artist.resolvedName, @plurals/fmt_song_count(album.songs.size, album.songs.size))}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/album_cover"
app:layout_constraintTop_toBottomOf="@+id/album_name"
tools:text="Artist / 10 Songs" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>