perf: reduce high-refresh ui churn

This commit is contained in:
kris
2026-04-04 01:16:48 +08:00
parent 31004c512a
commit 35bcf92d72
2 changed files with 36 additions and 56 deletions

View File

@@ -103,6 +103,39 @@ public class BossUiConversationRowTest {
assertEquals("上下文环本体应更细更轻", BossUi.dp(context, 16), ringWrap.getChildAt(0).getLayoutParams().height);
}
@Test
public void buildConversationRow_usesStaticActivityDotsForHighRefreshSmoothness() {
Context context = RuntimeEnvironment.getApplication();
WechatSurfaceMapper.ConversationRow row = new WechatSurfaceMapper.ConversationRow(
"硬件审计协作",
"Mac Studio",
"检查摄像头供电链路",
"09:42",
0,
"",
2,
false,
"M",
"W",
new WechatSurfaceMapper.GroupAvatarMember[0],
false,
null,
null,
-1,
false,
false
);
LinearLayout rowView = BossUi.buildConversationRow(context, row, null);
LinearLayout trailingColumn = (LinearLayout) rowView.getChildAt(2);
LinearLayout activityWrap = (LinearLayout) trailingColumn.getChildAt(1);
View firstDot = activityWrap.getChildAt(0);
assertEquals("高刷设备上活动点应保持静态,不再从低 alpha 开始做无限动画", 0.92f, firstDot.getAlpha(), 0.01f);
assertEquals("高刷设备上活动点不应缩放动画起步", 1f, firstDot.getScaleX(), 0.01f);
assertEquals("高刷设备上活动点不应缩放动画起步", 1f, firstDot.getScaleY(), 0.01f);
}
@Test
public void buildConversationRow_usesSubtlePinnedBackgroundWithoutPinnedBadge() {
Context context = RuntimeEnvironment.getApplication();