Refactor genre UI

Fully refactor the genre UI so that it makes more sense.
This commit is contained in:
OxygenCobalt
2020-12-21 20:10:38 -07:00
parent 6e5bff3bd3
commit 51a5e9fd63
20 changed files with 116 additions and 101 deletions
@@ -29,7 +29,7 @@
style="@style/Toolbar.Style.Icon"
android:background="?android:attr/windowBackground"
android:elevation="@dimen/elevation_normal"
app:menu="@menu/menu_album_actions"
app:menu="@menu/menu_album_detail"
app:title="@string/label_library" />
<androidx.core.widget.NestedScrollView
@@ -29,7 +29,7 @@
style="@style/Toolbar.Style.Icon"
android:background="?android:attr/windowBackground"
android:elevation="@dimen/elevation_normal"
app:menu="@menu/menu_detail"
app:menu="@menu/menu_artist_detail"
app:title="@string/label_library" />
<androidx.core.widget.NestedScrollView
@@ -29,7 +29,7 @@
style="@style/Toolbar.Style.Icon"
android:background="?android:attr/windowBackground"
android:elevation="@dimen/elevation_normal"
app:menu="@menu/menu_detail"
app:menu="@menu/menu_songs"
app:title="@string/label_library" />
<androidx.core.widget.NestedScrollView
@@ -61,7 +61,7 @@
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginEnd="@dimen/margin_medium"
android:text="@{genre.name}"
app:layout_constraintBottom_toTopOf="@+id/genre_counts"
app:layout_constraintBottom_toTopOf="@+id/genre_song_count"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/genre_image"
@@ -70,30 +70,30 @@
tools:text="Genre Name" />
<TextView
android:id="@+id/genre_counts"
android:id="@+id/genre_song_count"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
app:genreCounts="@{genre}"
app:layout_constraintBottom_toTopOf="@+id/genre_song_count"
android:text="@{@plurals/format_song_count(genre.songs.size(), genre.songs.size())}"
app:layout_constraintBottom_toTopOf="@+id/genre_duration"
app:layout_constraintStart_toEndOf="@+id/genre_image"
app:layout_constraintTop_toBottomOf="@+id/genre_name"
tools:text="2 Artists, 4 Albums" />
<TextView
android:id="@+id/genre_song_count"
android:id="@+id/genre_duration"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:text="@{@plurals/format_song_count(genre.songs.size, genre.songs.size)}"
android:text="@{genre.totalDuration}"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintBottom_toTopOf="@+id/genre_song_header"
app:layout_constraintStart_toEndOf="@+id/genre_image"
app:layout_constraintTop_toBottomOf="@+id/genre_counts"
tools:text="80 Songs" />
app:layout_constraintTop_toBottomOf="@+id/genre_song_count"
tools:text="16:16" />
<TextView
android:id="@+id/genre_song_header"
@@ -29,7 +29,7 @@
style="@style/Toolbar.Style.Icon"
android:background="?android:attr/windowBackground"
android:elevation="@dimen/elevation_normal"
app:menu="@menu/menu_album_actions"
app:menu="@menu/menu_album_detail"
app:title="@string/label_library" />
<androidx.core.widget.NestedScrollView
@@ -29,7 +29,7 @@
style="@style/Toolbar.Style.Icon"
android:background="?android:attr/windowBackground"
android:elevation="@dimen/elevation_normal"
app:menu="@menu/menu_detail"
app:menu="@menu/menu_artist_detail"
app:title="@string/label_library" />
<androidx.core.widget.NestedScrollView
@@ -29,7 +29,7 @@
style="@style/Toolbar.Style.Icon"
android:background="?android:attr/windowBackground"
android:elevation="@dimen/elevation_normal"
app:menu="@menu/menu_detail"
app:menu="@menu/menu_songs"
app:title="@string/label_library" />
<androidx.core.widget.NestedScrollView
@@ -70,29 +70,29 @@
app:layout_constraintTop_toBottomOf="@+id/genre_image"
tools:text="Genre Name" />
<TextView
android:id="@+id/genre_counts"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
app:genreCounts="@{genre}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_name"
tools:text="2 Artists, 4 Albums" />
<TextView
android:id="@+id/genre_song_count"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:text="@{@plurals/format_song_count(genre.songs.size, genre.songs.size)}"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
android:text="@{@plurals/format_song_count(genre.songs.size(), genre.songs.size())}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_name"
tools:text="80 Songs" />
<TextView
android:id="@+id/genre_duration"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:text="@{genre.totalDuration}"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_counts"
tools:text="80 Songs" />
app:layout_constraintTop_toBottomOf="@+id/genre_song_count"
tools:text="16:16" />
<TextView
android:id="@+id/genre_song_header"
@@ -100,7 +100,7 @@
android:layout_marginTop="@dimen/padding_medium"
android:text="@string/label_songs"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_song_count" />
app:layout_constraintTop_toBottomOf="@+id/genre_duration" />
<ImageButton
android:id="@+id/genre_sort_button"
+2 -2
View File
@@ -38,12 +38,12 @@
<TextView
android:id="@+id/genre_count"
style="@style/ItemText.Secondary"
app:altGenreCounts="@{genre}"
android:text="@{@plurals/format_song_count(genre.songs.size(), genre.songs.size())}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/genre_image"
app:layout_constraintTop_toBottomOf="@+id/genre_name"
tools:text="4 Albums, 40 Songs" />
tools:text="40 Songs" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
@@ -7,8 +7,8 @@
android:title="@string/label_shuffle"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_play"
android:id="@+id/action_play_albums"
android:icon="@drawable/ic_play"
android:title="@string/label_play"
android:title="@string/label_play_albums"
app:showAsAction="never" />
</menu>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_queue_add"
android:icon="@drawable/ic_queue_add"
android:title="@string/label_queue_add" />
<item
android:id="@+id/action_play_artist"
android:icon="@drawable/ic_artist"
android:title="@string/label_play_artist" />
<item
android:id="@+id/action_play_album"
android:icon="@drawable/ic_album"
android:title="@string/label_play_album" />
</menu>
+2
View File
@@ -28,6 +28,8 @@
<string name="label_play_album">Play from album</string>
<string name="label_play_artist">Play from artist</string>
<string name="label_go_artist">Go to artist</string>
<string name="label_play_albums">Play albums</string>
<string name="label_shuffle_albums">Shuffle albums</string>
<string name="label_queue">Queue</string>
<string name="label_queue_add">Add to queue</string>