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
if (mainState.tombstoneEvent == null) {
views.composerLayout.isInvisible = !textComposerState.isComposerVisible
views.voiceMessageRecorderView.isVisible = !textComposerState.isSendButtonVisible
views.voiceMessageRecorderView.isVisible = textComposerState.isVoiceMessageRecorderVisible
views.composerLayout.views.sendButton.isInvisible = !textComposerState.isSendButtonVisible
views.composerLayout.setRoomEncrypted(summary.isEncrypted)
// views.composerLayout.alwaysShowSendButton = false

View File

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