Anchored library snackbars above the category hopper

This commit is contained in:
Jay 2020-05-06 23:18:21 -04:00
parent 3529681f90
commit d38bb54d83

View File

@ -525,7 +525,8 @@ class LibraryController(
val view = view ?: return
LibraryUpdateService.start(view.context, category)
snack = view.snack(R.string.updating_library) {
anchorView = filter_bottom_sheet
anchorView = category_hopper_frame
view.elevation = 15f.dpToPx
setAction(R.string.cancel) {
LibraryUpdateService.stop(context)
Handler().post { NotificationReceiver.dismissNotification(context, Notifications.ID_LIBRARY_PROGRESS) }
@ -968,7 +969,8 @@ class LibraryController(
if (presenter.mangaIsInCategory(item.manga, newHeader?.category?.id)) {
adapter.moveItem(position, lastItemPosition!!)
snack = view?.snack(R.string.already_in_category) {
anchorView = filter_bottom_sheet
anchorView = category_hopper_frame
view.elevation = 15f.dpToPx
}
return
}
@ -991,7 +993,8 @@ class LibraryController(
snack = view?.snack(
resources!!.getString(R.string.moved_to_, category.name)
) {
anchorView = filter_bottom_sheet
anchorView = category_hopper_frame
view.elevation = 15f.dpToPx
setAction(R.string.undo) {
manga.category = category.id!!
presenter.moveMangaToCategory(manga, oldCatId, mangaIds)
@ -1012,7 +1015,8 @@ class LibraryController(
}, category.name
), Snackbar.LENGTH_LONG
) {
anchorView = filter_bottom_sheet
anchorView = category_hopper_frame
view.elevation = 15f.dpToPx
setAction(R.string.cancel) {
LibraryUpdateService.stop(context)
Handler().post { NotificationReceiver.dismissNotification(context, Notifications.ID_LIBRARY_PROGRESS) }
@ -1187,7 +1191,8 @@ class LibraryController(
snack = view?.snack(
activity?.getString(R.string.removed_from_library) ?: "", Snackbar.LENGTH_INDEFINITE
) {
anchorView = filter_bottom_sheet
anchorView = category_hopper_frame
view.elevation = 15f.dpToPx
var undoing = false
setAction(R.string.undo) {
presenter.reAddMangas(mangas)