feat: add sorting and search functionality for song list

This commit is contained in:
CappielloAntonio 2024-11-22 21:57:27 +01:00
parent 780f1c3a2e
commit 9e6926fc97
8 changed files with 198 additions and 9 deletions

View file

@ -33,17 +33,48 @@
<TextView
android:id="@+id/page_title_label"
style="@style/TitleLarge"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingTop="16dp"
android:paddingEnd="16dp"
android:paddingEnd="4dp"
android:paddingBottom="24dp"
android:text="@string/label_placeholder"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/song_list_shuffle_image_view"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/page_subtitle_label"
style="@style/TitleMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="4dp"
android:paddingTop="16dp"
android:paddingEnd="16dp"
android:paddingBottom="24dp"
app:layout_constraintTop_toTopOf="@id/page_title_label"
app:layout_constraintBottom_toBottomOf="@id/page_title_label"
app:layout_constraintStart_toEndOf="@id/page_title_label" />
<Button
android:id="@+id/song_list_sort_image_view"
style="@style/Widget.Material3.Button.TonalButton.Icon"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="12dp"
android:insetLeft="0dp"
android:insetTop="0dp"
android:insetRight="0dp"
android:insetBottom="0dp"
android:visibility="gone"
app:cornerRadius="30dp"
app:icon="@drawable/ic_sort_list"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/song_list_shuffle_image_view" />
<Button
android:id="@+id/song_list_shuffle_image_view"
style="@style/Widget.Material3.Button.TonalButton.Icon"

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/menu_song_sort_name"
android:title="@string/menu_sort_name" />
<item
android:id="@+id/menu_song_sort_most_recently_starred"
android:title="@string/menu_sort_most_recently_starred" />
<item
android:id="@+id/menu_song_sort_least_recently_starred"
android:title="@string/menu_sort_least_recently_starred" />
</menu>

View file

@ -178,6 +178,8 @@
<string name="menu_sort_recently_added">Recently added</string>
<string name="menu_sort_recently_played">Recently played</string>
<string name="menu_sort_most_played">Most played</string>
<string name="menu_sort_most_recently_starred">Most recently starred</string>
<string name="menu_sort_least_recently_starred">Least recently starred</string>
<string name="menu_pin_button">Add to home screen</string>
<string name="menu_unpin_button">Remove from home screen</string>
<string name="menu_sort_year">Year</string>
@ -373,6 +375,8 @@
<string name="song_list_page_starred">Starred tracks</string>
<string name="song_list_page_top">%1$s\'s top tracks</string>
<string name="song_list_page_year">Year %1$d</string>
<string name="song_list_page_count">(%1$d)</string>
<string name="song_list_page_count_unknown">(+%1$d)</string>
<string name="song_subtitle_formatter">%1$s • %2$s %3$s</string>
<string name="starred_sync_dialog_negative_button">Cancel</string>
<string name="starred_sync_dialog_neutral_button">Continue</string>