mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 05:25:08 +01:00
More crash fixes
This commit is contained in:
parent
56d7331aae
commit
1f93f82752
@ -15,6 +15,7 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
|
||||
|
||||
val preferences: PreferencesHelper by injectLazy()
|
||||
lateinit var binding: VB
|
||||
val isBindingInitialized get() = this::binding.isInitialized
|
||||
|
||||
init {
|
||||
@Suppress("LeakingThis")
|
||||
|
@ -18,6 +18,7 @@ abstract class BaseController<VB : ViewBinding>(bundle: Bundle? = null) :
|
||||
|
||||
lateinit var binding: VB
|
||||
|
||||
val isBindingInitialized get() = this::binding.isInitialized
|
||||
init {
|
||||
addLifecycleListener(
|
||||
object : LifecycleListener() {
|
||||
|
@ -805,7 +805,7 @@ class LibraryController(
|
||||
|
||||
override fun onActivityResumed(activity: Activity) {
|
||||
super.onActivityResumed(activity)
|
||||
if (view == null) return
|
||||
if (!isBindingInitialized) return
|
||||
updateFilterSheetY()
|
||||
if (observeLater && ::presenter.isInitialized) {
|
||||
presenter.getLibrary()
|
||||
|
@ -395,6 +395,7 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), DownloadServiceLi
|
||||
if (router.backstackSize == 1 && this !is SearchActivity &&
|
||||
downloadManager.hasQueue() && !preferences.shownDownloadQueueTutorial().get()
|
||||
) {
|
||||
if (!isBindingInitialized) return
|
||||
val recentsItem = binding.bottomNav.getItemView(R.id.nav_recents) ?: return
|
||||
preferences.shownDownloadQueueTutorial().set(true)
|
||||
TapTargetView.showFor(
|
||||
|
@ -344,11 +344,10 @@ class RecentsController(bundle: Bundle? = null) :
|
||||
|
||||
override fun onActivityResumed(activity: Activity) {
|
||||
super.onActivityResumed(activity)
|
||||
if (view != null) {
|
||||
refresh()
|
||||
setBottomPadding()
|
||||
binding.downloadBottomSheet.dlBottomSheet.update()
|
||||
}
|
||||
if (!isBindingInitialized) return
|
||||
refresh()
|
||||
setBottomPadding()
|
||||
binding.downloadBottomSheet.dlBottomSheet.update()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
@ -375,6 +375,7 @@ class BrowseController :
|
||||
|
||||
override fun onActivityResumed(activity: Activity) {
|
||||
super.onActivityResumed(activity)
|
||||
if (!isBindingInitialized) return
|
||||
binding.bottomSheet.root.presenter.refreshExtensions()
|
||||
binding.bottomSheet.root.presenter.refreshMigrations()
|
||||
setBottomPadding()
|
||||
|
Loading…
Reference in New Issue
Block a user