mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Prevent screen to turn off while recording a voice message
This commit is contained in:
parent
c40135625c
commit
1f70aeb4dd
1 changed files with 11 additions and 0 deletions
|
|
@ -299,6 +299,17 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
|||
chatSendingViewModel.onTextToSendChanged(it)
|
||||
}
|
||||
|
||||
chatSendingViewModel.isVoiceRecording.observe(
|
||||
viewLifecycleOwner
|
||||
) { voiceRecording ->
|
||||
// Keep screen on while recording voice message
|
||||
if (voiceRecording) {
|
||||
requireActivity().window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||
} else {
|
||||
requireActivity().window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||
}
|
||||
}
|
||||
|
||||
chatSendingViewModel.requestRecordAudioPermissionEvent.observe(
|
||||
viewLifecycleOwner
|
||||
) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue