Fix viewbinding npe crashes.

This commit is contained in:
Onuray Sahin 2021-01-22 15:34:40 +03:00
parent 618d1f5de6
commit 883a7cecf0
4 changed files with 9 additions and 3 deletions

View file

@ -10,6 +10,7 @@ Improvements 🙌:
Bugfix 🐛:
- Fix clear cache issue: sometimes, after a clear cache, there is still a token, so the init sync service is not started.
- Sidebar too large in horizontal orientation or tablets (#475)
- Crashes reported by PlayStore (new in 1.0.14) (#2707)
Translations 🗣:
-

View file

@ -196,6 +196,8 @@ class UiAllScreensSanityTest {
pressBack()
clickMenu(R.id.video_call)
pressBack()
clickMenu(R.id.search)
pressBack()
pressBack()
}

View file

@ -297,6 +297,8 @@ class RoomDetailFragment @Inject constructor(
private var lockSendButton = false
private val activeCallViewHolder = ActiveCallViewHolder()
private lateinit var emojiPopup: EmojiPopup
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
sharedActionViewModel = activityViewModelProvider.get(MessageSharedActionViewModel::class.java)
@ -512,7 +514,7 @@ class RoomDetailFragment @Inject constructor(
}
private fun setupEmojiPopup() {
val emojiPopup = EmojiPopup
emojiPopup = EmojiPopup
.Builder
.fromRootView(views.rootConstraintLayout)
.setKeyboardAnimationStyle(R.style.emoji_fade_animation_style)
@ -591,6 +593,7 @@ class RoomDetailFragment @Inject constructor(
autoCompleter.clear()
debouncer.cancelAll()
views.timelineRecyclerView.cleanup()
emojiPopup.dismiss()
super.onDestroyView()
}

View file

@ -76,10 +76,10 @@ class SearchFragment @Inject constructor(
controller.listener = this
}
override fun onDestroy() {
super.onDestroy()
override fun onDestroyView() {
views.searchResultRecycler.cleanup()
controller.listener = null
super.onDestroyView()
}
override fun invalidate() = withState(searchViewModel) { state ->