diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt index e62fd0821..75647d5c1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt @@ -130,14 +130,15 @@ class MangaController : private var chaptersHeaderAdapter: MangaChaptersHeaderAdapter? = null private var chaptersAdapter: ChaptersAdapter? = null - /** - * Sheet containing filter/sort/display items. - */ + // Sheet containing filter/sort/display items. private var settingsSheet: ChaptersSettingsSheet? = null private var actionFab: ExtendedFloatingActionButton? = null private var actionFabScrollListener: RecyclerView.OnScrollListener? = null + // Snackbar to add manga to library after downloading chapter(s) + private var addSnackbar: Snackbar? = null + /** * Action mode for multiple selection. */ @@ -316,6 +317,7 @@ class MangaController : chaptersHeaderAdapter = null chaptersAdapter = null settingsSheet = null + addSnackbar?.dismiss() updateToolbarTitleAlpha(255) super.onDestroyView(view) } @@ -891,7 +893,7 @@ class MangaController : val manga = presenter.manga presenter.downloadChapters(chapters) if (view != null && !manga.favorite) { - activity!!.root_coordinator?.snack(view.context.getString(R.string.snack_add_to_library), Snackbar.LENGTH_INDEFINITE) { + addSnackbar = activity!!.root_coordinator?.snack(view.context.getString(R.string.snack_add_to_library), Snackbar.LENGTH_INDEFINITE) { setAction(R.string.action_add) { addToLibrary(manga) }