mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 03:29:28 +01:00
this should work - didn't test yet tho
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
This commit is contained in:
parent
65e5be4798
commit
03c5d2561e
@ -506,10 +506,15 @@ class ChatActivity :
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
chatViewModel.handleOrientationChange()
|
||||
chatViewModel.handleSavedInstance()
|
||||
super.onSaveInstanceState(outState)
|
||||
}
|
||||
|
||||
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
|
||||
chatViewModel.handleRestoreInstance()
|
||||
super.onRestoreInstanceState(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
active = false
|
||||
|
@ -35,6 +35,7 @@ class MediaRecorderManager : LifecycleAwareManager {
|
||||
}
|
||||
|
||||
var currentVoiceRecordFile: String = ""
|
||||
private var lockRecording = false
|
||||
|
||||
enum class MediaRecorderState {
|
||||
INITIAL,
|
||||
@ -166,6 +167,12 @@ class MediaRecorderManager : LifecycleAwareManager {
|
||||
}
|
||||
|
||||
override fun handleOnStop() {
|
||||
stop()
|
||||
if (!lockRecording) {
|
||||
stop()
|
||||
}
|
||||
}
|
||||
|
||||
fun lockRecording(shouldLock: Boolean) {
|
||||
lockRecording = shouldLock
|
||||
}
|
||||
}
|
||||
|
@ -667,8 +667,13 @@ class ChatViewModel @Inject constructor(
|
||||
audioFocusRequestManager.audioFocusRequest(request, callback)
|
||||
}
|
||||
|
||||
fun handleOrientationChange() {
|
||||
fun handleSavedInstance() {
|
||||
_getCapabilitiesViewState.value = GetCapabilitiesStartState
|
||||
mediaRecorderManager.lockRecording(true)
|
||||
}
|
||||
|
||||
fun handleRestoreInstance() {
|
||||
mediaRecorderManager.lockRecording(false)
|
||||
}
|
||||
|
||||
fun getMessageById(url: String, conversationModel: ConversationModel, messageId: Long): Flow<ChatMessage> =
|
||||
|
Loading…
Reference in New Issue
Block a user