Update album items/details
Update the ArtistDetailFragment album item to show the year instead of song count. Update AlbumDetailFragment to show year, song count, and total duration.
This commit is contained in:
@@ -86,13 +86,14 @@
|
||||
tools:text="Artist Name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album_year"
|
||||
android:id="@+id/album_other_details"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/margin_medium"
|
||||
android:text="@{album.year != 0 ? String.valueOf(album.year) : @string/placeholder_no_date}"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
app:albumDetails="@{album}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/artist_name"
|
||||
tools:text="2020" />
|
||||
@@ -111,7 +112,7 @@
|
||||
android:text="@string/label_songs"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Overline"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_year" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_other_details" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/sort_button"
|
||||
@@ -128,7 +129,7 @@
|
||||
tools:src="@drawable/ic_sort_numeric_down"
|
||||
app:layout_constraintBottom_toTopOf="@+id/song_recycler"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_year" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_other_details" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/song_recycler"
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/header_title"
|
||||
tools:itemCount="4"
|
||||
tools:listitem="@layout/item_album" />
|
||||
tools:listitem="@layout/item_artist_album" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintBottom_toTopOf="@+id/song_count"
|
||||
app:layout_constraintBottom_toTopOf="@+id/album_other_details"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cover"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -47,12 +47,13 @@
|
||||
tools:text="Album Name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/song_count"
|
||||
android:id="@+id/album_other_details"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/margin_medium"
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cover"
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_name"
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<?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="album"
|
||||
type="org.oxycblt.auxio.music.models.Album" />
|
||||
</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">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="@dimen/cover_size_normal"
|
||||
android:layout_height="@dimen/cover_size_normal"
|
||||
android:contentDescription="@{@string/description_album_cover(album.name)}"
|
||||
app:coverArt="@{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"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/margin_medium"
|
||||
android:text="@{album.name}"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintBottom_toTopOf="@+id/album_other_details"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cover"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="Album Name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album_other_details"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/margin_medium"
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:maxLines="1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cover"
|
||||
app:layout_constraintTop_toBottomOf="@+id/album_name"
|
||||
android:text="@{String.valueOf(album.year)}"
|
||||
tools:text="2020" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -67,11 +67,11 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/duration"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:gravity="end"
|
||||
android:text="@{song.formattedDuration}"
|
||||
android:textAlignment="center"
|
||||
android:textAlignment="viewEnd"
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
|
||||
android:textColor="?android:attr/textColorTertiary"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
Reference in New Issue
Block a user