Added remove from library dialog

Addresses #99
This commit is contained in:
Jay 2020-02-08 19:35:56 -08:00
parent 3d3c6b3db5
commit 755ce656b2
4 changed files with 14 additions and 4 deletions

View File

@ -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)

View File

@ -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
}

View File

@ -9,7 +9,7 @@
app:showAsAction="ifRoom"/>
<item android:id="@+id/action_delete"
android:title="@string/action_delete"
android:title="@string/action_remove"
android:icon="@drawable/ic_delete_white_24dp"
app:showAsAction="ifRoom"/>

View File

@ -24,7 +24,6 @@
<string name="label_help">Help</string>
<string name="unlock_library">Unlock to access Library</string>
<!-- Actions -->
<string name="action_filter">Filter</string>
<string name="action_filter_downloaded">Downloaded</string>
@ -377,6 +376,7 @@
<string name="updating_library">Updating library</string>
<string name="updating_category">Updating category</string>
<string name="local_source_badge">Local</string>
<string name="confirm_manga_deletion">Remove from library?</string>
<!-- Catalogue fragment -->
<string name="source_search_options">Search filters</string>