From 197247feddc9d775373f65d24f00577e069ea8e4 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Mon, 30 Oct 2023 12:15:10 +0100 Subject: [PATCH] refactor: move reverse queue button to sort dialog --- .../github/libretube/ui/sheets/PlayingQueueSheet.kt | 9 +++------ app/src/main/res/drawable/ic_reverse.xml | 10 ---------- app/src/main/res/layout/queue_bottom_sheet.xml | 6 ------ 3 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_reverse.xml diff --git a/app/src/main/java/com/github/libretube/ui/sheets/PlayingQueueSheet.kt b/app/src/main/java/com/github/libretube/ui/sheets/PlayingQueueSheet.kt index eb9ba9de5..ec0e2551a 100644 --- a/app/src/main/java/com/github/libretube/ui/sheets/PlayingQueueSheet.kt +++ b/app/src/main/java/com/github/libretube/ui/sheets/PlayingQueueSheet.kt @@ -54,11 +54,6 @@ class PlayingQueueSheet : ExpandedBottomSheet() { AddToPlaylistDialog().show(childFragmentManager, null) } - binding.reverse.setOnClickListener { - PlayingQueue.setStreams(PlayingQueue.getStreams().reversed()) - adapter.notifyDataSetChanged() - } - binding.repeat.setOnClickListener { // select the next available repeat mode PlayingQueue.repeatMode = when (PlayingQueue.repeatMode) { @@ -135,7 +130,8 @@ class PlayingQueueSheet : ExpandedBottomSheet() { R.string.creation_date, R.string.most_views, R.string.uploader_name, - R.string.shuffle + R.string.shuffle, + R.string.tooltip_reverse ) .map { requireContext().getString(it) } .toTypedArray() @@ -160,6 +156,7 @@ class PlayingQueueSheet : ExpandedBottomSheet() { .filter { it !in toShuffle } .plus(toShuffle.shuffled()) } + 4 -> PlayingQueue.getStreams().reversed() else -> throw IllegalArgumentException() } PlayingQueue.setStreams(newQueue) diff --git a/app/src/main/res/drawable/ic_reverse.xml b/app/src/main/res/drawable/ic_reverse.xml deleted file mode 100644 index 1daf24465..000000000 --- a/app/src/main/res/drawable/ic_reverse.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/layout/queue_bottom_sheet.xml b/app/src/main/res/layout/queue_bottom_sheet.xml index 47e697431..e84d6d62c 100644 --- a/app/src/main/res/layout/queue_bottom_sheet.xml +++ b/app/src/main/res/layout/queue_bottom_sheet.xml @@ -43,12 +43,6 @@ style="@style/QueueSheetOption" android:src="@drawable/ic_repeat" /> - -