检查for循环中的remove,检查response的length != 0
This commit is contained in:
@ -41,22 +41,6 @@ public class GameViewUtils {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取游戏标签列表视图
|
||||
public static void setLabelList(Context context, LinearLayout labelLayout, String tag) {
|
||||
labelLayout.removeAllViews();
|
||||
// 添加tag标签
|
||||
if (tag != null && !tag.isEmpty()) {
|
||||
String[] tags = tag.split(",");
|
||||
for (int i = 0; i < tags.length; i++) {
|
||||
if (i == tags.length - 1) {
|
||||
labelLayout.addView(getGameTagView(context, tags[i], 0));
|
||||
} else {
|
||||
labelLayout.addView(getGameTagView(context, tags[i], DisplayUtils.dip2px(context, 5)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static TextView getGameTagView(Context context, String tagStr, int rightMargin) {
|
||||
LinearLayout.LayoutParams lparams = new LinearLayout.LayoutParams(
|
||||
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
|
||||
|
||||
Reference in New Issue
Block a user