Commit f44c9f91 by wjg

修改推荐、特惠bug

parent ef3fc397
...@@ -142,14 +142,13 @@ public class LauncherActivity extends Activity { ...@@ -142,14 +142,13 @@ public class LauncherActivity extends Activity {
private void setRecommendsData() { private void setRecommendsData() {
List<Recommend> recommends = HLApplication.getMainData().getRecommends(); List<Recommend> recommends = HLApplication.getMainData().getRecommends();
scrollRecommends = new ArrayList<>(); scrollRecommends = new ArrayList<>();
if (CollectionUtils.isEmpty(recommends)) { if (!CollectionUtils.isEmpty(recommends)) {
return;
}
for (int i = 0; i < recommends.size(); i++) { for (int i = 0; i < recommends.size(); i++) {
Recommend x = recommends.get(i); Recommend x = recommends.get(i);
x.setIndex(i); x.setIndex(i);
scrollRecommends.add(new ScrollBean(new ScrollBean.ScrollItemBean(x, null))); scrollRecommends.add(new ScrollBean(new ScrollBean.ScrollItemBean(x, null)));
} }
}
recommendAdapter.setNewData(scrollRecommends); recommendAdapter.setNewData(scrollRecommends);
} }
...@@ -270,9 +269,7 @@ public class LauncherActivity extends Activity { ...@@ -270,9 +269,7 @@ public class LauncherActivity extends Activity {
private void initCategorys() { private void initCategorys() {
groupCategory.removeAllViews(); groupCategory.removeAllViews();
List<Category> categorys = HLApplication.getMainData().getCategorys(); List<Category> categorys = HLApplication.getMainData().getCategorys();
if (CollectionUtils.isEmpty(categorys)) { if (!CollectionUtils.isEmpty(categorys)) {
return;
}
for (int i = 0; i < categorys.size(); i++) { for (int i = 0; i < categorys.size(); i++) {
Category category = categorys.get(i); Category category = categorys.get(i);
if (CollectionUtils.isEmpty(category.getGoods())) { if (CollectionUtils.isEmpty(category.getGoods())) {
...@@ -296,6 +293,7 @@ public class LauncherActivity extends Activity { ...@@ -296,6 +293,7 @@ public class LauncherActivity extends Activity {
goodsLayoutManager.scrollToPositionWithOffset(tPosition.get(position), 0); goodsLayoutManager.scrollToPositionWithOffset(tPosition.get(position), 0);
}); });
} }
}
groupCategory.setOnCheckedChangeListener((group, checkedId) -> { groupCategory.setOnCheckedChangeListener((group, checkedId) -> {
for (int i = 0; i < groupCategory.getChildCount(); i++) { for (int i = 0; i < groupCategory.getChildCount(); i++) {
View child = groupCategory.getChildAt(i); View child = groupCategory.getChildAt(i);
......
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