Fix snackbars not being in viewport properly

This commit is contained in:
arkon 2020-08-03 14:12:34 -04:00
parent 88032e11df
commit 060f0682f4
3 changed files with 3 additions and 4 deletions

View File

@ -46,6 +46,7 @@ import eu.kanade.tachiyomi.util.view.shrinkOnScroll
import eu.kanade.tachiyomi.util.view.snack
import eu.kanade.tachiyomi.widget.AutofitRecyclerView
import eu.kanade.tachiyomi.widget.EmptyView
import kotlinx.android.synthetic.main.main_activity.root_coordinator
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.drop
import kotlinx.coroutines.flow.filter
@ -403,7 +404,7 @@ open class BrowseSourceController(bundle: Bundle) :
binding.emptyView.show(message, actions)
} else {
snack = binding.catalogueView.snack(message, Snackbar.LENGTH_INDEFINITE) {
snack = activity!!.root_coordinator?.snack(message, Snackbar.LENGTH_INDEFINITE) {
setAction(R.string.action_retry, retryAction)
}
}

View File

@ -152,8 +152,6 @@ class MainActivity : BaseActivity<MainActivityBinding>() {
if (Migrations.upgrade(preferences) && !BuildConfig.DEBUG) {
WhatsNewDialogController().showDialog(router)
}
WhatsNewDialogController().showDialog(router)
}
preferences.extensionUpdatesCount()

View File

@ -891,7 +891,7 @@ class MangaController :
val manga = presenter.manga
presenter.downloadChapters(chapters)
if (view != null && !manga.favorite) {
binding.recycler.snack(view.context.getString(R.string.snack_add_to_library), Snackbar.LENGTH_INDEFINITE) {
activity!!.root_coordinator?.snack(view.context.getString(R.string.snack_add_to_library), Snackbar.LENGTH_INDEFINITE) {
setAction(R.string.action_add) {
addToLibrary(manga)
}