mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-11 11:19:09 +01:00
Cancel library update from updating library snackbar
This commit is contained in:
parent
20bab59df3
commit
23230ddeb7
@ -5,6 +5,7 @@ import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
import android.view.Menu
|
||||
@ -42,6 +43,8 @@ import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.data.download.DownloadService
|
||||
import eu.kanade.tachiyomi.data.library.LibraryServiceListener
|
||||
import eu.kanade.tachiyomi.data.library.LibraryUpdateService
|
||||
import eu.kanade.tachiyomi.data.notification.NotificationReceiver
|
||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.data.preference.getOrDefault
|
||||
import eu.kanade.tachiyomi.ui.base.controller.BaseController
|
||||
@ -462,6 +465,10 @@ class LibraryController(
|
||||
LibraryUpdateService.start(view.context, category)
|
||||
snack = view.snack(R.string.updating_library) {
|
||||
anchorView = filter_bottom_sheet
|
||||
setAction(R.string.cancel) {
|
||||
LibraryUpdateService.stop(context)
|
||||
Handler().post { NotificationReceiver.dismissNotification(context, Notifications.ID_LIBRARY_PROGRESS) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -913,6 +920,10 @@ class LibraryController(
|
||||
), Snackbar.LENGTH_LONG
|
||||
) {
|
||||
anchorView = filter_bottom_sheet
|
||||
setAction(R.string.cancel) {
|
||||
LibraryUpdateService.stop(context)
|
||||
Handler().post { NotificationReceiver.dismissNotification(context, Notifications.ID_LIBRARY_PROGRESS) }
|
||||
}
|
||||
}
|
||||
if (!inQueue) LibraryUpdateService.start(view!!.context, category)
|
||||
return true
|
||||
|
Loading…
x
Reference in New Issue
Block a user