From eeafcde6e90317d3072547ad74bcdb701ed771a6 Mon Sep 17 00:00:00 2001 From: juntao Date: Tue, 11 Jan 2022 16:03:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B8=B8=E6=88=8F=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E5=BF=AB=E9=80=9F=E6=9B=B4=E6=96=B0=E6=97=B6=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E9=87=8D=E5=A4=8D=E6=A0=87=E7=AD=BE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20https://git.shanqu.cc/pm/halo-app-issues/-/issues/1?= =?UTF-8?q?680?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/gh/common/util/GameViewUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/gh/common/util/GameViewUtils.java b/app/src/main/java/com/gh/common/util/GameViewUtils.java index 35ba08bbc2..70df1a507f 100644 --- a/app/src/main/java/com/gh/common/util/GameViewUtils.java +++ b/app/src/main/java/com/gh/common/util/GameViewUtils.java @@ -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); + }); }); }