Fix visibility of microphone icon.

This commit is contained in:
Onuray Sahin 2021-07-06 14:29:56 +03:00
parent 7a1b138894
commit 6cb53c991a
2 changed files with 5 additions and 1 deletions

View File

@ -922,6 +922,8 @@ class RoomDetailFragment @Inject constructor(
autoCompleter.exitSpecialMode()
views.composerLayout.collapse()
views.voiceMessageRecorderView.isVisible = text.isBlank()
updateComposerText(text)
views.composerLayout.views.sendButton.contentDescription = getString(R.string.send)
}
@ -968,6 +970,7 @@ class RoomDetailFragment @Inject constructor(
// need to do it here also when not using quick reply
focusComposerAndShowKeyboard()
views.composerLayout.views.composerRelatedMessageImage.isVisible = isImageVisible
views.voiceMessageRecorderView.isVisible = false
}
}
focusComposerAndShowKeyboard()
@ -1256,6 +1259,7 @@ class RoomDetailFragment @Inject constructor(
if (text.isNotBlank()) {
// We collapse ASAP, if not there will be a slight anoying delay
views.composerLayout.collapse(true)
views.voiceMessageRecorderView.isVisible = true
lockSendButton = true
roomDetailViewModel.handle(RoomDetailAction.SendMessage(text, vectorPreferences.isMarkdownEnabled()))
emojiPopup.dismiss()

View File

@ -75,7 +75,6 @@ class TextComposerView @JvmOverloads constructor(
}
override fun onTextBlankStateChanged(isBlank: Boolean) {
callback?.onTextBlankStateChanged(isBlank)
val shouldShowSendButton = currentConstraintSetId == R.layout.composer_layout_constraint_set_expanded || !isBlank
TransitionManager.endTransitions(this@TextComposerView)
if (views.sendButton.isVisible != shouldShowSendButton) {
@ -85,6 +84,7 @@ class TextComposerView @JvmOverloads constructor(
)
views.sendButton.isInvisible = !shouldShowSendButton
}
callback?.onTextBlankStateChanged(isBlank)
}
}
views.composerRelatedMessageCloseButton.setOnClickListener {