mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-25 14:35:40 +03:00
fix to display text that was sent to app via "share to"
the bug was, that the sent text was overwritten with "" in restoreState. With this fix the saved state is only applied when the input field is empty (which means there was nothing shared) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
9e48c9a40f
commit
07cd9e1ced
1 changed files with 7 additions and 5 deletions
|
@ -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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue