diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt index ee7aa0dc1..47355da71 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt @@ -67,6 +67,7 @@ class PlaylistFragment : Fragment() { PreferenceHelper.putInt(PreferenceKeys.PLAYLIST_SORT_ORDER, value) field = value } + private val sortOptions by lazy { resources.getStringArray(R.array.playlistSortOptions) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -215,13 +216,13 @@ class PlaylistFragment : Fragment() { keepQueue = true, ) } - binding.sortMenu.isGone = false - binding.sortMenu.setOnClickListener { - val sortOptions = resources.getStringArray(R.array.playlistSortOptions) - + binding.sortContainer.isGone = false + binding.sortTV.text = sortOptions[selectedSortOrder] + binding.sortContainer.setOnClickListener { BaseBottomSheet().apply { setSimpleItems(sortOptions.toList()) { index -> selectedSortOrder = index + binding.sortTV.text = sortOptions[index] showPlaylistVideos(response) } }.show(childFragmentManager) diff --git a/app/src/main/res/layout/fragment_playlist.xml b/app/src/main/res/layout/fragment_playlist.xml index 1d8ae21c4..81ef07917 100644 --- a/app/src/main/res/layout/fragment_playlist.xml +++ b/app/src/main/res/layout/fragment_playlist.xml @@ -55,15 +55,31 @@ android:textSize="20sp" android:textStyle="bold" /> - + android:layout_marginEnd="8dp" + android:padding="5dp" + android:background="@drawable/rounded_ripple" + android:visibility="gone" + tools:visibility="visible"> + + + + + +