Merge pull request #4139 from nextcloud/bugfix/4010/fixSendTextToTalkApp

fix to display text that was sent to app via "share to"
This commit is contained in:
Marcel Hibbe 2024-09-06 15:25:49 +02:00 committed by GitHub
commit 129ba94af5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -247,11 +247,13 @@ class MessageInputFragment : Fragment() {
} }
private fun restoreState() { private fun restoreState() {
requireContext().getSharedPreferences(chatActivity.localClassName, AppCompatActivity.MODE_PRIVATE).apply { if (binding.fragmentMessageInputView.inputEditText.text.isEmpty()) {
val text = getString(chatActivity.roomToken, "") requireContext().getSharedPreferences(chatActivity.localClassName, AppCompatActivity.MODE_PRIVATE).apply {
val cursor = getInt(chatActivity.roomToken + CURSOR_KEY, 0) val text = getString(chatActivity.roomToken, "")
binding.fragmentMessageInputView.messageInput.setText(text) val cursor = getInt(chatActivity.roomToken + CURSOR_KEY, 0)
binding.fragmentMessageInputView.messageInput.setSelection(cursor) binding.fragmentMessageInputView.messageInput.setText(text)
binding.fragmentMessageInputView.messageInput.setSelection(cursor)
}
} }
} }