Commit 155d644c by wjg

add release apk

parent 50bee6e4
......@@ -28,14 +28,14 @@ public class Goods implements Serializable {
/** 是否是特惠商品 */
private Integer isRecommend;
/** 特惠标签 */
private String recommendTag;
private List<String> recommendTagList;
public String getRecommendTag() {
return recommendTag;
public List<String> getRecommendTagList() {
return recommendTagList;
}
public void setRecommendTag(String recommendTag) {
this.recommendTag = recommendTag;
public void setRecommendTagList(List<String> recommendTagList) {
this.recommendTagList = recommendTagList;
}
public Integer getIsRecommend() {
......
......@@ -52,25 +52,31 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
LinearLayout layoutTag = helper.getView(R.id.layout_tags);
layoutTag.removeAllViews();
if (!StringUtils.isEmpty(goods.getRecommendTag())) {
// 特惠标签
int recommendTagSize = 0;
if (!CollectionUtils.isEmpty(goods.getRecommendTagList())) {
recommendTagSize = goods.getRecommendTagList().size();
helper.setVisible(R.id.layout_tags, true);
for (int i = 0; i < goods.getRecommendTagList().size(); i++) {
View tagView = LayoutInflater.from(mContext).inflate(R.layout.item_tag_recommend, null);
((TextView) tagView.findViewById(R.id.txt_tag)).setText(goods.getRecommendTag());
((TextView) tagView.findViewById(R.id.txt_tag)).setText(goods.getRecommendTagList().get(i));
layoutTag.addView(tagView);
}
if (CollectionUtils.isEmpty(goods.getTags()) && StringUtils.isEmpty(goods.getRecommendTag())) {
helper.setVisible(R.id.layout_tags, false);
View tagView = LayoutInflater.from(mContext).inflate(R.layout.item_tag, null);
layoutTag.addView(tagView);
} else {
}
// 普通标签
if (!CollectionUtils.isEmpty(goods.getTags())) {
helper.setVisible(R.id.layout_tags, true);
for (int i = 0; i < goods.getTags().size() && i < 2; i++) {
for (int i = 0; i < goods.getTags().size() && i < (3 - recommendTagSize); i++) {
View tagView = LayoutInflater.from(mContext).inflate(R.layout.item_tag, null);
((TextView) tagView.findViewById(R.id.txt_tag)).setText(goods.getTags().get(i));
layoutTag.addView(tagView);
}
}
if (CollectionUtils.isEmpty(goods.getTags()) && CollectionUtils.isEmpty(goods.getRecommendTagList())) {
helper.setVisible(R.id.layout_tags, false);
View tagView = LayoutInflater.from(mContext).inflate(R.layout.item_tag, null);
layoutTag.addView(tagView);
}
ImageView imgThumbnail = helper.getView(R.id.img_thumbnail);
// RoundedCorners roundedCorners = new RoundedCorners(5);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment