diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt index 4b2a17745..a4f218369 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt @@ -195,7 +195,7 @@ class CategoryController : (activity as? MainActivity)?.binding?.rootCoordinator!!, R.string.snack_categories_deleted, R.string.action_undo, - 3000 + 4000 ) mode.finish() 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 b70ad5525..56fe664bb 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 @@ -612,6 +612,9 @@ class MangaController : */ private fun toggleFavorite() { val isNowFavorite = presenter.toggleFavorite() + if (isNowFavorite) { + addSnackbar?.dismiss() + } if (activity != null && !isNowFavorite && presenter.hasDownloads()) { (activity as? MainActivity)?.binding?.rootCoordinator?.snack(activity!!.getString(R.string.delete_downloads_for_manga)) { setAction(R.string.action_delete) { @@ -619,7 +622,6 @@ class MangaController : } } } - mangaInfoAdapter?.notifyDataSetChanged() } @@ -1115,7 +1117,7 @@ class MangaController : val manga = presenter.manga presenter.downloadChapters(chapters) if (view != null && !manga.favorite) { - addSnackbar = (activity as? MainActivity)?.binding?.rootCoordinator?.snack(view.context.getString(R.string.snack_add_to_library), Snackbar.LENGTH_INDEFINITE) { + addSnackbar = (activity as? MainActivity)?.binding?.rootCoordinator?.snack(view.context.getString(R.string.snack_add_to_library)) { setAction(R.string.action_add) { if (!manga.favorite) { addToLibrary(manga) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt index 79d7942df..b79e783dd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt @@ -49,7 +49,7 @@ fun View.getCoordinates() = Point((left + right) / 2, (top + bottom) / 2) */ inline fun View.snack( message: String, - length: Int = Snackbar.LENGTH_LONG, + length: Int = 10_000, f: Snackbar.() -> Unit = {} ): Snackbar { val snack = Snackbar.make(this, message, length)