Fixed set as cover in reader not prompting for confirmation

This commit is contained in:
Jay 2020-05-24 01:22:02 -04:00
parent 2e96a2179a
commit b6f6b410bb

View File

@ -35,8 +35,8 @@ import eu.kanade.tachiyomi.data.notification.NotificationReceiver
import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.data.notification.Notifications
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.ui.base.activity.BaseRxActivity
import eu.kanade.tachiyomi.ui.base.MaterialMenuSheet import eu.kanade.tachiyomi.ui.base.MaterialMenuSheet
import eu.kanade.tachiyomi.ui.base.activity.BaseRxActivity
import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.AddToLibraryFirst import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.AddToLibraryFirst
import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.Error import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.Error
import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.Success import eu.kanade.tachiyomi.ui.reader.ReaderPresenter.SetAsCoverResult.Success
@ -585,7 +585,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
) )
MaterialMenuSheet(this, items) { _, item -> MaterialMenuSheet(this, items) { _, item ->
when (item) { when (item) {
0 -> setAsCover(page) 0 -> showSetCoverPrompt(page)
1 -> shareImage(page) 1 -> shareImage(page)
2 -> saveImage(page) 2 -> saveImage(page)
} }
@ -629,7 +629,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
presenter.shareImage(page) presenter.shareImage(page)
} }
fun setCover(page: ReaderPage) { fun showSetCoverPrompt(page: ReaderPage) {
if (page.status != Page.READY) return if (page.status != Page.READY) return
MaterialDialog(this) MaterialDialog(this)