Commit 5082450e by wjg

优化字体

parent fd5787c0
...@@ -7,7 +7,9 @@ import android.util.Log; ...@@ -7,7 +7,9 @@ import android.util.Log;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.data.MainData; import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.data.TrolleyGoods; import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.vo.Category;
import com.ihaoin.hooloo.device.network.HttpUtil; import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.SharedPreferencesUtils; import com.ihaoin.hooloo.device.util.SharedPreferencesUtils;
import com.ihaoin.hooloo.device.util.StringUtils; import com.ihaoin.hooloo.device.util.StringUtils;
import com.umeng.commonsdk.UMConfigure; import com.umeng.commonsdk.UMConfigure;
...@@ -29,7 +31,19 @@ public class HLApplication extends Application { ...@@ -29,7 +31,19 @@ public class HLApplication extends Application {
} }
public static void setMainData(MainData data) { public static void setMainData(MainData data) {
mainData = data; mainData = clearEmptyCategory(data);
}
private static MainData clearEmptyCategory(MainData data) {
if (data != null && !CollectionUtils.isEmpty(data.getCategorys())) {
for (int i = data.getCategorys().size() - 1; i >= 0; i--) {
Category category = data.getCategorys().get(i);
if (CollectionUtils.isEmpty(category.getGoods())) {
data.getCategorys().remove(i);
}
}
}
return data;
} }
public static List<TrolleyGoods> getTrolleyGoods() { public static List<TrolleyGoods> getTrolleyGoods() {
......
...@@ -54,9 +54,6 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo ...@@ -54,9 +54,6 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
LinearLayout layoutTag = helper.getView(R.id.layout_tags); LinearLayout layoutTag = helper.getView(R.id.layout_tags);
layoutTag.removeAllViews(); layoutTag.removeAllViews();
// // TODO delete
// goods.setTags(Arrays.asList("一二", "一二三四", "一二三四五六七"));
if (CollectionUtils.isEmpty(goods.getTags())) { if (CollectionUtils.isEmpty(goods.getTags())) {
helper.setVisible(R.id.layout_tags, false); helper.setVisible(R.id.layout_tags, false);
View tagView = LayoutInflater.from(mContext).inflate(R.layout.item_tag, null); View tagView = LayoutInflater.from(mContext).inflate(R.layout.item_tag, null);
......
...@@ -130,7 +130,6 @@ public class HttpUtil { ...@@ -130,7 +130,6 @@ public class HttpUtil {
public static String getMacAddress() { public static String getMacAddress() {
try { try {
if (AppConfig.DEBUG) { // TODO delete if (AppConfig.DEBUG) { // TODO delete
return "SN0091290001"; return "SN0091290001";
} }
......
...@@ -295,8 +295,8 @@ public class LauncherActivity extends Activity { ...@@ -295,8 +295,8 @@ public class LauncherActivity extends Activity {
view.setOnClickListener(v -> { view.setOnClickListener(v -> {
Integer checkedId = v.getId(); Integer checkedId = v.getId();
Category category1 = (Category) groupCategory.findViewById(checkedId).getTag(); Category tagCategory = (Category) groupCategory.findViewById(checkedId).getTag();
int position = categorys.indexOf(category1); int position = categorys.indexOf(tagCategory);
goodsLayoutManager.scrollToPositionWithOffset(tPosition.get(position), 0); goodsLayoutManager.scrollToPositionWithOffset(tPosition.get(position), 0);
}); });
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
android:text="推荐" android:text="推荐"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/ts_detail_spec_rec" android:textSize="@dimen/ts_detail_spec_rec"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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