Slight improvement in the performance of Reaction Row's rendering
This commit is contained in:
@@ -156,12 +156,15 @@ private fun InnerReactionRow(
|
||||
verticalArrangement = Arrangement.Center,
|
||||
modifier = ReactionRowExpandButton
|
||||
) {
|
||||
val (value, elapsed) = measureTimedValue {
|
||||
Row(verticalAlignment = CenterVertically) {
|
||||
WatchReactionsZapsBoostsAndDisplayIfExists(baseNote) {
|
||||
RenderShowIndividualReactionsButton(wantsToSeeReactions)
|
||||
}
|
||||
}
|
||||
}
|
||||
Log.d("Rendering Metrics", "Reactions Button: ${baseNote.event?.content()?.split("\n")?.getOrNull(0)?.take(15)}.. $elapsed")
|
||||
}
|
||||
}
|
||||
|
||||
Column(
|
||||
@@ -324,12 +327,10 @@ private fun WatchReactionsZapsBoostsAndDisplayIfExists(baseNote: Note, content:
|
||||
baseNote.reactions.isNotEmpty()
|
||||
)
|
||||
|
||||
Crossfade(targetState = hasReactions) {
|
||||
if (it) {
|
||||
if (hasReactions) {
|
||||
content()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun <T, K, R> LiveData<T>.combineWith(
|
||||
liveData1: LiveData<K>,
|
||||
|
||||
Reference in New Issue
Block a user