mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-23 05:25:31 +03:00
In this PR
- Drafts are now saved in between rooms. Signed-off-by: Julius Linus <julius.linus@nextcloud.com>
This commit is contained in:
parent
d0d170f0bc
commit
e5afa96e26
2 changed files with 13 additions and 0 deletions
|
@ -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 a new issue