Clean code and add changelog

This commit is contained in:
ganfra 2021-09-30 12:02:05 +02:00
parent a171f1912a
commit 535a2c931b
7 changed files with 6 additions and 11 deletions

1
changelog.d/4077.bugfix Normal file
View File

@ -0,0 +1 @@
Fix Reply/Edit mode animation is broken when sending

View File

@ -1393,7 +1393,7 @@ class RoomDetailFragment @Inject constructor(
views.voiceMessageRecorderView.isVisible = !textComposerState.isSendButtonVisible
views.composerLayout.views.sendButton.isInvisible = !textComposerState.isSendButtonVisible
views.composerLayout.setRoomEncrypted(summary.isEncrypted)
//views.composerLayout.alwaysShowSendButton = false
// views.composerLayout.alwaysShowSendButton = false
if (textComposerState.canSendMessage) {
views.notificationAreaView.render(NotificationAreaView.State.Hidden)
} else {

View File

@ -18,10 +18,8 @@ package im.vector.app.features.home.room.detail
import android.net.Uri
import android.view.View
import androidx.annotation.StringRes
import im.vector.app.core.platform.VectorViewEvents
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.util.MatrixItem
import org.matrix.android.sdk.internal.crypto.model.event.WithHeldCode

View File

@ -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.model.RoomMemberSummary
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.widgets.model.Widget
import org.matrix.android.sdk.api.session.widgets.model.WidgetType
sealed class UnreadState {
object Unknown : UnreadState()
object HasNoUnread : UnreadState()

View File

@ -17,7 +17,6 @@
package im.vector.app.features.home.room.detail.composer
import im.vector.app.core.platform.VectorViewModelAction
import im.vector.app.features.home.room.detail.RoomDetailAction
sealed class TextComposerAction : VectorViewModelAction {
data class SaveDraft(val draft: String) : TextComposerAction()

View File

@ -24,7 +24,6 @@ import android.view.ViewGroup
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet
import androidx.core.text.toSpannable
import androidx.core.view.isInvisible
import androidx.transition.ChangeBounds
import androidx.transition.Fade
import androidx.transition.Transition
@ -107,12 +106,12 @@ class TextComposerView @JvmOverloads constructor(
applyNewConstraintSet(animate, transitionComplete)
}
fun setTextIfDifferent(text: CharSequence?): Boolean{
fun setTextIfDifferent(text: CharSequence?): Boolean {
return views.composerEditText.setTextIfDifferent(text)
}
private fun applyNewConstraintSet(animate: Boolean, transitionComplete: (() -> Unit)?) {
//val wasSendButtonInvisible = views.sendButton.isInvisible
// val wasSendButtonInvisible = views.sendButton.isInvisible
if (animate) {
configureAndBeginTransition(transitionComplete)
}
@ -121,7 +120,7 @@ class TextComposerView @JvmOverloads constructor(
it.applyTo(this)
}
// 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) {

View File

@ -46,7 +46,7 @@ data class TextComposerViewState(
val canSendMessage: Boolean = true,
val isVoiceRecording: Boolean = false,
val isSendButtonVisible : Boolean = false,
val sendMode: SendMode = SendMode.REGULAR("", false),
val sendMode: SendMode = SendMode.REGULAR("", false)
) : MvRxState {
val isComposerVisible: Boolean