mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 14:27:24 +00:00
Merge pull request #3224 from nextcloud/issue-1918-chat-message-draft
Message drafts are now saved
This commit is contained in:
commit
1f6ced7c65
@ -480,6 +480,10 @@ class ChatActivity :
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
active = true
|
||||
context.getSharedPreferences(localClassName, MODE_PRIVATE).apply {
|
||||
val text = getString(roomToken, "")
|
||||
binding.messageInputView.messageInput.setText(text)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
@ -495,6 +499,14 @@ class ChatActivity :
|
||||
if (currentlyPlayedVoiceMessage != null) {
|
||||
stopMediaPlayer(currentlyPlayedVoiceMessage!!)
|
||||
}
|
||||
val text = binding.messageInputView.messageInput.text.toString()
|
||||
val previous = context.getSharedPreferences(localClassName, MODE_PRIVATE).getString(roomToken, "null")
|
||||
if (text != previous) {
|
||||
context.getSharedPreferences(localClassName, MODE_PRIVATE).edit().apply {
|
||||
putString(roomToken, text)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("LongMethod")
|
||||
|
@ -698,5 +698,6 @@ How to translate with transifex:
|
||||
<string name="nc_settings_socks_value" translatable="false">1080</string>
|
||||
<string name="this_is_a_test_message">This is a test message</string>
|
||||
<string name="continuous_voice_message_recording">Lock recording for continuously recording of the voice message</string>
|
||||
<string name="saved_draft_message">Saved draft message.</string>
|
||||
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user