Fix crash when settings is closed quickly

This commit is contained in:
Moez Bhatti
2018-09-05 00:37:16 -04:00
parent c42de6f827
commit e285892424
4 changed files with 5 additions and 5 deletions
@@ -65,7 +65,7 @@ class ConversationInfoController(val threadId: Long = 0) : QkController<Conversa
}
override fun onViewCreated() {
items.postDelayed({ items.animateLayoutChanges = true }, 100)
items.postDelayed({ items?.animateLayoutChanges = true }, 100)
mediaAdapter.thumbnailClicks
.autoDisposable(scope())
@@ -65,7 +65,7 @@ class NotificationPrefsActivity : QkThemedActivity(), NotificationPrefsView {
showBackButton(true)
viewModel.bindView(this)
preferences.postDelayed({ preferences.animateLayoutChanges = true }, 100)
preferences.postDelayed({ preferences?.animateLayoutChanges = true }, 100)
val hasOreo = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
@@ -72,7 +72,7 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
}
override fun onViewCreated() {
preferences.postDelayed({ preferences.animateLayoutChanges = true }, 100)
preferences.postDelayed({ preferences?.animateLayoutChanges = true }, 100)
nightModeDialog.adapter.setData(R.array.night_modes)
textSizeDialog.adapter.setData(R.array.text_sizes)
@@ -62,8 +62,8 @@ class SwipeActionsController : QkController<SwipeActionsView, SwipeActionsState,
leftIcon.setTint(theme.textPrimary)
}
right.postDelayed({ right.animateLayoutChanges = true }, 100)
left.postDelayed({ left.animateLayoutChanges = true }, 100)
right.postDelayed({ right?.animateLayoutChanges = true }, 100)
left.postDelayed({ left?.animateLayoutChanges = true }, 100)
Observable.merge(
right.clicks().map { SwipeActionsView.Action.RIGHT },