【光环助手V5.3.0】专题合集-排行榜功能优化(20210926UI测试)https://git.ghzs.com/pm/halo-app-issues/-/issues/1471#note_119218

This commit is contained in:
lyr
2021-09-27 11:56:21 +08:00
parent 056985531b
commit 7540659396
8 changed files with 54 additions and 26 deletions

View File

@ -34,18 +34,10 @@ import java.util.TimeZone;
public class GameViewUtils {
public static void setLabelList(Context context, LinearLayout labelLayout, List<TagStyleEntity> tagStyle) {
setLabelList(context, labelLayout, tagStyle, 8, false);
}
public static void setLabelList(Context context, LinearLayout labelLayout, List<TagStyleEntity> tagStyle, boolean isUseColumn) {
setLabelList(context, labelLayout, tagStyle, 8, isUseColumn);
setLabelList(context, labelLayout, tagStyle, 8);
}
public static void setLabelList(Context context, LinearLayout labelLayout, List<TagStyleEntity> tagStyle, int margin) {
setLabelList(context, labelLayout, tagStyle, margin, false);
}
public static void setLabelList(Context context, LinearLayout labelLayout, List<TagStyleEntity> tagStyle, int margin, boolean isUseColumn) {
labelLayout.removeAllViews();
if (tagStyle == null || tagStyle.isEmpty()) {
// 没有数据的话默认不显示
@ -54,7 +46,7 @@ public class GameViewUtils {
// labelLayout.addView(getNewGameTagView(context, tagEntity, 0));
} else {
for (int i = 0, size = tagStyle.size(); i < size; i++) {
View view = getNewGameTagView(context, tagStyle.get(i), i == size - 1 ? 0 : DisplayUtils.dip2px(context, margin), isUseColumn);
View view = getNewGameTagView(context, tagStyle.get(i), i == size - 1 ? 0 : DisplayUtils.dip2px(context, margin));
labelLayout.addView(view);
if (labelLayout.getChildCount() == 3) {
break;
@ -86,7 +78,7 @@ public class GameViewUtils {
}
// 新的游戏标签样式 version>=4.0.0
private static TextView getNewGameTagView(Context context, TagStyleEntity tagEntity, int rightMargin, boolean isUseColumn) {
private static TextView getNewGameTagView(Context context, TagStyleEntity tagEntity, int rightMargin) {
// 参数不全,用旧样式实现
if (TextUtils.isEmpty(tagEntity.getBackground())) {
return getGameTagView(context, tagEntity.getName(), rightMargin, "type", tagEntity);
@ -106,11 +98,7 @@ public class GameViewUtils {
DisplayUtils.dip2px(context, 4),
DisplayUtils.dip2px(context, 1));
if (isUseColumn && !TextUtils.isEmpty(tagEntity.getColumn())) {
tag.setTextColor(Color.parseColor("#" + tagEntity.getColumn()));
} else {
tag.setTextColor(Color.parseColor("#" + tagEntity.getColor()));
}
tag.setTextColor(Color.parseColor("#" + tagEntity.getColor()));
tag.setBackground(DrawableView.getServerDrawable(Color.parseColor("#" + tagEntity.getBackground())));
return tag;
}