Merge pull request #4095 from nextcloud/issue-4094-message-input-fragment-fix

Messages are no longer lost in between lifecycle events
This commit is contained in:
Sowjanya Kota 2024-08-21 17:20:40 +02:00 committed by GitHub
commit 1f66add36b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -332,6 +332,8 @@ class ChatActivity :
}
}
private lateinit var messageInputFragment: MessageInputFragment
val typingParticipants = HashMap<String, TypingParticipant>()
var callStarted = false
@ -398,6 +400,8 @@ class ChatActivity :
setContentView(binding.root)
setupSystemColors()
messageInputFragment = MessageInputFragment()
conversationUser = currentUserProvider.currentUser.blockingGet()
handleIntent(intent)
@ -579,7 +583,7 @@ class ChatActivity :
supportFragmentManager.commit {
setReorderingAllowed(true) // optimizes out redundant replace operations
replace(R.id.fragment_container_activity_chat, MessageInputFragment())
replace(R.id.fragment_container_activity_chat, messageInputFragment)
}
joinRoomWithPassword()

View File

@ -136,9 +136,13 @@ class MessageInputFragment : Fragment() {
return binding.root
}
override fun onPause() {
super.onPause()
saveState()
}
override fun onDestroyView() {
super.onDestroyView()
saveState()
if (mentionAutocomplete != null && mentionAutocomplete!!.isPopupShowing) {
mentionAutocomplete?.dismissPopup()
}