mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
Migrate add to playlist dialog to MD3 dropdown menu
This commit is contained in:
parent
7700bb7cba
commit
d1cc16c6fb
@ -55,12 +55,9 @@ class AddToPlaylistDialog(
|
||||
return@launchWhenCreated
|
||||
}
|
||||
if (response.isEmpty()) return@launchWhenCreated
|
||||
val names = response.map { it.name }
|
||||
val names = response.mapNotNull { it.name }
|
||||
val arrayAdapter =
|
||||
ArrayAdapter(requireContext(), android.R.layout.simple_spinner_item, names)
|
||||
arrayAdapter.setDropDownViewResource(
|
||||
android.R.layout.simple_spinner_dropdown_item
|
||||
)
|
||||
ArrayAdapter(requireContext(), R.layout.dropdown_item, names)
|
||||
binding.playlistsSpinner.adapter = arrayAdapter
|
||||
|
||||
// select the last used playlist
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@ -11,14 +12,13 @@
|
||||
android:layout_margin="10dp"
|
||||
android:gravity="center" />
|
||||
|
||||
<Spinner
|
||||
<com.github.libretube.ui.views.DropdownMenu
|
||||
android:id="@+id/playlists_spinner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="40dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:icon="@drawable/ic_playlist_add"
|
||||
tools:ignore="RtlSymmetry" />
|
||||
|
||||
<LinearLayout
|
||||
|
Loading…
x
Reference in New Issue
Block a user