Fix voice message record button wrong visibility #4283

This commit is contained in:
ganfra 2021-10-21 11:35:08 +02:00
parent 7c9c4ecf5f
commit d33daaf799
3 changed files with 4 additions and 3 deletions

1
changelog.d/4283.bugfix Normal file
View file

@ -0,0 +1 @@
Fix voice message record button wrong visibility

View file

@ -1390,7 +1390,7 @@ class RoomDetailFragment @Inject constructor(
lazyLoadedViews.inviteView(false)?.isVisible = false lazyLoadedViews.inviteView(false)?.isVisible = false
if (mainState.tombstoneEvent == null) { if (mainState.tombstoneEvent == null) {
views.composerLayout.isInvisible = !textComposerState.isComposerVisible views.composerLayout.isInvisible = !textComposerState.isComposerVisible
views.voiceMessageRecorderView.isVisible = !textComposerState.isSendButtonVisible views.voiceMessageRecorderView.isVisible = textComposerState.isVoiceMessageRecorderVisible
views.composerLayout.views.sendButton.isInvisible = !textComposerState.isSendButtonVisible views.composerLayout.views.sendButton.isInvisible = !textComposerState.isSendButtonVisible
views.composerLayout.setRoomEncrypted(summary.isEncrypted) views.composerLayout.setRoomEncrypted(summary.isEncrypted)
// views.composerLayout.alwaysShowSendButton = false // views.composerLayout.alwaysShowSendButton = false

View file

@ -49,8 +49,8 @@ data class TextComposerViewState(
val sendMode: SendMode = SendMode.REGULAR("", false) val sendMode: SendMode = SendMode.REGULAR("", false)
) : MavericksState { ) : MavericksState {
val isComposerVisible: Boolean val isComposerVisible = canSendMessage && !isVoiceRecording
get() = canSendMessage && !isVoiceRecording val isVoiceMessageRecorderVisible = canSendMessage && !isSendButtonVisible
constructor(args: RoomDetailArgs) : this(roomId = args.roomId) constructor(args: RoomDetailArgs) : this(roomId = args.roomId)
} }