From 3d0e750519e851abbae193c2c78500ba897bf800 Mon Sep 17 00:00:00 2001 From: Joshua <49599589+joshuaxu71@users.noreply.github.com> Date: Sun, 10 Sep 2023 01:01:24 +0700 Subject: [PATCH] [Download Queue] Move series to bottom (#9918) Added item in download queue page to move series to bottom --- .../tachiyomi/ui/download/DownloadQueueScreenModel.kt | 8 ++++++-- app/src/main/res/menu/download_single.xml | 4 ++++ i18n/src/main/res/values/strings.xml | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreenModel.kt index 8eed7a915d..18ab4c36b0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadQueueScreenModel.kt @@ -84,13 +84,17 @@ class DownloadQueueScreenModel( } reorder(newDownloads) } - R.id.move_to_top_series -> { + R.id.move_to_top_series, R.id.move_to_bottom_series -> { val (selectedSeries, otherSeries) = adapter?.currentItems ?.filterIsInstance() ?.map(DownloadItem::download) ?.partition { item.download.manga.id == it.manga.id } ?: Pair(emptyList(), emptyList()) - reorder(selectedSeries + otherSeries) + if (menuItem.itemId == R.id.move_to_top_series) { + reorder(selectedSeries + otherSeries) + } else { + reorder(otherSeries + selectedSeries) + } } R.id.cancel_download -> { cancel(listOf(item.download)) diff --git a/app/src/main/res/menu/download_single.xml b/app/src/main/res/menu/download_single.xml index 34ec33a4dc..1cf14ff0c6 100644 --- a/app/src/main/res/menu/download_single.xml +++ b/app/src/main/res/menu/download_single.xml @@ -13,6 +13,10 @@ android:id="@+id/move_to_bottom" android:title="@string/action_move_to_bottom" /> + + diff --git a/i18n/src/main/res/values/strings.xml b/i18n/src/main/res/values/strings.xml index 9512a9f2e8..b32cfa27a4 100644 --- a/i18n/src/main/res/values/strings.xml +++ b/i18n/src/main/res/values/strings.xml @@ -137,6 +137,7 @@ Move to top Move series to top Move to bottom + Move series to bottom Install Share Save