Skip to content

Commit

Permalink
Fix crash when settings is closed quickly
Browse files Browse the repository at this point in the history
  • Loading branch information
moezbhatti committed Sep 5, 2018
1 parent c42de6f commit e285892
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down

0 comments on commit e285892

Please sign in to comment.