From 755ce656b27421698ee6cba170270ce9993050b4 Mon Sep 17 00:00:00 2001 From: Jay Date: Sat, 8 Feb 2020 19:35:56 -0800 Subject: [PATCH] Added remove from library dialog Addresses #99 --- .../kanade/tachiyomi/ui/library/LibraryController.kt | 12 +++++++++++- .../java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 2 +- app/src/main/res/menu/library_selection.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index 01ae92f41a..842733af35 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -19,6 +19,7 @@ import androidx.core.graphics.drawable.DrawableCompat import androidx.core.view.GravityCompat import androidx.drawerlayout.widget.DrawerLayout import androidx.viewpager.widget.ViewPager +import com.afollestad.materialdialogs.MaterialDialog import com.bluelinelabs.conductor.ControllerChangeHandler import com.bluelinelabs.conductor.ControllerChangeType import com.f2prateek.rx.preferences.Preference @@ -47,6 +48,7 @@ import eu.kanade.tachiyomi.ui.migration.MigrationInterface import eu.kanade.tachiyomi.ui.migration.manga.design.PreMigrationController import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationListController import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationProcedureConfig +import eu.kanade.tachiyomi.ui.setting.SettingsAdvancedController import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets import eu.kanade.tachiyomi.util.view.inflate import eu.kanade.tachiyomi.util.view.marginBottom @@ -548,7 +550,15 @@ class LibraryController( override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean { when (item.itemId) { R.id.action_move_to_category -> showChangeMangaCategoriesDialog() - R.id.action_delete -> deleteMangasFromLibrary() + R.id.action_delete -> { + MaterialDialog(activity!!) + .message(R.string.confirm_manga_deletion) + .positiveButton(R.string.action_remove) { + deleteMangasFromLibrary() + } + .negativeButton(android.R.string.no) + .show() + } R.id.action_select_all -> { adapter?.categories?.getOrNull(library_pager.currentItem)?.id?.let { selectAllRelay.call(it) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 2340c6b2c2..d34c7a0c11 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -85,7 +85,7 @@ open class MainActivity : BaseActivity() { this.snackBar = snackBar canDismissSnackBar = false launchUI { - delay(5000) + delay(2000) if (this@MainActivity.snackBar == snackBar) { canDismissSnackBar = true } diff --git a/app/src/main/res/menu/library_selection.xml b/app/src/main/res/menu/library_selection.xml index 0969758335..36214de991 100644 --- a/app/src/main/res/menu/library_selection.xml +++ b/app/src/main/res/menu/library_selection.xml @@ -9,7 +9,7 @@ app:showAsAction="ifRoom"/> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1adc37af0d..bd40329347 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -24,7 +24,6 @@ Help Unlock to access Library - Filter Downloaded @@ -377,6 +376,7 @@ Updating library Updating category Local + Remove from library? Search filters