Show pending edits by fading the event body #193

+ Fix issues with edits local echo management in aggregation
This commit is contained in:
Valere
2019-07-19 16:13:35 +02:00
parent c00dbce536
commit 40a68c3e9f
4 changed files with 39 additions and 20 deletions

View File

@ -29,6 +29,7 @@ import androidx.core.view.children
import androidx.core.view.isGone
import androidx.core.view.isVisible
import com.airbnb.epoxy.EpoxyAttribute
import im.vector.matrix.android.api.session.room.send.SendState
import im.vector.riotx.R
import im.vector.riotx.core.resources.ColorProvider
import im.vector.riotx.core.utils.DebouncedClickListener
@ -163,7 +164,9 @@ abstract class AbsMessageItem<H : AbsMessageItem.Holder> : BaseEventItem<H>() {
protected fun renderSendState(root: View, textView: TextView?) {
root.isClickable = informationData.sendState.isSent()
textView?.setTextColor(colorProvider.getMessageTextColor(informationData.sendState))
val state = SendState.UNSENT.takeIf { informationData.hasPendingEdits }
?: informationData.sendState
textView?.setTextColor(colorProvider.getMessageTextColor(state))
}
abstract class Holder(@IdRes stubId: Int) : BaseHolder(stubId) {

View File

@ -31,7 +31,8 @@ data class MessageInformationData(
val showInformation: Boolean = true,
/*List of reactions (emoji,count,isSelected)*/
var orderedReactionList: List<ReactionInfoData>? = null,
var hasBeenEdited: Boolean = false
var hasBeenEdited: Boolean = false,
var hasPendingEdits: Boolean = false
) : Parcelable

View File

@ -74,7 +74,8 @@ class MessageInformationDataFactory @Inject constructor(private val timelineDate
?.map {
ReactionInfoData(it.key, it.count, it.addedByMe, it.localEchoEvents.isEmpty())
},
hasBeenEdited = hasBeenEdited
hasBeenEdited = hasBeenEdited,
hasPendingEdits = event.annotations?.editSummary?.localEchos?.any() ?: false
)
}
}