Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix voice message record button wrong visibility #4284

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/4283.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix voice message record button wrong visibility
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ data class TextComposerViewState(
val sendMode: SendMode = SendMode.REGULAR("", false)
) : MavericksState {

val isComposerVisible: Boolean
get() = canSendMessage && !isVoiceRecording
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 for removing the get when everything is val

val isComposerVisible = canSendMessage && !isVoiceRecording
val isVoiceMessageRecorderVisible = canSendMessage && !isSendButtonVisible

constructor(args: RoomDetailArgs) : this(roomId = args.roomId)
}