|
@@ -73,8 +73,6 @@ import eu.kanade.tachiyomi.util.system.toast
|
|
|
import eu.kanade.tachiyomi.util.view.getCoordinates
|
|
|
import eu.kanade.tachiyomi.util.view.shrinkOnScroll
|
|
|
import eu.kanade.tachiyomi.util.view.snack
|
|
|
-import kotlinx.android.synthetic.main.main_activity.root_coordinator
|
|
|
-import kotlinx.android.synthetic.main.main_activity.toolbar
|
|
|
import kotlinx.coroutines.flow.launchIn
|
|
|
import kotlinx.coroutines.flow.onEach
|
|
|
import reactivecircus.flowbinding.android.view.clicks
|
|
@@ -262,7 +260,7 @@ class MangaController :
|
|
|
else -> min(binding.recycler.computeVerticalScrollOffset(), 255)
|
|
|
}
|
|
|
|
|
|
- activity?.toolbar?.setTitleTextColor(
|
|
|
+ (activity as? MainActivity)?.binding?.toolbar?.setTitleTextColor(
|
|
|
Color.argb(
|
|
|
calculatedAlpha,
|
|
|
toolbarTextColor.red,
|
|
@@ -506,7 +504,7 @@ class MangaController :
|
|
|
private fun toggleFavorite() {
|
|
|
val isNowFavorite = presenter.toggleFavorite()
|
|
|
if (activity != null && !isNowFavorite && presenter.hasDownloads()) {
|
|
|
- activity!!.root_coordinator?.snack(activity!!.getString(R.string.delete_downloads_for_manga)) {
|
|
|
+ (activity as? MainActivity)?.binding?.rootCoordinator?.snack(activity!!.getString(R.string.delete_downloads_for_manga)) {
|
|
|
setAction(R.string.action_delete) {
|
|
|
presenter.deleteDownloads()
|
|
|
}
|
|
@@ -907,7 +905,7 @@ class MangaController :
|
|
|
val manga = presenter.manga
|
|
|
presenter.downloadChapters(chapters)
|
|
|
if (view != null && !manga.favorite) {
|
|
|
- addSnackbar = activity!!.root_coordinator?.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), Snackbar.LENGTH_INDEFINITE) {
|
|
|
setAction(R.string.action_add) {
|
|
|
addToLibrary(manga)
|
|
|
}
|