修复游戏卡片快速更新时出现重复标签的问题 https://git.shanqu.cc/pm/halo-app-issues/-/issues/1680

This commit is contained in:
juntao
2022-01-11 16:03:11 +08:00
parent 0255fdbe33
commit eeafcde6e9

View File

@ -56,7 +56,12 @@ public class GameViewUtils {
} else {
AppExecutor.getLightWeightIoExecutor().execute(() -> {
TextView tv = getNewGameTagView(context, tagEntity, marginRight);
AppExecutor.getUiExecutor().execute(() -> labelLayout.addView(tv));
AppExecutor.getUiExecutor().execute(() -> {
// 快速刷新列表会出现重复标签被添加到布局中的问题,这里在实际执行代码前再检查一次数量
if (labelLayout.getChildCount() >= tagEntityList.size()) return;
labelLayout.addView(tv);
});
});
}