Clean code and add changelog
This commit is contained in:
parent
a171f1912a
commit
535a2c931b
1
changelog.d/4077.bugfix
Normal file
1
changelog.d/4077.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix Reply/Edit mode animation is broken when sending
|
@ -1393,7 +1393,7 @@ class RoomDetailFragment @Inject constructor(
|
|||||||
views.voiceMessageRecorderView.isVisible = !textComposerState.isSendButtonVisible
|
views.voiceMessageRecorderView.isVisible = !textComposerState.isSendButtonVisible
|
||||||
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
|
||||||
if (textComposerState.canSendMessage) {
|
if (textComposerState.canSendMessage) {
|
||||||
views.notificationAreaView.render(NotificationAreaView.State.Hidden)
|
views.notificationAreaView.render(NotificationAreaView.State.Hidden)
|
||||||
} else {
|
} else {
|
||||||
|
@ -18,10 +18,8 @@ package im.vector.app.features.home.room.detail
|
|||||||
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.annotation.StringRes
|
|
||||||
import im.vector.app.core.platform.VectorViewEvents
|
import im.vector.app.core.platform.VectorViewEvents
|
||||||
import im.vector.app.features.call.webrtc.WebRtcCall
|
import im.vector.app.features.call.webrtc.WebRtcCall
|
||||||
import im.vector.app.features.command.Command
|
|
||||||
import org.matrix.android.sdk.api.session.widgets.model.Widget
|
import org.matrix.android.sdk.api.session.widgets.model.Widget
|
||||||
import org.matrix.android.sdk.api.util.MatrixItem
|
import org.matrix.android.sdk.api.util.MatrixItem
|
||||||
import org.matrix.android.sdk.internal.crypto.model.event.WithHeldCode
|
import org.matrix.android.sdk.internal.crypto.model.event.WithHeldCode
|
||||||
|
@ -25,12 +25,10 @@ import org.matrix.android.sdk.api.session.initsync.SyncStatusService
|
|||||||
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
|
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
|
||||||
import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary
|
import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary
|
||||||
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
||||||
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
|
|
||||||
import org.matrix.android.sdk.api.session.sync.SyncState
|
import org.matrix.android.sdk.api.session.sync.SyncState
|
||||||
import org.matrix.android.sdk.api.session.widgets.model.Widget
|
import org.matrix.android.sdk.api.session.widgets.model.Widget
|
||||||
import org.matrix.android.sdk.api.session.widgets.model.WidgetType
|
import org.matrix.android.sdk.api.session.widgets.model.WidgetType
|
||||||
|
|
||||||
|
|
||||||
sealed class UnreadState {
|
sealed class UnreadState {
|
||||||
object Unknown : UnreadState()
|
object Unknown : UnreadState()
|
||||||
object HasNoUnread : UnreadState()
|
object HasNoUnread : UnreadState()
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
package im.vector.app.features.home.room.detail.composer
|
package im.vector.app.features.home.room.detail.composer
|
||||||
|
|
||||||
import im.vector.app.core.platform.VectorViewModelAction
|
import im.vector.app.core.platform.VectorViewModelAction
|
||||||
import im.vector.app.features.home.room.detail.RoomDetailAction
|
|
||||||
|
|
||||||
sealed class TextComposerAction : VectorViewModelAction {
|
sealed class TextComposerAction : VectorViewModelAction {
|
||||||
data class SaveDraft(val draft: String) : TextComposerAction()
|
data class SaveDraft(val draft: String) : TextComposerAction()
|
||||||
|
@ -24,7 +24,6 @@ import android.view.ViewGroup
|
|||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.constraintlayout.widget.ConstraintSet
|
import androidx.constraintlayout.widget.ConstraintSet
|
||||||
import androidx.core.text.toSpannable
|
import androidx.core.text.toSpannable
|
||||||
import androidx.core.view.isInvisible
|
|
||||||
import androidx.transition.ChangeBounds
|
import androidx.transition.ChangeBounds
|
||||||
import androidx.transition.Fade
|
import androidx.transition.Fade
|
||||||
import androidx.transition.Transition
|
import androidx.transition.Transition
|
||||||
@ -107,12 +106,12 @@ class TextComposerView @JvmOverloads constructor(
|
|||||||
applyNewConstraintSet(animate, transitionComplete)
|
applyNewConstraintSet(animate, transitionComplete)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setTextIfDifferent(text: CharSequence?): Boolean{
|
fun setTextIfDifferent(text: CharSequence?): Boolean {
|
||||||
return views.composerEditText.setTextIfDifferent(text)
|
return views.composerEditText.setTextIfDifferent(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun applyNewConstraintSet(animate: Boolean, transitionComplete: (() -> Unit)?) {
|
private fun applyNewConstraintSet(animate: Boolean, transitionComplete: (() -> Unit)?) {
|
||||||
//val wasSendButtonInvisible = views.sendButton.isInvisible
|
// val wasSendButtonInvisible = views.sendButton.isInvisible
|
||||||
if (animate) {
|
if (animate) {
|
||||||
configureAndBeginTransition(transitionComplete)
|
configureAndBeginTransition(transitionComplete)
|
||||||
}
|
}
|
||||||
@ -121,7 +120,7 @@ class TextComposerView @JvmOverloads constructor(
|
|||||||
it.applyTo(this)
|
it.applyTo(this)
|
||||||
}
|
}
|
||||||
// Might be updated by view state just after, but avoid blinks
|
// Might be updated by view state just after, but avoid blinks
|
||||||
//views.sendButton.isInvisible = wasSendButtonInvisible
|
// views.sendButton.isInvisible = wasSendButtonInvisible
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun configureAndBeginTransition(transitionComplete: (() -> Unit)? = null) {
|
private fun configureAndBeginTransition(transitionComplete: (() -> Unit)? = null) {
|
||||||
|
@ -46,7 +46,7 @@ data class TextComposerViewState(
|
|||||||
val canSendMessage: Boolean = true,
|
val canSendMessage: Boolean = true,
|
||||||
val isVoiceRecording: Boolean = false,
|
val isVoiceRecording: Boolean = false,
|
||||||
val isSendButtonVisible : Boolean = false,
|
val isSendButtonVisible : Boolean = false,
|
||||||
val sendMode: SendMode = SendMode.REGULAR("", false),
|
val sendMode: SendMode = SendMode.REGULAR("", false)
|
||||||
) : MvRxState {
|
) : MvRxState {
|
||||||
|
|
||||||
val isComposerVisible: Boolean
|
val isComposerVisible: Boolean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user