list: add menu dialog framework

Add a dialog that shows menu information as a bottom sheet instead of as
a PopupMenu.

This did not take as much finessing of BottomSheetBehavior as the main
playback UI framework did, just some style redefinitions.
This commit is contained in:
Alexander Capehart
2023-07-03 14:28:32 -06:00
parent 6dc2892eb9
commit c1158b1a07
23 changed files with 359 additions and 39 deletions
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/Widget.Auxio.RecyclerView.Linear"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/spacing_medium"
android:paddingHorizontal="@dimen/spacing_medium"
android:textAppearance="@style/TextAppearance.Auxio.HeadlineSmall"
android:text="TODO: Put info here" />
<org.oxycblt.auxio.list.recycler.DialogRecyclerView
android:id="@+id/menu_recycler"
style="@style/Widget.Auxio.RecyclerView.Linear"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/item_menu_option" />
</LinearLayout>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/title"
android:textAppearance="@style/TextAppearance.Auxio.TitleMedium"
android:padding="@dimen/spacing_medium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:background="@drawable/ui_item_ripple"
tools:text="Songs" />
+9
View File
@@ -30,6 +30,9 @@
<action
android:id="@+id/show_genre"
app:destination="@id/genre_detail_fragment" />
<action
android:id="@+id/open_menu"
app:destination="@id/menu_dialog" />
<action
android:id="@+id/show_playlist"
app:destination="@id/playlist_detail_fragment" />
@@ -297,6 +300,12 @@
app:argType="org.oxycblt.auxio.music.Music$UID" />
</dialog>
<dialog
android:id="@+id/menu_dialog"
android:name="org.oxycblt.auxio.list.menu.MenuDialogFragment"
android:label="menu_dialog"
tools:layout="@layout/dialog_menu" />
<fragment
android:id="@+id/root_preferences_fragment"
android:name="org.oxycblt.auxio.settings.RootPreferenceFragment"
+2
View File
@@ -23,6 +23,8 @@
<item name="materialAlertDialogTheme">@style/Theme.Auxio.Dialog</item>
<item name="sliderStyle">@style/Widget.Auxio.Slider</item>
<item name="linearProgressIndicatorStyle">@style/Widget.Auxio.LinearProgressIndicator</item>
<item name="bottomSheetStyle">@style/Widget.Auxio.BottomSheet</item>
<item name="bottomSheetDialogTheme">@style/Widget.Auxio.BottomSheet.Dialog</item>
<item name="textAppearanceDisplayLarge">@style/TextAppearance.Auxio.DisplayLarge</item>
<item name="textAppearanceDisplayMedium">@style/TextAppearance.Auxio.DisplayMedium</item>
+22
View File
@@ -31,6 +31,28 @@
<item name="trackCornerRadius">@dimen/size_corners_medium</item>
</style>
<style name="Widget.Auxio.BottomSheet" parent="Widget.Material3.BottomSheet">
<item name="marginLeftSystemWindowInsets">false</item>
<item name="marginRightSystemWindowInsets">false</item>
<item name="paddingBottomSystemWindowInsets">false</item>
<item name="paddingTopSystemWindowInsets">false</item>
<item name="shapeAppearance">@style/ShapeAppearance.Material3.Corner.None</item>
<item name="shouldRemoveExpandedCorners">true</item>
</style>
<style name="Widget.Auxio.BottomSheet.Modal" parent="Widget.Material3.BottomSheet.Modal">
<item name="marginLeftSystemWindowInsets">false</item>
<item name="marginRightSystemWindowInsets">false</item>
<item name="paddingBottomSystemWindowInsets">false</item>
<item name="paddingTopSystemWindowInsets">false</item>
<item name="shapeAppearance">@style/ShapeAppearance.Material3.Corner.None</item>
<item name="shouldRemoveExpandedCorners">true</item>
</style>
<style name="Widget.Auxio.BottomSheet.Dialog" parent="ThemeOverlay.Material3.BottomSheetDialog">
<item name="bottomSheetStyle">@style/Widget.Auxio.BottomSheet.Modal</item>
</style>
<style name="Widget.Auxio.Image.Small" parent="">
<item name="android:layout_width">@dimen/size_cover_compact</item>
<item name="android:layout_height">@dimen/size_cover_compact</item>