Commit 2a06429a by wjg

重做UI

parent a3352462
...@@ -5,17 +5,22 @@ import android.util.Log; ...@@ -5,17 +5,22 @@ 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.network.HttpUtil; import com.ihaoin.hooloo.device.network.HttpUtil;
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;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import cn.jpush.android.api.JPushInterface; import cn.jpush.android.api.JPushInterface;
public class HLApplication extends Application { public class HLApplication extends Application {
public static HLApplication SELF = null; public static HLApplication SELF = null;
private static MainData mainData = new MainData(); private static MainData mainData = new MainData();
private static List<TrolleyGoods> TROLLEY_GOODS = new ArrayList<>();
public static MainData getMainData() { public static MainData getMainData() {
return mainData; return mainData;
} }
...@@ -24,6 +29,10 @@ public class HLApplication extends Application { ...@@ -24,6 +29,10 @@ public class HLApplication extends Application {
mainData = data; mainData = data;
} }
public static List<TrolleyGoods> getTrolleyGoods() {
return TROLLEY_GOODS;
}
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
...@@ -48,4 +57,26 @@ public class HLApplication extends Application { ...@@ -48,4 +57,26 @@ public class HLApplication extends Application {
super.onTerminate(); super.onTerminate();
} }
public static Integer getCountOfOrder() {
if (HLApplication.getMainData() == null || HLApplication.getMainData().getCountOfOrder() == null) {
return 9;
}
return HLApplication.getMainData().getCountOfOrder();
}
public static Integer getGoodsCount() {
return HLApplication.getTrolleyGoods().stream().mapToInt(TrolleyGoods::getCount).sum();
}
public static Integer getGoodsCheckedCount() {
return HLApplication.getTrolleyGoods().stream().filter(TrolleyGoods::getChecked).mapToInt(TrolleyGoods::getCount).sum();
}
public static BigDecimal getGoodsTotal() {
return HLApplication.getTrolleyGoods().stream().map(x -> x.getSku().getDiscount().multiply(new BigDecimal(x.getCount()))).reduce(BigDecimal.ZERO, BigDecimal::add);
}
public static BigDecimal getGoodsCheckedTotal() {
return HLApplication.getTrolleyGoods().stream().filter(TrolleyGoods::getChecked).map(x -> x.getSku().getDiscount().multiply(new BigDecimal(x.getCount()))).reduce(BigDecimal.ZERO, BigDecimal::add);
}
} }
...@@ -36,26 +36,33 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo ...@@ -36,26 +36,33 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
@Override @Override
protected void convertHead(BaseViewHolder helper, ScrollBean item) { protected void convertHead(BaseViewHolder helper, ScrollBean item) {
helper.setText(R.id.txt_category, item.header); helper.setText(R.id.txt_category, item.header);
// TODO test
helper.setOnClickListener(R.id.txt_category, v -> Utils.showToast(mContext, item.header));
} }
@Override @Override
protected void convert(BaseViewHolder helper, ScrollBean item) { protected void convert(BaseViewHolder helper, ScrollBean item) {
ScrollBean.ScrollItemBean t = item.t; ScrollBean.ScrollItemBean t = item.t;
ViewGroup layoutItem = helper.getView(R.id.layout_item);
Goods goods = (Goods) t.getObject(); Goods goods = (Goods) t.getObject();
helper.setText(R.id.txt_name, goods.getName()); helper.setText(R.id.txt_name, goods.getName());
if (StringUtils.isEmpty(goods.getDesc())) { if (StringUtils.isEmpty(goods.getDesc())) {
helper.setGone(R.id.txt_intro, false); helper.setVisible(R.id.txt_intro, false);
} else { } else {
helper.setGone(R.id.txt_intro, true); helper.setVisible(R.id.txt_intro, true);
helper.setText(R.id.txt_intro, goods.getDesc()); helper.setText(R.id.txt_intro, goods.getDesc());
} }
if (CollectionUtils.isEmpty(goods.getTags())) {
helper.setGone(R.id.layout_tags, false);
} else {
helper.setGone(R.id.layout_tags, true);
LinearLayout layoutTag = helper.getView(R.id.layout_tags); LinearLayout layoutTag = helper.getView(R.id.layout_tags);
layoutTag.removeAllViews(); layoutTag.removeAllViews();
if (CollectionUtils.isEmpty(goods.getTags())) {
helper.setVisible(R.id.layout_tags, false);
View tagView = LayoutInflater.from(mContext).inflate(R.layout.item_tag, null);
layoutTag.addView(tagView);
} else {
helper.setVisible(R.id.layout_tags, true);
goods.getTags().forEach(x -> { goods.getTags().forEach(x -> {
View tagView = LayoutInflater.from(mContext).inflate(R.layout.item_tag, null); View tagView = LayoutInflater.from(mContext).inflate(R.layout.item_tag, null);
((TextView) tagView.findViewById(R.id.txt_tag)).setText(x); ((TextView) tagView.findViewById(R.id.txt_tag)).setText(x);
...@@ -69,33 +76,53 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo ...@@ -69,33 +76,53 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
if (goods.getPics() == null) { if (goods.getPics() == null) {
imgThumbnail.setImageDrawable(null); imgThumbnail.setImageDrawable(null);
} else { } else {
Utils.getGlide(mContext).load(goods.getPics().getThumbnail()).apply(options).into(imgThumbnail); Utils.getGlide(mContext).load(Utils.getThumbnailUrl(goods.getPics().getThumbnail())).apply(options).into(imgThumbnail);
} }
Sku sku = Utils.getDefaultSku(goods.getSkus()); Sku sku = Utils.getDefaultSku(goods.getSkus());
if (sku == null) { // if (sku == null) {
helper.setText(R.id.txt_price, Utils.toString(goods.getPrice())); // if (goods.getPrice().compareTo(goods.getDiscount()) == 0) {
helper.setText(R.id.txt_discount, Utils.toString(goods.getDiscount())); // helper.setGone(R.id.ico_price, false);
// helper.setGone(R.id.txt_price, false);
helper.setGone(R.id.txt_sellout, true); // } else {
helper.setGone(R.id.butn_add, false); // helper.setGone(R.id.ico_price, true);
// helper.setGone(R.id.txt_price, true);
// }
// helper.setText(R.id.txt_discount, Utils.toString(goods.getDiscount()));
// helper.setText(R.id.txt_price, Utils.toString(goods.getPrice()));
//
// helper.setGone(R.id.txt_sellout, true);
// helper.setGone(R.id.butn_add, false);
// } else {
if (sku.getPrice().compareTo(sku.getDiscount()) == 0) {
helper.setGone(R.id.ico_price, false);
helper.setGone(R.id.txt_price, false);
} else { } else {
helper.setText(R.id.txt_price, Utils.toString(sku.getPrice())); helper.setGone(R.id.ico_price, true);
helper.setGone(R.id.txt_price, true);
}
helper.setText(R.id.txt_discount, Utils.toString(sku.getDiscount())); helper.setText(R.id.txt_discount, Utils.toString(sku.getDiscount()));
helper.setText(R.id.txt_price, Utils.toString(sku.getPrice()));
if (SkuState.isSellin(sku.getState())) { if (SkuState.isSellin(sku.getState())) {
helper.setGone(R.id.txt_sellout, false); helper.setGone(R.id.txt_sellout, false);
helper.setGone(R.id.butn_add, true); helper.setGone(R.id.butn_add, true);
View butnAdd = helper.getView(R.id.butn_add); View butnAdd = helper.getView(R.id.butn_add);
butnAdd.setOnClickListener(v -> Utils.sendAddGoodsBroadcast(mContext, goods, sku, 1)); butnAdd.setOnClickListener(v -> {
if (!Base.TRUE.equals(sku.getIsDefault())) {
Utils.showToast(mContext, R.string.default_sku_sellout);
}
Utils.sendAddGoodsBroadcast(mContext, goods, sku, 1);
});
ViewGroup layoutItem = helper.getView(R.id.layout_item);
Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd)); Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd));
layoutItem.setOnClickListener(v -> Utils.showGoodsDetail(mContext, goods));
} else { } else {
helper.setGone(R.id.txt_sellout, true); helper.setGone(R.id.txt_sellout, true);
helper.setGone(R.id.butn_add, false); helper.setGone(R.id.butn_add, false);
layoutItem.setOnClickListener(v -> Utils.showToast(mContext, R.string.all_sku_sellout));
} }
} // }
if (Base.TRUE.equals(goods.getIsRecommend())) { if (Base.TRUE.equals(goods.getIsRecommend())) {
helper.setVisible(R.id.img_recommend, true); helper.setVisible(R.id.img_recommend, true);
...@@ -108,16 +135,16 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo ...@@ -108,16 +135,16 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
icoPrice.setPaintFlags(icoPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); icoPrice.setPaintFlags(icoPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtPrice.setPaintFlags(txtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); txtPrice.setPaintFlags(txtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
View layoutItem = helper.getView(R.id.layout_item); // layoutItem.setPadding(padding, padding, padding, padding);
layoutItem.setOnClickListener(v -> Utils.showGoodsDetail(mContext, goods));
int padding = Utils.getDimens(mContext, R.dimen.padding10);
layoutItem.setPadding(padding, padding, padding, padding);
// 最后一个商品 并且购物条已经显示 // 最后一个商品 并且购物条已经显示
if (getData().indexOf(item) == getItemCount() - 1 && trolleyState) { if (getData().indexOf(item) == getItemCount() - 1) {
// int padding = Utils.getDimens(mContext, R.dimen.padding10);
int bottomPadding = Utils.getDimens(mContext, R.dimen.trolley_bar_goods_margin); int bottomPadding = Utils.getDimens(mContext, R.dimen.trolley_bar_goods_margin);
layoutItem.setPadding(padding, padding, padding, bottomPadding); layoutItem.setPadding(0, 0, 0, bottomPadding);
} else {
int bottomPadding = Utils.getDimens(mContext, R.dimen.goods_padding_bottom);
layoutItem.setPadding(0, 0, 0, bottomPadding);
} }
} }
......
...@@ -6,30 +6,24 @@ import android.widget.ImageView; ...@@ -6,30 +6,24 @@ import android.widget.ImageView;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseSectionQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.ihaoin.hooloo.device.R; import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.component.SettingsQueue;
import com.ihaoin.hooloo.device.data.ScrollBean; import com.ihaoin.hooloo.device.data.ScrollBean;
import com.ihaoin.hooloo.device.data.enums.SkuState;
import com.ihaoin.hooloo.device.data.vo.Recommend; import com.ihaoin.hooloo.device.data.vo.Recommend;
import com.ihaoin.hooloo.device.data.vo.Sku;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
public class RecommendAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHolder> { public class RecommendAdapter extends BaseQuickAdapter<ScrollBean, BaseViewHolder> {
private Context mContext; private Context mContext;
public RecommendAdapter(Context context, int layoutResId, int sectionHeadResId) { public RecommendAdapter(Context context, int layoutResId) {
super(layoutResId, sectionHeadResId, null); super(layoutResId, null);
this.mContext = context; this.mContext = context;
} }
@Override @Override
protected void convertHead(BaseViewHolder helper, ScrollBean item) {
View layoutItem = helper.getView(R.id.layout_item);
View logo = helper.getView(R.id.logo);
SettingsQueue settingsQueue = new SettingsQueue(mContext, logo, layoutItem);
}
@Override
protected void convert(BaseViewHolder helper, ScrollBean item) { protected void convert(BaseViewHolder helper, ScrollBean item) {
ScrollBean.ScrollItemBean t = item.t; ScrollBean.ScrollItemBean t = item.t;
Recommend recommend = (Recommend) t.getObject(); Recommend recommend = (Recommend) t.getObject();
...@@ -42,7 +36,16 @@ public class RecommendAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseVi ...@@ -42,7 +36,16 @@ public class RecommendAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseVi
Utils.getGlide(mContext).load(recommend.getPic()).apply(options).into(imgRecommend); Utils.getGlide(mContext).load(recommend.getPic()).apply(options).into(imgRecommend);
View layoutItem = helper.getView(R.id.layout_item); View layoutItem = helper.getView(R.id.layout_item);
layoutItem.setOnClickListener(v -> Utils.showGoodsDetail(mContext, recommend.getGoods())); layoutItem.setOnClickListener(v -> {
Sku sku = Utils.getDefaultSku(recommend.getGoods().getSkus());
if (SkuState.isSellin(sku.getState())) {
Utils.showGoodsDetail(mContext, recommend.getGoods());
} else {
Utils.showToast(mContext, R.string.all_sku_sellout);
}
});
helper.getConvertView().setTag(recommend);
} }
} }
...@@ -10,6 +10,7 @@ import android.widget.ImageView; ...@@ -10,6 +10,7 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.ToggleButton; import android.widget.ToggleButton;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R; import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.data.TrolleyGoods; import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.vo.Goods; import com.ihaoin.hooloo.device.data.vo.Goods;
...@@ -71,6 +72,14 @@ public class TrolleyAdapter extends BaseAdapter { ...@@ -71,6 +72,14 @@ public class TrolleyAdapter extends BaseAdapter {
txtOptions.setVisibility(View.GONE); txtOptions.setVisibility(View.GONE);
} }
if (sku.getPrice().compareTo(sku.getDiscount()) == 0) {
icoPrice.setVisibility(View.GONE);
txtPrice.setVisibility(View.GONE);
} else {
icoPrice.setVisibility(View.VISIBLE);
txtPrice.setVisibility(View.VISIBLE);
}
txtPrice.setText(Utils.toString(sku.getPrice())); txtPrice.setText(Utils.toString(sku.getPrice()));
txtDiscount.setText(Utils.toString(sku.getDiscount())); txtDiscount.setText(Utils.toString(sku.getDiscount()));
...@@ -79,7 +88,7 @@ public class TrolleyAdapter extends BaseAdapter { ...@@ -79,7 +88,7 @@ public class TrolleyAdapter extends BaseAdapter {
txtCount.setText(trolleyGoods.getCount().toString()); txtCount.setText(trolleyGoods.getCount().toString());
butnSubtract.setOnClickListener(v -> trolleyView.subtractGoods(position)); butnSubtract.setOnClickListener(v -> trolleyView.subtractGoods(position));
butnAdd.setOnClickListener(v -> trolleyView.addGoods(position)); butnAdd.setOnClickListener(v -> trolleyView.addGoods(position));
Utils.getGlide(mContext).load(goods.getPics().getThumbnail()).into(imgThumbnail); Utils.getGlide(mContext).load(Utils.getThumbnailUrl(goods.getPics().getThumbnail())).into(imgThumbnail);
ViewGroup layoutItem = convertView.findViewById(R.id.layout_item); ViewGroup layoutItem = convertView.findViewById(R.id.layout_item);
Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd, butnSubtract)); Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd, butnSubtract));
...@@ -88,7 +97,7 @@ public class TrolleyAdapter extends BaseAdapter { ...@@ -88,7 +97,7 @@ public class TrolleyAdapter extends BaseAdapter {
} }
private List<TrolleyGoods> getTrolleyGoods() { private List<TrolleyGoods> getTrolleyGoods() {
return trolleyView.getTrolleyGoods(); return HLApplication.getTrolleyGoods();
} }
@Override @Override
......
...@@ -6,12 +6,13 @@ import android.os.Handler; ...@@ -6,12 +6,13 @@ import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.util.Log; import android.util.Log;
import com.alibaba.fastjson.JSON; import com.fasterxml.jackson.databind.JsonNode;
import com.alibaba.fastjson.JSONObject;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.network.HttpUtil; import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.JsonUtils;
import com.ihaoin.hooloo.device.util.StringUtils; import com.ihaoin.hooloo.device.util.StringUtils;
import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -37,16 +38,20 @@ public class PushMessageReceiver extends JPushMessageReceiver { ...@@ -37,16 +38,20 @@ public class PushMessageReceiver extends JPushMessageReceiver {
public void onMessage(Context context, CustomMessage customMessage) { public void onMessage(Context context, CustomMessage customMessage) {
Log.e(AppConfig.TAG_PUSH, "[onMessage] " + customMessage); Log.e(AppConfig.TAG_PUSH, "[onMessage] " + customMessage);
this.showToast("onMessage"); this.showToast("onMessage");
try {
dispatchMsg(customMessage); dispatchMsg(customMessage);
} catch (IOException e) {
e.printStackTrace();
}
} }
private void dispatchMsg(CustomMessage customMessage) { private void dispatchMsg(CustomMessage customMessage) throws IOException {
// if (CollectionUtils.isEmpty(subscribers)) { // if (CollectionUtils.isEmpty(subscribers)) {
// Log.e(AppConfig.DEBUG_TAG_PUSH,"msg subscribers is empty"); // Log.e(AppConfig.DEBUG_TAG_PUSH,"msg subscribers is empty");
// return; // return;
// } // }
JSONObject jsonObject = JSON.parseObject(customMessage.message); JsonNode jsonNode = JsonUtils.getMapper().readValue(customMessage.message, JsonNode.class);
String action = jsonObject.getString("action"); String action = jsonNode.get("action").asText();
if (StringUtils.isEmpty(action)) { if (StringUtils.isEmpty(action)) {
Log.e(AppConfig.TAG_PUSH, "msg action is empty"); Log.e(AppConfig.TAG_PUSH, "msg action is empty");
return; return;
...@@ -56,8 +61,8 @@ public class PushMessageReceiver extends JPushMessageReceiver { ...@@ -56,8 +61,8 @@ public class PushMessageReceiver extends JPushMessageReceiver {
Log.e(AppConfig.TAG_PUSH, String.format("msg action[%s] subscribers is empty", action)); Log.e(AppConfig.TAG_PUSH, String.format("msg action[%s] subscribers is empty", action));
return; return;
} }
JSONObject data = jsonObject.getJSONObject("data"); JsonNode data = jsonNode.get("data");
Message msg = handler.obtainMessage(1, data.toJSONString()); Message msg = handler.obtainMessage(1, JsonUtils.getMapper().writeValueAsString(data));
handler.sendMessage(msg); handler.sendMessage(msg);
} }
...@@ -128,7 +133,6 @@ public class PushMessageReceiver extends JPushMessageReceiver { ...@@ -128,7 +133,6 @@ public class PushMessageReceiver extends JPushMessageReceiver {
} }
private void showToast(String content) { private void showToast(String content) {
// Toast.makeText(HLApplication.SELF, content, Toast.LENGTH_SHORT).show();
} }
@Override @Override
......
...@@ -24,20 +24,6 @@ public class SettingsQueue extends ArrayList<Boolean> { ...@@ -24,20 +24,6 @@ public class SettingsQueue extends ArrayList<Boolean> {
this.oneView = oneView; this.oneView = oneView;
this.zeroView = zeroView; this.zeroView = zeroView;
// this.oneView.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// Toast.makeText(context, "1", Toast.LENGTH_SHORT).show();
// add(true);
// }
// });
// this.zeroView.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// Toast.makeText(context, "0", Toast.LENGTH_SHORT).show();
// add(false);
// }
// });
this.oneView.setOnClickListener(v -> add(true)); this.oneView.setOnClickListener(v -> add(true));
this.zeroView.setOnClickListener(v -> add(false)); this.zeroView.setOnClickListener(v -> add(false));
} }
...@@ -62,7 +48,6 @@ public class SettingsQueue extends ArrayList<Boolean> { ...@@ -62,7 +48,6 @@ public class SettingsQueue extends ArrayList<Boolean> {
break; break;
} }
} }
// Toast.makeText(context, String.valueOf(matched), Toast.LENGTH_SHORT).show();
if (matched) { if (matched) {
Utils.openAppSettings(context); Utils.openAppSettings(context);
clear(); clear();
......
...@@ -7,6 +7,7 @@ public class Base { ...@@ -7,6 +7,7 @@ public class Base {
public static final String PUSH_ACTION_ORDER_STATE_CHANGED = "ORDER_STATE_CHANGED"; public static final String PUSH_ACTION_ORDER_STATE_CHANGED = "ORDER_STATE_CHANGED";
public static final String PUSH_ACTION_SKU_STATE_CHANGED = "SKU_STATE_CHANGED"; public static final String PUSH_ACTION_SKU_STATE_CHANGED = "SKU_STATE_CHANGED";
public static final String PUSH_ACTION_QRCODE_VISITED = "QRCODE_VISITED"; public static final String PUSH_ACTION_QRCODE_VISITED = "QRCODE_VISITED";
public static final String PUSH_ACTION_GOODS_CHANGED = "GOODS_CHANGED";
public static final String BROADCAST_ACTION_ADD_GOODS = "ACTION_ADD_GOODS"; public static final String BROADCAST_ACTION_ADD_GOODS = "ACTION_ADD_GOODS";
public static final String BROADCAST_ACTION_GOODS_CHANGED = "ACTION_GOODS_CHANGED"; public static final String BROADCAST_ACTION_GOODS_CHANGED = "ACTION_GOODS_CHANGED";
......
...@@ -23,6 +23,16 @@ public class Recommend implements Serializable { ...@@ -23,6 +23,16 @@ public class Recommend implements Serializable {
*/ */
private Goods goods; private Goods goods;
private Integer index;
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
public String getTitle() { public String getTitle() {
return title; return title;
} }
......
...@@ -75,13 +75,13 @@ public class HttpUtil { ...@@ -75,13 +75,13 @@ public class HttpUtil {
private static void onResponse(Handler handler, Call call, Response response) { private static void onResponse(Handler handler, Call call, Response response) {
try { try {
String responseBody = response.body().string(); String responseBody = response.body().string();
JsonNode jsonObject = JsonUtils.getMapper().readValue(responseBody, JsonNode.class); JsonNode jsonNode = JsonUtils.getMapper().readValue(responseBody, JsonNode.class);
if (jsonObject == null) { if (jsonNode == null) {
onFailure(handler, call, new BizException("返回body为空")); onFailure(handler, call, new BizException("返回body为空"));
return; return;
} }
if (jsonObject.get("code").asInt() != 200) { if (jsonNode.get("code").asInt() != 200) {
onFailure(handler, call, new BizException(jsonObject.get("msg").asText())); onFailure(handler, call, new BizException(jsonNode.get("msg").asText()));
return; return;
} }
if (handler == null) { if (handler == null) {
...@@ -89,7 +89,7 @@ public class HttpUtil { ...@@ -89,7 +89,7 @@ public class HttpUtil {
Log.i(AppConfig.TAG_NETWORK, msgText); Log.i(AppConfig.TAG_NETWORK, msgText);
return; return;
} }
sendHandlerMessage(1, handler, call, jsonObject.get("data") == null ? "" : jsonObject.get("data").toString()); sendHandlerMessage(1, handler, call, jsonNode.get("data") == null ? "" : jsonNode.get("data").toString());
} catch (Exception e) { } catch (Exception e) {
onFailure(handler, call, e); onFailure(handler, call, e);
} }
......
...@@ -5,10 +5,14 @@ import android.content.Context; ...@@ -5,10 +5,14 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Rect; import android.graphics.Rect;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.TouchDelegate; import android.view.TouchDelegate;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.coordinatorlayout.widget.ViewGroupUtils; import androidx.coordinatorlayout.widget.ViewGroupUtils;
...@@ -133,7 +137,7 @@ public class Utils { ...@@ -133,7 +137,7 @@ public class Utils {
} }
public static String toString(BigDecimal num) { public static String toString(BigDecimal num) {
DecimalFormat df = new DecimalFormat("0.00"); DecimalFormat df = new DecimalFormat("0.#");
return df.format(num); return df.format(num);
} }
...@@ -175,4 +179,27 @@ public class Utils { ...@@ -175,4 +179,27 @@ public class Utils {
RequestOptions options = new RequestOptions().placeholder(R.mipmap.placeholder); RequestOptions options = new RequestOptions().placeholder(R.mipmap.placeholder);
return Glide.with(context).setDefaultRequestOptions(options); return Glide.with(context).setDefaultRequestOptions(options);
} }
public static void showToast(Context context, int resId) {
showToast(context, context.getString(resId));
}
public static void showToast(Context context, String text) {
// TODO 自定义toast样式
View view = LayoutInflater.from(context).inflate(R.layout.view_toast, null);
TextView textView = view.findViewById(R.id.txt_toast);
textView.setText(text);
Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.setView(view);
toast.show();
}
public static String getThumbnailUrl(String url) {
if (StringUtils.isEmpty(url)) {
return null;
}
return url + "?x-oss-process=image/resize,m_fill,h_100,w_100";
}
} }
...@@ -13,7 +13,6 @@ import android.util.Log; ...@@ -13,7 +13,6 @@ import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
...@@ -126,7 +125,7 @@ public class ConfirmOrderDialog extends Dialog { ...@@ -126,7 +125,7 @@ public class ConfirmOrderDialog extends Dialog {
HttpUtil.postConfirmOrder(genJson(), confirmOrderHandler); HttpUtil.postConfirmOrder(genJson(), confirmOrderHandler);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
Toast.makeText(getContext(), R.string.error_get_qrcode, Toast.LENGTH_LONG).show(); Utils.showToast(getContext(), R.string.error_get_qrcode);
dismiss(); dismiss();
} }
} }
...@@ -149,7 +148,6 @@ public class ConfirmOrderDialog extends Dialog { ...@@ -149,7 +148,6 @@ public class ConfirmOrderDialog extends Dialog {
private String genJson() { private String genJson() {
try { try {
// Toast.makeText(getContext(), "屏幕编码:" + SharedPreferencesUtils.getScreenNo(getContext()), Toast.LENGTH_SHORT).show();
ConfirmOrder confirmOrder = new ConfirmOrder(); ConfirmOrder confirmOrder = new ConfirmOrder();
confirmOrder.setMachineCode(AppConfig.MACHINE_CODE); confirmOrder.setMachineCode(AppConfig.MACHINE_CODE);
confirmOrder.setScreenNo(SharedPreferencesUtils.getScreenNo(getContext())); confirmOrder.setScreenNo(SharedPreferencesUtils.getScreenNo(getContext()));
...@@ -269,7 +267,7 @@ public class ConfirmOrderDialog extends Dialog { ...@@ -269,7 +267,7 @@ public class ConfirmOrderDialog extends Dialog {
stopLoading(); stopLoading();
Object obj = msg.obj; Object obj = msg.obj;
if (msg.what == 0 || obj == null) { if (msg.what == 0 || obj == null) {
Toast.makeText(getContext(), R.string.error_get_qrcode, Toast.LENGTH_LONG).show(); Utils.showToast(getContext(), R.string.error_get_qrcode);
dismiss(); dismiss();
return; return;
} }
...@@ -280,7 +278,7 @@ public class ConfirmOrderDialog extends Dialog { ...@@ -280,7 +278,7 @@ public class ConfirmOrderDialog extends Dialog {
imgQRCode.setImageBitmap(bitmap); imgQRCode.setImageBitmap(bitmap);
startExpireThread(); startExpireThread();
} catch (Exception e) { } catch (Exception e) {
Toast.makeText(getContext(), R.string.error_get_qrcode, Toast.LENGTH_LONG).show(); Utils.showToast(getContext(), R.string.error_get_qrcode);
dismiss(); dismiss();
} }
} }
......
...@@ -15,7 +15,6 @@ import android.widget.LinearLayout; ...@@ -15,7 +15,6 @@ import android.widget.LinearLayout;
import android.widget.RadioButton; import android.widget.RadioButton;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.viewpager.widget.ViewPager; import androidx.viewpager.widget.ViewPager;
...@@ -35,6 +34,7 @@ import com.ihaoin.hooloo.device.util.CollectionUtils; ...@@ -35,6 +34,7 @@ import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.StringUtils; import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -63,7 +63,6 @@ public class GoodsDetailDialog extends Dialog { ...@@ -63,7 +63,6 @@ public class GoodsDetailDialog extends Dialog {
private Button butnTrolley; private Button butnTrolley;
private View layoutOperate; private View layoutOperate;
private View layoutButns; private View layoutButns;
private View txtSellout;
private List<View> introViews; private List<View> introViews;
...@@ -82,7 +81,6 @@ public class GoodsDetailDialog extends Dialog { ...@@ -82,7 +81,6 @@ public class GoodsDetailDialog extends Dialog {
private void initViews() { private void initViews() {
layoutButns = findViewById(R.id.layout_butns); layoutButns = findViewById(R.id.layout_butns);
layoutOperate = findViewById(R.id.layout_operate); layoutOperate = findViewById(R.id.layout_operate);
txtSellout = findViewById(R.id.txt_sellout);
butnClose = findViewById(R.id.butn_close); butnClose = findViewById(R.id.butn_close);
introPager = findViewById(R.id.intro_pager); introPager = findViewById(R.id.intro_pager);
introIndicator = findViewById(R.id.intro_indicator); introIndicator = findViewById(R.id.intro_indicator);
...@@ -135,24 +133,35 @@ public class GoodsDetailDialog extends Dialog { ...@@ -135,24 +133,35 @@ public class GoodsDetailDialog extends Dialog {
} }
Optional<Sku> optional = mGoods.getSkus().stream().filter(x -> Base.TRUE.equals(x.getIsDefault())).findAny(); Optional<Sku> optional = mGoods.getSkus().stream().filter(x -> Base.TRUE.equals(x.getIsDefault())).findAny();
BigDecimal price, discount;
if (optional.isPresent()) { if (optional.isPresent()) {
Sku defaultSku = optional.get(); price = optional.get().getPrice();
txtPrice.setText(Utils.toString(defaultSku.getPrice())); discount = optional.get().getDiscount();
txtDiscount.setText(Utils.toString(defaultSku.getDiscount()));
} else { } else {
txtPrice.setText(Utils.toString(mGoods.getPrice())); price = mGoods.getPrice();
txtDiscount.setText(Utils.toString(mGoods.getDiscount())); discount = mGoods.getDiscount();
} }
if (price.compareTo(discount) == 0) {
findViewById(R.id.ico_price).setVisibility(View.GONE);
findViewById(R.id.txt_price).setVisibility(View.GONE);
} else {
findViewById(R.id.ico_price).setVisibility(View.VISIBLE);
findViewById(R.id.txt_price).setVisibility(View.VISIBLE);
}
txtPrice.setText(Utils.toString(price));
txtDiscount.setText(Utils.toString(discount));
txtName.setText(mGoods.getName()); txtName.setText(mGoods.getName());
butnSubtract.setOnClickListener(v -> subtractGoods()); butnSubtract.setOnClickListener(v -> subtractCount());
butnAdd.setOnClickListener(v -> addGoods()); butnAdd.setOnClickListener(v -> addCount());
icoPirce.setPaintFlags(icoPirce.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); icoPirce.setPaintFlags(icoPirce.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtPrice.setPaintFlags(txtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); txtPrice.setPaintFlags(txtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
butnBuy.setOnClickListener(v -> buyNow()); butnBuy.setOnClickListener(v -> prepareBuyNow());
butnTrolley.setOnClickListener(v -> addTrolley()); butnTrolley.setOnClickListener(v -> prepareAddTrolley());
ViewGroup layoutItem = findViewById(R.id.layout_item); ViewGroup layoutItem = findViewById(R.id.layout_item);
Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd, butnSubtract)); Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd, butnSubtract));
...@@ -247,54 +256,73 @@ public class GoodsDetailDialog extends Dialog { ...@@ -247,54 +256,73 @@ public class GoodsDetailDialog extends Dialog {
private Goods goods; private Goods goods;
private Sku sku; private Sku sku;
private Integer count; private Integer count;
private Integer type;
public CheckGoodsHandler(Goods goods, Sku sku, Integer count) { public CheckGoodsHandler(Goods goods, Sku sku, Integer count, int type) {
super(); super();
this.goods = goods; this.goods = goods;
this.sku = sku; this.sku = sku;
this.count = count; this.count = count;
this.type = type;
} }
@Override @Override
public void handleMessage(@NonNull Message msg) { public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg); super.handleMessage(msg);
if (msg.what != 1) { if (msg.what != 1) {
Toast.makeText(getContext(), R.string.error_check_sku, Toast.LENGTH_SHORT).show(); Utils.showToast(getContext(), R.string.error_check_sku);
return; return;
} }
Utils.showConfirmOrder(getContext(), goods, sku, count); if (this.type == 1) {
dismiss(); buyNow(goods, sku, count);
} else {
addTrolley(goods, sku, count);
}
} }
} }
private void buyNow() { public void prepareBuyNow() {
if (mSku == null) { if (mSku == null) {
Toast.makeText(getContext(), R.string.not_found_goods, Toast.LENGTH_SHORT).show(); Utils.showToast(getContext(), R.string.not_found_goods);
return; return;
} }
CheckGoodsHandler handler = new CheckGoodsHandler(mGoods, mSku, mCount); CheckGoodsHandler handler = new CheckGoodsHandler(mGoods, mSku, mCount, 1);
HttpUtil.checkSku(mSku.getSkuId(), handler); HttpUtil.checkSku(mSku.getSkuId(), handler);
} }
private void addTrolley() { public void prepareAddTrolley() {
if (mSku == null) { if (mSku == null) {
Toast.makeText(getContext(), R.string.not_found_goods, Toast.LENGTH_SHORT).show(); Utils.showToast(getContext(), R.string.not_found_goods);
return; return;
} }
Utils.sendAddGoodsBroadcast(getContext(), mGoods, mSku, mCount); if (mCount + HLApplication.getGoodsCount() >= HLApplication.getCountOfOrder()) {
Utils.showToast(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getCountOfOrder().toString()));
return;
}
CheckGoodsHandler handler = new CheckGoodsHandler(mGoods, mSku, mCount, 0);
HttpUtil.checkSku(mSku.getSkuId(), handler);
}
private void buyNow(Goods goods, Sku sku, Integer count) {
Utils.showConfirmOrder(getContext(), goods, sku, count);
dismiss(); dismiss();
} }
private void addGoods() { private void addTrolley(Goods goods, Sku sku, Integer count) {
if (mCount >= HLApplication.getMainData().getCountOfOrder()) { Utils.sendAddGoodsBroadcast(getContext(), goods, sku, count);
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getMainData().getCountOfOrder().toString()), Toast.LENGTH_SHORT).show(); dismiss();
}
private void addCount() {
if (mCount + HLApplication.getGoodsCount() >= HLApplication.getCountOfOrder()) {
Utils.showToast(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getCountOfOrder().toString()));
return; return;
} }
mCount++; mCount++;
txtCount.setText(String.valueOf(mCount)); txtCount.setText(String.valueOf(mCount));
} }
private void subtractGoods() { private void subtractCount() {
if (mCount <= 1) { if (mCount <= 1) {
return; return;
} }
...@@ -379,7 +407,6 @@ public class GoodsDetailDialog extends Dialog { ...@@ -379,7 +407,6 @@ public class GoodsDetailDialog extends Dialog {
} }
mSku = matchSku(rules); mSku = matchSku(rules);
if (mSku == null) { if (mSku == null) {
// Toast.makeText(getContext(), R.string.not_found_goods, Toast.LENGTH_SHORT).show();
return; return;
} }
txtPrice.setText(Utils.toString(mSku.getPrice())); txtPrice.setText(Utils.toString(mSku.getPrice()));
...@@ -512,21 +539,22 @@ public class GoodsDetailDialog extends Dialog { ...@@ -512,21 +539,22 @@ public class GoodsDetailDialog extends Dialog {
} }
private void showSelloutViews() { private void showSelloutViews() {
layoutOperate.setVisibility(View.GONE); dismiss();
layoutButns.setVisibility(View.GONE); // layoutOperate.setVisibility(View.GONE);
txtSellout.setVisibility(View.VISIBLE); // layoutButns.setVisibility(View.GONE);
setAllRuleSellouts(); // 所有规格设置为售罄 // txtSellout.setVisibility(View.VISIBLE);
} // setAllRuleSellouts(); // 所有规格设置为售罄
}
private void setAllRuleSellouts() {
if (mGoods == null || CollectionUtils.isEmpty(mGoods.getSpecs())) { // private void setAllRuleSellouts() {
return; // if (mGoods == null || CollectionUtils.isEmpty(mGoods.getSpecs())) {
} // return;
mGoods.getSpecs().forEach(spec -> { // }
if (CollectionUtils.isEmpty(spec.getRules())) { // mGoods.getSpecs().forEach(spec -> {
return; // if (CollectionUtils.isEmpty(spec.getRules())) {
} // return;
spec.getRules().forEach(rule -> rule.setState(SkuState.SELLOUT.getCode())); // }
}); // spec.getRules().forEach(rule -> rule.setState(SkuState.SELLOUT.getCode()));
} // });
// }
} }
...@@ -18,7 +18,7 @@ import android.view.View; ...@@ -18,7 +18,7 @@ import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.RadioButton; import android.widget.RadioButton;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.Toast; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
...@@ -31,6 +31,7 @@ import com.ihaoin.hooloo.device.adapter.GoodsAdapter; ...@@ -31,6 +31,7 @@ import com.ihaoin.hooloo.device.adapter.GoodsAdapter;
import com.ihaoin.hooloo.device.adapter.RecommendAdapter; import com.ihaoin.hooloo.device.adapter.RecommendAdapter;
import com.ihaoin.hooloo.device.component.NetworkHandler; import com.ihaoin.hooloo.device.component.NetworkHandler;
import com.ihaoin.hooloo.device.component.PushMessageReceiver; import com.ihaoin.hooloo.device.component.PushMessageReceiver;
import com.ihaoin.hooloo.device.component.SettingsQueue;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.config.Base; import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.MainData; import com.ihaoin.hooloo.device.data.MainData;
...@@ -53,11 +54,12 @@ import java.util.List; ...@@ -53,11 +54,12 @@ import java.util.List;
public class LauncherActivity extends Activity { public class LauncherActivity extends Activity {
private SkuStateChangeHandler skuStateChangeHandler; private SkuStateChangeHandler skuStateChangeHandler;
private GoodsChangeHandler goodsChangeHandler;
private RadioGroup groupCategory; private RadioGroup groupCategory;
private RecyclerView recGoods; private RecyclerView recGoods;
private RecyclerView recRecommends; private RecyclerView recRecommends;
// private TextView rightTitle; private TextView txtCategory;
private View layoutTips; private View layoutTips;
private List<ScrollBean> scrollRecommends; private List<ScrollBean> scrollRecommends;
...@@ -85,6 +87,7 @@ public class LauncherActivity extends Activity { ...@@ -85,6 +87,7 @@ public class LauncherActivity extends Activity {
requestPermissions(); requestPermissions();
txtCategory = findViewById(R.id.txt_category);
trolleyView = findViewById(R.id.view_trolley); trolleyView = findViewById(R.id.view_trolley);
groupCategory = findViewById(R.id.group_category); groupCategory = findViewById(R.id.group_category);
recGoods = findViewById(R.id.rec_right); recGoods = findViewById(R.id.rec_right);
...@@ -105,8 +108,16 @@ public class LauncherActivity extends Activity { ...@@ -105,8 +108,16 @@ public class LauncherActivity extends Activity {
registSettingChangedReceiver(); registSettingChangedReceiver();
prepareMenuView(); prepareMenuView();
regsitSkuChangeListener(); regsitSkuChangeListener();
regsitGoodsChangeListener();
startLoadDataThread(); startLoadDataThread();
initSettingsQueue();
}
private void initSettingsQueue() {
View layoutLogo = findViewById(R.id.layout_logo);
View imgLogo = findViewById(R.id.img_logo);
new SettingsQueue(mContext, imgLogo, layoutLogo);
} }
private void setMachineCode() { private void setMachineCode() {
...@@ -120,16 +131,10 @@ public class LauncherActivity extends Activity { ...@@ -120,16 +131,10 @@ public class LauncherActivity extends Activity {
private void initRecommends() { private void initRecommends() {
recommendManager = new GridLayoutManager(mContext, 2); recommendManager = new GridLayoutManager(mContext, 2);
recommendManager.setSpanSizeLookup(new MySpanSizeLookup()); recommendManager.setSpanSizeLookup(new MySpanSizeLookup());
recRecommends.addItemDecoration(new RecyclerView.ItemDecoration() { recRecommends.addItemDecoration(new MyItemDecoration());
@Override
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
outRect.left = Utils.getDimens(LauncherActivity.this, R.dimen.padding10);
outRect.bottom = Utils.getDimens(LauncherActivity.this, R.dimen.padding10);
}
});
if (recommendAdapter == null) { if (recommendAdapter == null) {
recommendAdapter = new RecommendAdapter(this, R.layout.item_recommend, R.layout.item_logo); recommendAdapter = new RecommendAdapter(this, R.layout.item_recommend);
recRecommends.setAdapter(recommendAdapter); recRecommends.setAdapter(recommendAdapter);
recRecommends.setLayoutManager(recommendManager); recRecommends.setLayoutManager(recommendManager);
} else { } else {
...@@ -141,26 +146,43 @@ public class LauncherActivity extends Activity { ...@@ -141,26 +146,43 @@ 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<>();
ScrollBean header = new ScrollBean(true, null);
scrollRecommends.add(header);
recommendAdapter.setNewData(scrollRecommends);
if (CollectionUtils.isEmpty(recommends)) { if (CollectionUtils.isEmpty(recommends)) {
return; return;
} }
recommends.forEach(x -> scrollRecommends.add(new ScrollBean(new ScrollBean.ScrollItemBean(x, null)))); for (int i = 0; i < recommends.size(); i++) {
Recommend x = recommends.get(i);
x.setIndex(i);
scrollRecommends.add(new ScrollBean(new ScrollBean.ScrollItemBean(x, null)));
}
recommendAdapter.setNewData(scrollRecommends); recommendAdapter.setNewData(scrollRecommends);
} }
class MySpanSizeLookup extends GridLayoutManager.SpanSizeLookup { class MySpanSizeLookup extends GridLayoutManager.SpanSizeLookup {
@Override @Override
public int getSpanSize(int position) { public int getSpanSize(int position) {
if (position == 0 || position == 1) { if (position == 0) {
return 2; return 2;
} }
return 1; return 1;
} }
} }
class MyItemDecoration extends RecyclerView.ItemDecoration {
@Override
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
Recommend recommend = (Recommend) view.getTag();
outRect.bottom = 20;
if (recommend.getIndex() > 0) {
if (recommend.getIndex() % 2 == 1) {
outRect.right = 10;
} else {
outRect.left = 10;
}
}
}
}
private void initGoods() { private void initGoods() {
goodsLayoutManager = new LinearLayoutManager(mContext); goodsLayoutManager = new LinearLayoutManager(mContext);
if (goodsAdapter == null) { if (goodsAdapter == null) {
...@@ -190,6 +212,7 @@ public class LauncherActivity extends Activity { ...@@ -190,6 +212,7 @@ public class LauncherActivity extends Activity {
} else { } else {
title = scrollGoods.get(first).t.getType(); title = scrollGoods.get(first).t.getType();
} }
txtCategory.setText(title);
} }
// 遍历分类列表,设置选中分类 // 遍历分类列表,设置选中分类
...@@ -319,7 +342,7 @@ public class LauncherActivity extends Activity { ...@@ -319,7 +342,7 @@ public class LauncherActivity extends Activity {
try { try {
Object obj = msg.obj; Object obj = msg.obj;
if (msg.what == 0 || obj == null) { if (msg.what == 0 || obj == null) {
Toast.makeText(LauncherActivity.this, R.string.error_load_main_data, Toast.LENGTH_SHORT).show(); Utils.showToast(LauncherActivity.this, R.string.error_load_main_data);
return; return;
} }
MainData mainData = JsonUtils.getMapper().readValue(obj.toString(), MainData.class); MainData mainData = JsonUtils.getMapper().readValue(obj.toString(), MainData.class);
...@@ -351,6 +374,7 @@ public class LauncherActivity extends Activity { ...@@ -351,6 +374,7 @@ public class LauncherActivity extends Activity {
this.unregistTrolleyStateChangedReceiver(); this.unregistTrolleyStateChangedReceiver();
this.unregistSettingChangedReceiver(); this.unregistSettingChangedReceiver();
this.unregsitSkuChangeListener(); this.unregsitSkuChangeListener();
this.unregsitGoodsChangeListener();
System.exit(0); System.exit(0);
} }
...@@ -462,9 +486,9 @@ public class LauncherActivity extends Activity { ...@@ -462,9 +486,9 @@ public class LauncherActivity extends Activity {
} }
} else if (intent.getAction().equals(Base.BROADCAST_ACTION_LOGCAT_STATE_CHANGED)) { } else if (intent.getAction().equals(Base.BROADCAST_ACTION_LOGCAT_STATE_CHANGED)) {
if (SharedPreferencesUtils.getShowMenu(LauncherActivity.this)) { if (SharedPreferencesUtils.getShowMenu(LauncherActivity.this)) {
Toast.makeText(LauncherActivity.this, "展示Logcat", Toast.LENGTH_SHORT).show(); Utils.showToast(LauncherActivity.this, "展示Logcat");
} else { } else {
Toast.makeText(LauncherActivity.this, "隐藏Logcat", Toast.LENGTH_SHORT).show(); Utils.showToast(LauncherActivity.this, "隐藏Logcat");
} }
} }
} }
...@@ -481,7 +505,7 @@ public class LauncherActivity extends Activity { ...@@ -481,7 +505,7 @@ public class LauncherActivity extends Activity {
/** 显示菜单屏KDS */ /** 显示菜单屏KDS */
private void showMenuView() { private void showMenuView() {
if (AppConfig.DEBUG) { if (AppConfig.DEBUG) {
Toast.makeText(this, "展示菜单屏", Toast.LENGTH_SHORT).show(); Utils.showToast(this, "展示菜单屏");
} }
if (menu != null) { if (menu != null) {
return; return;
...@@ -489,7 +513,7 @@ public class LauncherActivity extends Activity { ...@@ -489,7 +513,7 @@ public class LauncherActivity extends Activity {
DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE); DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
Display[] displays = displayManager.getDisplays(); Display[] displays = displayManager.getDisplays();
if (CollectionUtils.isEmpty(displays) || displays.length < 2) { if (CollectionUtils.isEmpty(displays) || displays.length < 2) {
Toast.makeText(this, "未获取到菜单屏硬件", Toast.LENGTH_SHORT).show(); Utils.showToast(this, "未获取到菜单屏硬件");
return; return;
} }
menu = new MenuPresentation(this, displays[1]); menu = new MenuPresentation(this, displays[1]);
...@@ -498,7 +522,7 @@ public class LauncherActivity extends Activity { ...@@ -498,7 +522,7 @@ public class LauncherActivity extends Activity {
private void hideMenuView() { private void hideMenuView() {
if (AppConfig.DEBUG) { if (AppConfig.DEBUG) {
Toast.makeText(this, "隐藏菜单屏", Toast.LENGTH_SHORT).show(); Utils.showToast(this, "隐藏菜单屏");
} }
if (menu == null) { if (menu == null) {
return; return;
...@@ -522,6 +546,15 @@ public class LauncherActivity extends Activity { ...@@ -522,6 +546,15 @@ public class LauncherActivity extends Activity {
PushMessageReceiver.unsubscribe(Base.PUSH_ACTION_SKU_STATE_CHANGED); PushMessageReceiver.unsubscribe(Base.PUSH_ACTION_SKU_STATE_CHANGED);
} }
private void regsitGoodsChangeListener() {
goodsChangeHandler = new GoodsChangeHandler();
PushMessageReceiver.subscribe(Base.PUSH_ACTION_GOODS_CHANGED, goodsChangeHandler);
}
private void unregsitGoodsChangeListener() {
PushMessageReceiver.unsubscribe(Base.PUSH_ACTION_GOODS_CHANGED);
}
class SkuStateChangeHandler extends Handler { class SkuStateChangeHandler extends Handler {
@Override @Override
public void handleMessage(@NonNull Message msg) { public void handleMessage(@NonNull Message msg) {
...@@ -591,4 +624,12 @@ public class LauncherActivity extends Activity { ...@@ -591,4 +624,12 @@ public class LauncherActivity extends Activity {
} }
} }
} }
class GoodsChangeHandler extends Handler {
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
loadData();
}
}
} }
package com.ihaoin.hooloo.device.view; package com.ihaoin.hooloo.device.view;
import android.content.Context; import android.content.Context;
import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.LayoutInflater; import android.view.LayoutInflater;
...@@ -12,7 +11,6 @@ import android.view.animation.AnimationUtils; ...@@ -12,7 +11,6 @@ import android.view.animation.AnimationUtils;
import android.widget.ListView; import android.widget.ListView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
...@@ -29,13 +27,10 @@ import com.ihaoin.hooloo.device.util.RandomUtils; ...@@ -29,13 +27,10 @@ import com.ihaoin.hooloo.device.util.RandomUtils;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class TrolleyView extends RelativeLayout { public class TrolleyView extends RelativeLayout {
private List<TrolleyGoods> trolleyGoods = new ArrayList<>();
private Boolean state = false; private Boolean state = false;
private Boolean trolleyAniming = false; private Boolean trolleyAniming = false;
...@@ -48,7 +43,7 @@ public class TrolleyView extends RelativeLayout { ...@@ -48,7 +43,7 @@ public class TrolleyView extends RelativeLayout {
private TextView txtTotal; private TextView txtTotal;
private View butnPay; private View butnPay;
TrolleyAdapter trolleyAdapter; private TrolleyAdapter trolleyAdapter;
private void init() { private void init() {
View view = LayoutInflater.from(getContext()).inflate(R.layout.view_trolley, this); View view = LayoutInflater.from(getContext()).inflate(R.layout.view_trolley, this);
...@@ -94,38 +89,27 @@ public class TrolleyView extends RelativeLayout { ...@@ -94,38 +89,27 @@ public class TrolleyView extends RelativeLayout {
public void handleMessage(@NonNull Message msg) { public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg); super.handleMessage(msg);
if (msg.what != 1) { if (msg.what != 1) {
Toast.makeText(getContext(), R.string.error_check_sku, Toast.LENGTH_SHORT).show(); Utils.showToast(getContext(), R.string.error_check_sku);
return; return;
} }
addGoods(goods, sku, count); addGoods(goods, sku, count);
} }
} }
private Integer getCountOfOrder() {
if (HLApplication.getMainData() == null || HLApplication.getMainData().getCountOfOrder() == null) {
return 9;
}
return HLApplication.getMainData().getCountOfOrder();
}
/** 添加商品到购物车 - 商品详情、商品列表 */ /** 添加商品到购物车 - 商品详情、商品列表 */
public void addGoods(Goods goods, Sku sku, Integer count) { public void addGoods(Goods goods, Sku sku, Integer count) {
// if (!checkSkuState(sku.getSkuId())) { if (HLApplication.getGoodsCount() >= HLApplication.getCountOfOrder()) {
// Toast.makeText(this.getContext(), R.string.error_sku_state, Toast.LENGTH_SHORT).show(); Utils.showToast(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getCountOfOrder().toString()));
// return;
// }
if (getCount() >= getCountOfOrder()) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, getCountOfOrder().toString()), Toast.LENGTH_SHORT).show();
return; return;
} }
Optional<TrolleyGoods> optional = this.trolleyGoods.stream().filter(x -> x.getGoods().getGoodsId().equals(goods.getGoodsId()) && x.getSku().getSkuId().equals(sku.getSkuId())).findAny(); Optional<TrolleyGoods> optional = HLApplication.getTrolleyGoods().stream().filter(x -> x.getGoods().getGoodsId().equals(goods.getGoodsId()) && x.getSku().getSkuId().equals(sku.getSkuId())).findAny();
// 判断是否在购物车里存在同样规格的产品 // 判断是否在购物车里存在同样规格的产品
if (optional.isPresent()) { if (optional.isPresent()) {
TrolleyGoods g = optional.get(); TrolleyGoods g = optional.get();
g.setCount(g.getCount() + count); g.setCount(g.getCount() + count);
} else { } else {
TrolleyGoods g = new TrolleyGoods(); TrolleyGoods g = new TrolleyGoods();
g.setId(RandomUtils.nextLong(trolleyGoods.stream().map(TrolleyGoods::getId).collect(Collectors.toList()))); g.setId(RandomUtils.nextLong(HLApplication.getTrolleyGoods().stream().map(TrolleyGoods::getId).collect(Collectors.toList())));
g.setChecked(true); g.setChecked(true);
g.setGoods(goods); g.setGoods(goods);
g.setSku(sku); g.setSku(sku);
...@@ -141,7 +125,7 @@ public class TrolleyView extends RelativeLayout { ...@@ -141,7 +125,7 @@ public class TrolleyView extends RelativeLayout {
// g.setDiscount(sku.getDiscount()); // g.setDiscount(sku.getDiscount());
// g.setRules(sku.getRules()); // g.setRules(sku.getRules());
g.setCount(count); g.setCount(count);
this.trolleyGoods.add(g); HLApplication.getTrolleyGoods().add(g);
} }
this.goodsChanged(); this.goodsChanged();
...@@ -149,24 +133,20 @@ public class TrolleyView extends RelativeLayout { ...@@ -149,24 +133,20 @@ public class TrolleyView extends RelativeLayout {
/** 购物车商品增加数量 */ /** 购物车商品增加数量 */
public void addGoods(Integer position) { public void addGoods(Integer position) {
// if (!checkSkuState(goods.getSkuId())) { if (HLApplication.getGoodsCount() >= HLApplication.getCountOfOrder()) {
// Toast.makeText(this.getContext(), R.string.error_sku_state, Toast.LENGTH_SHORT).show(); Utils.showToast(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getCountOfOrder().toString()));
// return;
// }
if (getCount() >= getCountOfOrder()) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, getCountOfOrder().toString()), Toast.LENGTH_SHORT).show();
return; return;
} }
TrolleyGoods goods = this.trolleyGoods.get(position); TrolleyGoods goods = HLApplication.getTrolleyGoods().get(position);
goods.setCount(goods.getCount() + 1); goods.setCount(goods.getCount() + 1);
this.goodsChanged(); this.goodsChanged();
} }
/** 购物车商品减少数量 */ /** 购物车商品减少数量 */
public void subtractGoods(Integer position) { public void subtractGoods(Integer position) {
TrolleyGoods goods = this.trolleyGoods.get(position); TrolleyGoods goods = HLApplication.getTrolleyGoods().get(position);
if (goods.getCount() <= 1) { if (goods.getCount() <= 1) {
this.trolleyGoods.remove(goods); HLApplication.getTrolleyGoods().remove(goods);
} else { } else {
goods.setCount(goods.getCount() - 1); goods.setCount(goods.getCount() - 1);
} }
...@@ -175,38 +155,22 @@ public class TrolleyView extends RelativeLayout { ...@@ -175,38 +155,22 @@ public class TrolleyView extends RelativeLayout {
public void goodsChanged() { public void goodsChanged() {
this.trolleyAdapter.notifyDataSetChanged(); this.trolleyAdapter.notifyDataSetChanged();
this.txtCount.setText(getCheckedCount().toString()); this.txtCount.setText(HLApplication.getGoodsCheckedCount().toString());
this.txtTotal.setText(Utils.toString(getCheckedTotal())); this.txtTotal.setText(Utils.toString(HLApplication.getGoodsCheckedTotal()));
this.setView(); this.setView();
this.measureListHeight(); this.measureListHeight();
} }
public Boolean checkGoodsCount() { public Boolean checkGoodsCount() {
if (getCount() > getCountOfOrder()) { if (HLApplication.getGoodsCount() > HLApplication.getCountOfOrder()) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, getCountOfOrder().toString()), Toast.LENGTH_SHORT).show(); Utils.showToast(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getCountOfOrder().toString()));
return false; return false;
} }
return true; return true;
} }
private Integer getCount() {
return this.getTrolleyGoods().stream().mapToInt(TrolleyGoods::getCount).sum();
}
private Integer getCheckedCount() {
return this.getTrolleyGoods().stream().filter(TrolleyGoods::getChecked).mapToInt(TrolleyGoods::getCount).sum();
}
private BigDecimal getTotal() {
return this.getTrolleyGoods().stream().map(x -> x.getSku().getDiscount().multiply(new BigDecimal(x.getCount()))).reduce(BigDecimal.ZERO, BigDecimal::add);
}
private BigDecimal getCheckedTotal() {
return this.getTrolleyGoods().stream().filter(TrolleyGoods::getChecked).map(x -> x.getSku().getDiscount().multiply(new BigDecimal(x.getCount()))).reduce(BigDecimal.ZERO, BigDecimal::add);
}
private void setView() { private void setView() {
if (this.trolleyGoods.isEmpty()) { if (HLApplication.getTrolleyGoods().isEmpty()) {
this.setVisibility(View.INVISIBLE); this.setVisibility(View.INVISIBLE);
viewBackground.setVisibility(View.INVISIBLE); viewBackground.setVisibility(View.INVISIBLE);
layoutTrolley.setVisibility(View.INVISIBLE); layoutTrolley.setVisibility(View.INVISIBLE);
...@@ -219,7 +183,7 @@ public class TrolleyView extends RelativeLayout { ...@@ -219,7 +183,7 @@ public class TrolleyView extends RelativeLayout {
} }
private void measureListHeight() { private void measureListHeight() {
int count = this.trolleyGoods.size() > 3 ? 3 : this.trolleyGoods.size(); int count = HLApplication.getTrolleyGoods().size() > 3 ? 3 : HLApplication.getTrolleyGoods().size();
int height = Utils.getDimens(this.getContext(), R.dimen.trolley_item_height) * count; int height = Utils.getDimens(this.getContext(), R.dimen.trolley_item_height) * count;
ViewGroup.LayoutParams layoutParams = listTrolley.getLayoutParams(); ViewGroup.LayoutParams layoutParams = listTrolley.getLayoutParams();
layoutParams.height = height; layoutParams.height = height;
...@@ -227,7 +191,7 @@ public class TrolleyView extends RelativeLayout { ...@@ -227,7 +191,7 @@ public class TrolleyView extends RelativeLayout {
} }
public void clearTrolley() { public void clearTrolley() {
this.trolleyGoods.clear(); HLApplication.getTrolleyGoods().clear();
setView(); setView();
} }
...@@ -299,23 +263,16 @@ public class TrolleyView extends RelativeLayout { ...@@ -299,23 +263,16 @@ public class TrolleyView extends RelativeLayout {
} }
private void showPayDialog() { private void showPayDialog() {
if (getCheckedCount() <= 0) { if (HLApplication.getGoodsCheckedCount() <= 0) {
Toast.makeText(getContext(), R.string.error_choose_goods, Toast.LENGTH_LONG).show(); Utils.showToast(getContext(), R.string.error_choose_goods);
return; return;
} }
if (getCheckedTotal().compareTo(BigDecimal.ZERO) < 0) { if (HLApplication.getGoodsCheckedTotal().compareTo(BigDecimal.ZERO) < 0) {
Toast.makeText(getContext(), R.string.error_price, Toast.LENGTH_LONG).show(); Utils.showToast(getContext(), R.string.error_price);
return; return;
} }
Utils.showConfirmOrder(getContext(), trolleyGoods); Utils.showConfirmOrder(getContext(), HLApplication.getTrolleyGoods());
}
class CheckSkuStateHandler extends Handler {
@Override
public void handleMessage(@NonNull Message msg) {
}
} }
public TrolleyView(Context context) { public TrolleyView(Context context) {
...@@ -337,8 +294,4 @@ public class TrolleyView extends RelativeLayout { ...@@ -337,8 +294,4 @@ public class TrolleyView extends RelativeLayout {
super(context, attrs, defStyleAttr, defStyleRes); super(context, attrs, defStyleAttr, defStyleRes);
init(); init();
} }
public List<TrolleyGoods> getTrolleyGoods() {
return trolleyGoods;
}
} }
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="2dp" /> <corners android:radius="1px" />
<solid <solid
android:width="1dp" android:width="1px"
android:color="@color/colorPrimary" /> android:color="@color/colorPrimary" />
</shape> </shape>
</item> </item>
......
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30px"
android:height="30px"
android:viewportWidth="30"
android:viewportHeight="30">
<path
android:fillColor="@color/textGrayD8"
android:pathData="M0,0L30,30L0,30"
android:strokeWidth="1" />
<path
android:fillColor="@color/textGrayF6"
android:pathData="M0,0L30,30L30,0"
android:strokeWidth="0.5" />
</vector>
\ No newline at end of file
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="@dimen/rule_recommend_corners" /> <corners android:radius="1px" />
<solid <solid
android:width="1dp" android:width="1px"
android:color="@color/colorPink" /> android:color="@color/colorPink" />
</shape> </shape>
</item> </item>
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="5dp" /> <corners android:radius="1px" />
<solid
android:width="1px"
android:color="@color/textGrayF0" />
</shape> </shape>
</item> </item>
</layer-list> </layer-list>
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="2dp" /> <corners android:radius="2px" />
<stroke <solid android:color="@color/textGrayF0" />
android:width="1dp" <!-- <stroke-->
android:color="@color/colorPrimary" /> <!-- android:width="1dp"-->
<!-- android:color="@color/colorPrimary" />-->
</shape> </shape>
</item> </item>
</layer-list> </layer-list>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:alpha="0.9"
android:tint="@color/colorPrimary"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/colorPrimary"
android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z" />
</vector>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item> <item>
<shape android:shape="oval"> <shape android:shape="oval">
<solid android:color="@color/colorPrimary" /> <solid android:color="@color/colorPink" />
<size <size
android:width="30dp" android:width="30dp"
android:height="30dp" /> android:height="30dp" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp" xmlns:aapt="http://schemas.android.com/aapt"
android:height="30dp" android:width="33dp"
android:viewportWidth="30" android:height="33dp"
android:viewportHeight="30"> android:viewportWidth="33"
android:viewportHeight="33">
<path <path
android:pathData="M0,0L0,30" android:pathData="M0,0L0,33"
android:strokeWidth="2" android:strokeWidth="0.5"
android:strokeColor="@color/line" />
<path
android:pathData="M1,0L1,30"
android:strokeWidth="3"
android:strokeColor="@color/colorPrimary" /> android:strokeColor="@color/colorPrimary" />
<path
android:pathData="M18,30L18,33"
android:strokeWidth="31"
android:strokeColor="#FFFFFFFF">
<aapt:attr name="android:fillColor">
<gradient
android:endColor="#33DDDDDD"
android:endX="18"
android:endY="30"
android:startColor="#00FFFFFF"
android:startX="18"
android:startY="33"
android:type="linear"></gradient>
</aapt:attr>
</path>
</vector> </vector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp" android:width="33dp"
android:height="30dp" android:height="33dp"
android:viewportWidth="30" android:viewportWidth="33"
android:viewportHeight="30"> android:viewportHeight="33">
<path <path
android:pathData="M0,0L0,30" android:pathData="M0,0L0,33"
android:strokeWidth="0.5" android:strokeWidth="0.5"
android:strokeColor="@color/line" /> android:strokeColor="@color/line" />
</vector> </vector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> <selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<item android:drawable="@mipmap/duigou_2x" android:state_checked="true" /> <item android:drawable="@mipmap/xuanzhong" android:state_checked="true" />
<item android:drawable="@mipmap/duigou_2x" android:state_selected="true" /> <item android:drawable="@mipmap/xuanzhong" android:state_selected="true" />
<item android:drawable="@mipmap/weixuanzhong_2x" /> <item android:drawable="@mipmap/weixuanzhong" />
</selector> </selector>
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
<item android:drawable="@drawable/bg_spec_checked" android:state_pressed="true" /> <item android:drawable="@drawable/bg_spec_checked" android:state_pressed="true" />
<item android:drawable="@drawable/bg_spec_checked" android:state_selected="true" /> <item android:drawable="@drawable/bg_spec_checked" android:state_selected="true" />
<item android:drawable="@drawable/bg_spec_checked" android:state_focused="true" /> <item android:drawable="@drawable/bg_spec_checked" android:state_focused="true" />
<item android:drawable="@drawable/bg_spec_uncheck" android:state_enabled="false" /> <item android:drawable="@drawable/bg_spec_disable" android:state_enabled="false" />
<item android:drawable="@drawable/bg_spec_uncheck" /> <item android:drawable="@drawable/bg_spec_uncheck" />
</selector> </selector>
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
<item android:color="@color/white" android:state_pressed="true" /> <item android:color="@color/white" android:state_pressed="true" />
<item android:color="@color/white" android:state_selected="true" /> <item android:color="@color/white" android:state_selected="true" />
<item android:color="@color/white" android:state_focused="true" /> <item android:color="@color/white" android:state_focused="true" />
<item android:color="@color/textDisable" android:state_enabled="false" /> <item android:color="@color/textGrayB3" android:state_enabled="false" />
<item android:color="@color/textPrimary" /> <item android:color="@color/textPrimary" />
</selector> </selector>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="@color/white">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.59375"
android:orientation="vertical"
android:paddingHorizontal="@dimen/recommend_padding">
<include layout="@layout/item_logo" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rec_recommend" android:id="@+id/rec_recommend"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="7"
android:descendantFocusability="afterDescendants" /> android:descendantFocusability="afterDescendants" />
</LinearLayout>
<FrameLayout <FrameLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/padding10" android:layout_weight="0.30833"
android:layout_weight="4.5"> android:paddingTop="@dimen/padding20">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rec_right" android:id="@+id/rec_right"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:descendantFocusability="afterDescendants" android:background="@color/white"
android:paddingTop="@dimen/padding20" /> android:descendantFocusability="afterDescendants" />
<include layout="@layout/item_goods_category" />
</FrameLayout> </FrameLayout>
<ScrollView <ScrollView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -40,13 +49,10 @@ ...@@ -40,13 +49,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/category_margin" android:layout_marginTop="@dimen/category_margin"
android:divider="@color/line"
android:dividerPadding="@dimen/category_divider_padding"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:showDividers="middle" /> android:showDividers="middle" />
<include <include
android:id="@+id/layout_tips"
layout="@layout/item_tips" layout="@layout/item_tips"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
......
...@@ -6,10 +6,8 @@ ...@@ -6,10 +6,8 @@
android:button="@null" android:button="@null"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:gravity="center" android:gravity="center"
android:paddingStart="@dimen/padding10" android:paddingHorizontal="@dimen/category_padding_hor"
android:paddingTop="@dimen/category_padding" android:paddingVertical="@dimen/category_padding_ver"
android:paddingEnd="@dimen/padding10"
android:paddingBottom="@dimen/category_padding"
android:textColor="@drawable/sel_category_color" android:textColor="@drawable/sel_category_color"
android:textSize="@dimen/ts_category_radio" /> android:textSize="@dimen/ts_category_radio" />
...@@ -5,12 +5,11 @@ ...@@ -5,12 +5,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal">
android:padding="@dimen/padding10">
<RelativeLayout <RelativeLayout
android:layout_width="@dimen/goods_thum_size" android:layout_width="@dimen/goods_thum_size"
android:layout_height="@dimen/goods_thum_size" android:layout_height="@dimen/goods_thum_size"
android:layout_marginEnd="@dimen/padding10"> android:layout_marginEnd="@dimen/goods_thum_margin_right">
<ImageView <ImageView
android:id="@+id/img_thumbnail" android:id="@+id/img_thumbnail"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -21,7 +20,7 @@ ...@@ -21,7 +20,7 @@
android:layout_width="@dimen/ic_recommend" android:layout_width="@dimen/ic_recommend"
android:layout_height="@dimen/ic_recommend" android:layout_height="@dimen/ic_recommend"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_margin="@dimen/padding5" android:layout_margin="@dimen/goods_recommend_margin"
android:src="@mipmap/aixin_2x" android:src="@mipmap/aixin_2x"
android:visibility="gone" /> android:visibility="gone" />
</RelativeLayout> </RelativeLayout>
...@@ -31,7 +30,8 @@ ...@@ -31,7 +30,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="bottom" android:gravity="bottom"
android:orientation="vertical"> android:orientation="vertical"
android:paddingEnd="@dimen/goods_padding_right">
<TextView <TextView
android:id="@+id/txt_name" android:id="@+id/txt_name"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -44,24 +44,24 @@ ...@@ -44,24 +44,24 @@
android:id="@+id/layout_tags" android:id="@+id/layout_tags"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding3" android:layout_marginTop="@dimen/goods_tag_margin_top"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" /> android:orientation="horizontal" />
<TextView <TextView
android:id="@+id/txt_intro" android:id="@+id/txt_intro"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding3" android:layout_marginTop="@dimen/goods_desc_margin_top"
android:ellipsize="end" android:ellipsize="end"
android:lines="1" android:lines="1"
android:text="茶叶与咖啡完美的碰撞" android:text=""
android:textColor="@color/textSecondPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_intro" /> android:textSize="@dimen/ts_goods_item_intro" />
<RelativeLayout <RelativeLayout
android:id="@+id/layout_butns" android:id="@+id/layout_butns"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding3"> android:layout_marginTop="@dimen/goods_butns_margin_top">
<TextView <TextView
android:id="@+id/ico_discount" android:id="@+id/ico_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -69,17 +69,19 @@ ...@@ -69,17 +69,19 @@
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:src="@drawable/ms__arrow" android:src="@drawable/ms__arrow"
android:text="¥" android:text="¥"
android:textColor="@color/textRed" android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_goods_item_price" /> android:textSize="@dimen/ts_goods_item_discount"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/txt_discount" android:id="@+id/txt_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginEnd="@dimen/goods_price_margin"
android:layout_toRightOf="@id/ico_discount" android:layout_toRightOf="@id/ico_discount"
android:text="19.9" android:text="19.9"
android:textColor="@color/textRed" android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_goods_item_price" android:textSize="@dimen/ts_goods_item_discount"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
...@@ -87,11 +89,10 @@ ...@@ -87,11 +89,10 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/padding5"
android:layout_toEndOf="@id/txt_discount" android:layout_toEndOf="@id/txt_discount"
android:text="¥" android:text="¥"
android:textColor="@color/textSecondPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" /> android:textSize="@dimen/ts_goods_item_price" />
<TextView <TextView
android:id="@+id/txt_price" android:id="@+id/txt_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -100,7 +101,7 @@ ...@@ -100,7 +101,7 @@
android:layout_toEndOf="@id/ico_price" android:layout_toEndOf="@id/ico_price"
android:text="29.9" android:text="29.9"
android:textColor="@color/textSecondPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" /> android:textSize="@dimen/ts_goods_item_price" />
<TextView <TextView
android:id="@+id/txt_sellout" android:id="@+id/txt_sellout"
...@@ -109,7 +110,7 @@ ...@@ -109,7 +110,7 @@
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:text="已售罄" android:text="已售罄"
android:textColor="@color/textRed" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_sellout" android:textSize="@dimen/ts_goods_item_sellout"
android:visibility="gone" /> android:visibility="gone" />
<Button <Button
...@@ -118,7 +119,7 @@ ...@@ -118,7 +119,7 @@
android:layout_width="@dimen/ic_add_size" android:layout_width="@dimen/ic_add_size"
android:layout_height="@dimen/ic_add_size" android:layout_height="@dimen/ic_add_size"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:background="@mipmap/jiahao_2x" android:background="@mipmap/jiahao"
android:foreground="?selectableItemBackground" /> android:foreground="?selectableItemBackground" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:background="@color/white">
android:padding="@dimen/padding10">
<TextView <TextView
android:id="@+id/txt_category" android:id="@+id/txt_category"
android:layout_width="match_parent" android:layout_width="match_parent"
android:paddingTop="@dimen/padding5"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="@dimen/goods_category_margin_top"
android:paddingBottom="@dimen/goods_category_margin_bottom"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/textPrimary" android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_category_item" android:textSize="@dimen/ts_category_item"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<FrameLayout <FrameLayout
android:id="@+id/logo" android:id="@+id/layout_logo"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:background="@color/colorLogo"
android:paddingHorizontal="@dimen/padding20"
android:paddingVertical="@dimen/padding15">
<ImageView <ImageView
android:layout_width="@dimen/logo_width" android:id="@+id/img_logo"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:src="@mipmap/logo_2x" /> android:src="@mipmap/logo" />
</FrameLayout> </FrameLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -17,10 +17,11 @@ ...@@ -17,10 +17,11 @@
android:id="@+id/txt_name" android:id="@+id/txt_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding20" android:layout_marginStart="@dimen/recommend_name_margin_left"
android:layout_marginTop="@dimen/padding20" android:layout_marginTop="@dimen/recommend_name_margin_top"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/white" android:text=""
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_recommend_name" android:textSize="@dimen/ts_recommend_name"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
...@@ -30,12 +31,13 @@ ...@@ -30,12 +31,13 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/txt_name" android:layout_below="@+id/txt_name"
android:layout_marginStart="@dimen/padding20" android:layout_marginStart="@dimen/recommend_desc_margin_left"
android:layout_marginBottom="@dimen/padding15" android:layout_marginTop="@dimen/recommend_desc_margin_top"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/white" android:text=""
android:textColor="@color/textDisable"
android:textSize="@dimen/ts_recommend_desc" android:textSize="@dimen/ts_recommend_desc"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintLeft_toLeftOf="parent" /> app:layout_constraintTop_toBottomOf="@+id/txt_name" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -7,15 +7,15 @@ ...@@ -7,15 +7,15 @@
android:id="@+id/txt_name" android:id="@+id/txt_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding10" android:layout_marginTop="@dimen/goods_detail_spec_margin_top"
android:text="温度" android:text="温度"
android:textColor="@color/textPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_detail_spec" android:textSize="@dimen/ts_detail_spec"
android:textStyle="bold" /> android:textStyle="bold" />
<LinearLayout <LinearLayout
android:id="@+id/layout_rules" android:id="@+id/layout_rules"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spec_rule_margin" android:layout_marginTop="@dimen/goods_detail_layout_rule_margin_top"
android:orientation="horizontal" /> android:orientation="horizontal" />
</LinearLayout> </LinearLayout>
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
android:id="@+id/butn_rule" android:id="@+id/butn_rule"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding5" android:layout_marginTop="@dimen/goods_detail_rule_margin_top"
android:layout_marginEnd="@dimen/padding10" android:layout_marginEnd="@dimen/goods_detail_rule_margin_right"
android:background="@drawable/sel_spec_bg" android:background="@drawable/sel_spec_bg"
android:paddingHorizontal="@dimen/padding10" android:foreground="?selectableItemBackground"
android:paddingVertical="@dimen/rule_vertical_padding" android:paddingHorizontal="@dimen/goods_detail_rule_padding_hor"
android:paddingVertical="@dimen/goods_detail_rule_padding_ver"
android:singleLine="true" android:singleLine="true"
android:text="加糖" android:text="加糖"
android:foreground="?selectableItemBackground"
android:textColor="@drawable/sel_spec_color" android:textColor="@drawable/sel_spec_color"
android:textSize="@dimen/ts_detail_rule" android:textSize="@dimen/ts_detail_rule"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
...@@ -26,12 +26,11 @@ ...@@ -26,12 +26,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_spec_recommend" android:background="@drawable/bg_spec_recommend"
android:paddingHorizontal="@dimen/padding5" android:paddingHorizontal="@dimen/goods_detail_rec_padding_hor"
android:paddingVertical="@dimen/padding3" android:paddingVertical="@dimen/goods_detail_rec_padding_ver"
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
...@@ -2,14 +2,16 @@ ...@@ -2,14 +2,16 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingRight="@dimen/padding5"> android:paddingRight="@dimen/goods_tag_margin_right">
<TextView <TextView
android:id="@+id/txt_tag" android:id="@+id/txt_tag"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_tag" android:background="@drawable/bg_tag"
android:padding="@dimen/padding3" android:paddingVertical="@dimen/goods_tag_padding_ver"
android:paddingHorizontal="@dimen/goods_tag_padding_hor"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/colorPrimary" android:textColor="@color/textDisable"
android:text=""
android:textSize="@dimen/ts_goods_item_tag" /> android:textSize="@dimen/ts_goods_item_tag" />
</FrameLayout> </FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/layout_tips"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/tip_margin_top"
android:button="@null" android:button="@null"
android:drawableEnd="@drawable/ic_baseline_chevron_right_24"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:gravity="center" android:gravity="center"
android:lines="1" android:lines="1"
android:padding="@dimen/padding10" android:paddingTop="@dimen/tip_padding_top"
android:paddingBottom="@dimen/tip_padding_bottom"
android:text="温馨提示" android:text="温馨提示"
android:textColor="@color/colorPrimary" android:textColor="@color/textDisable"
android:textSize="@dimen/ts_tips" /> android:textSize="@dimen/ts_tips" />
</FrameLayout>
...@@ -5,7 +5,10 @@ ...@@ -5,7 +5,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="@dimen/padding10"> android:paddingStart="@dimen/trolley_item_padding_left"
android:paddingTop="@dimen/trolley_item_padding_top"
android:paddingEnd="@dimen/trolley_item_padding_right"
android:paddingBottom="@dimen/trolley_item_padding_bottom">
<ToggleButton <ToggleButton
android:id="@+id/butn_state" android:id="@+id/butn_state"
style="@style/button_style" style="@style/button_style"
...@@ -18,10 +21,10 @@ ...@@ -18,10 +21,10 @@
android:textOn="" /> android:textOn="" />
<ImageView <ImageView
android:id="@+id/img_thumbnail" android:id="@+id/img_thumbnail"
android:layout_width="@dimen/goods_thum_size" android:layout_width="@dimen/trolley_thum_size"
android:layout_height="@dimen/goods_thum_size" android:layout_height="@dimen/trolley_thum_size"
android:layout_marginLeft="@dimen/padding10" android:layout_marginLeft="@dimen/trolley_thum_margin"
android:layout_marginRight="@dimen/padding10" android:layout_marginRight="@dimen/trolley_thum_margin"
android:scaleType="centerCrop" /> android:scaleType="centerCrop" />
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
...@@ -40,14 +43,14 @@ ...@@ -40,14 +43,14 @@
android:id="@+id/txt_options" android:id="@+id/txt_options"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding5" android:layout_marginTop="@dimen/trolley_options_margin_top"
android:text="冰/无糖" android:text="冰/无糖"
android:textColor="@color/textSecondPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_intro" /> android:textSize="@dimen/ts_goods_item_intro" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding5" android:layout_marginTop="@dimen/trolley_price_margin_top"
android:gravity="bottom" android:gravity="bottom"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
...@@ -55,32 +58,33 @@ ...@@ -55,32 +58,33 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="¥" android:text="¥"
android:textColor="@color/textRed" android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_goods_item_price" /> android:textSize="@dimen/ts_goods_item_discount"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/txt_discount" android:id="@+id/txt_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="19.9" android:text="19.9"
android:textColor="@color/textRed" android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_goods_item_price" android:textSize="@dimen/ts_goods_item_discount"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/ico_price" android:id="@+id/ico_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5" android:layout_marginStart="@dimen/trolley_price_margin_left"
android:text="¥" android:text="¥"
android:textColor="@color/textSecondPrimary" android:textColor="@color/textDisable"
android:textSize="@dimen/ts_goods_item_discount" /> android:textSize="@dimen/ts_goods_item_price" />
<TextView <TextView
android:id="@+id/txt_price" android:id="@+id/txt_price"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="29.9" android:text="29.9"
android:textColor="@color/textSecondPrimary" android:textColor="@color/textDisable"
android:textSize="@dimen/ts_goods_item_discount" /> android:textSize="@dimen/ts_goods_item_price" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -94,14 +98,14 @@ ...@@ -94,14 +98,14 @@
style="@style/button_style" style="@style/button_style"
android:layout_width="@dimen/ic_subtract_size" android:layout_width="@dimen/ic_subtract_size"
android:layout_height="@dimen/ic_subtract_size" android:layout_height="@dimen/ic_subtract_size"
android:background="@mipmap/jianhao_2x" android:background="@mipmap/jianhao"
android:foreground="?selectableItemBackground" /> android:foreground="?selectableItemBackground" />
<TextView <TextView
android:id="@+id/txt_count" android:id="@+id/txt_count"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/padding10" android:layout_marginLeft="@dimen/trolley_count_margin"
android:layout_marginRight="@dimen/padding10" android:layout_marginRight="@dimen/trolley_count_margin"
android:text="1" android:text="1"
android:textColor="@color/textPrimary" android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_trolley_item_count" android:textSize="@dimen/ts_trolley_item_count"
...@@ -111,7 +115,7 @@ ...@@ -111,7 +115,7 @@
style="@style/button_style" style="@style/button_style"
android:layout_width="@dimen/ic_add_size" android:layout_width="@dimen/ic_add_size"
android:layout_height="@dimen/ic_add_size" android:layout_height="@dimen/ic_add_size"
android:background="@mipmap/jiahao_2x" android:background="@mipmap/jiahao"
android:foreground="?selectableItemBackground" /> android:foreground="?selectableItemBackground" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root" android:id="@+id/layout_root"
android:layout_width="wrap_content" android:layout_width="@dimen/confirm_order_width"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white" android:background="@color/white"
android:padding="@dimen/padding15"> android:paddingTop="@dimen/confirm_order_padding_top"
android:paddingBottom="@dimen/confirm_order_padding_bottom">
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -19,13 +20,13 @@ ...@@ -19,13 +20,13 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/title" android:layout_below="@+id/title"
android:layout_marginTop="@dimen/padding10" android:layout_marginTop="@dimen/confirm_order_qr_margin_top"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/img_qrcode" android:id="@+id/img_qrcode"
android:layout_width="@dimen/qrcode_size" android:layout_width="@dimen/confirm_order_qrcode_size"
android:layout_height="@dimen/qrcode_size" android:layout_height="@dimen/confirm_order_qrcode_size"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:src="@mipmap/qrcode" /> android:src="@mipmap/qrcode" />
<LinearLayout <LinearLayout
...@@ -34,63 +35,54 @@ ...@@ -34,63 +35,54 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding20"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/ic_scan_wx"
android:layout_height="@dimen/ic_scan_wx"
android:src="@mipmap/weixin_2x" />
<TextView <TextView
android:id="@+id/txt_scan" android:id="@+id/txt_scan"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5" android:layout_marginTop="@dimen/confirm_order_text_one"
android:text="使用微信扫一扫,确认订单并付款" android:text="使用微信扫一扫,确认订单并付款"
android:textColor="@color/textPrimary" android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_scan" /> android:textSize="@dimen/ts_scan" />
</LinearLayout>
<TextView <TextView
android:id="@+id/txt_expire" android:id="@+id/txt_expire"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding5" android:layout_marginTop="@dimen/confirm_order_text_two"
android:text="60秒后失效" android:text="60秒后失效"
android:textColor="@color/textPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_expire" /> android:textSize="@dimen/ts_expire" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/layout_succeed" android:id="@+id/layout_succeed"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/confirm_order_text_one"
android:gravity="center_vertical" android:gravity="center_vertical"
android:visibility="gone"> android:visibility="gone">
<ImageView <ImageView
android:id="@+id/img_succeed" android:id="@+id/img_succeed"
android:layout_width="@dimen/ic_scan_succ" android:layout_width="@dimen/ic_scan_succ_width"
android:layout_height="@dimen/ic_scan_succ" android:layout_height="@dimen/ic_scan_succ_height"
android:src="@mipmap/weixinduigou_2x" /> android:src="@mipmap/zhifuchenggong" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5" android:layout_marginStart="@dimen/confirm_order_icon_margin"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/txt_return" android:id="@+id/txt_return"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="扫码成功(1秒后转到首页)" android:text="扫码成功"
android:textColor="@color/textPrimary" android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_scan" /> android:textSize="@dimen/ts_scan"
android:textStyle="bold" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding5" android:layout_marginTop="@dimen/confirm_order_text_two"
android:text="在微信小程序上确认订单并付款" android:text="在微信小程序上确认订单并付款"
android:textColor="@color/textPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_expire" /> android:textSize="@dimen/ts_expire" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
...@@ -107,6 +99,7 @@ ...@@ -107,6 +99,7 @@
android:layout_width="@dimen/ic_dialog_close" android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close" android:layout_height="@dimen/ic_dialog_close"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginRight="@dimen/confirm_order_padding_top"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:src="@mipmap/chahao_2x" /> android:src="@mipmap/chazi" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android" <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0.5dp" android:layout_height="1px"
android:background="@color/line" /> android:background="@color/line" />
\ No newline at end of file
...@@ -15,5 +15,5 @@ ...@@ -15,5 +15,5 @@
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_margin="@dimen/padding15" android:layout_margin="@dimen/padding15"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:src="@mipmap/chahao_2x" /> android:src="@mipmap/chazi" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/txt_toast"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@color/textGray2B"
android:gravity="center"
android:maxWidth="@dimen/toast_width"
android:paddingHorizontal="@dimen/toast_padding_hor"
android:paddingVertical="@dimen/toast_padding_ver"
android:text="默认规格已售罄,已添加其它规格"
android:textColor="@color/white"
android:textSize="@dimen/ts_toast" />
</RelativeLayout>
\ No newline at end of file
...@@ -25,10 +25,11 @@ ...@@ -25,10 +25,11 @@
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding10"
android:layout_weight="1" android:layout_weight="1"
android:paddingHorizontal="@dimen/trolley_title_margin_hor"
android:paddingVertical="@dimen/trolley_title_margin_ver"
android:text="购物袋" android:text="购物袋"
android:textColor="@android:color/black" android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_trolley_name" android:textSize="@dimen/ts_trolley_name"
android:textStyle="bold" /> android:textStyle="bold" />
<LinearLayout <LinearLayout
...@@ -37,24 +38,25 @@ ...@@ -37,24 +38,25 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal">
android:padding="@dimen/padding20">
<ImageView <ImageView
android:layout_width="@dimen/ic_clear_size" android:layout_width="@dimen/ic_clear_size"
android:layout_height="@dimen/ic_clear_size" android:layout_height="@dimen/ic_clear_size"
android:src="@mipmap/lajitong_2x" /> android:src="@mipmap/lajitong" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5" android:layout_marginStart="@dimen/trolley_clear_text_margin_left"
android:layout_marginEnd="@dimen/trolley_clear_text_margin_right"
android:text="清空购物袋" android:text="清空购物袋"
android:textColor="@color/textSecondPrimary" android:textColor="@color/textDisable"
android:textSize="@dimen/ts_trolley_clear" /> android:textSize="@dimen/ts_trolley_clear" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0.5dp" android:layout_height="1px"
android:layout_marginHorizontal="@dimen/trolley_line_margin"
android:background="@color/line" /> android:background="@color/line" />
<ListView <ListView
android:id="@+id/list_trolley" android:id="@+id/list_trolley"
...@@ -62,10 +64,6 @@ ...@@ -62,10 +64,6 @@
android:layout_height="@dimen/trolley_item_height" android:layout_height="@dimen/trolley_item_height"
android:descendantFocusability="afterDescendants" android:descendantFocusability="afterDescendants"
android:divider="@null" /> android:divider="@null" />
<ImageView
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/line" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
...@@ -78,20 +76,20 @@ ...@@ -78,20 +76,20 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<RelativeLayout <RelativeLayout
android:layout_width="@dimen/trolley_ic_border_size" android:layout_width="@dimen/trolley_ic_parent_width"
android:layout_height="match_parent"> android:layout_height="@dimen/trolley_ic_parent_height"
android:layout_marginStart="@dimen/trolley_ic_margin_left">
<ImageView <ImageView
android:id="@+id/img_trolley" android:id="@+id/img_trolley"
android:layout_width="@dimen/trolley_ic_size" android:layout_width="@dimen/trolley_ic_width"
android:layout_height="@dimen/trolley_ic_size" android:layout_height="@dimen/trolley_ic_height"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:src="@mipmap/handbag_2x" /> android:src="@mipmap/gouwudai" />
<TextView <TextView
android:id="@+id/txt_count" android:id="@+id/txt_count"
android:layout_width="@dimen/trolley_count_size" android:layout_width="@dimen/trolley_count_size"
android:layout_height="@dimen/trolley_count_size" android:layout_height="@dimen/trolley_count_size"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_margin="@dimen/padding7"
android:background="@drawable/ic_dot" android:background="@drawable/ic_dot"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
...@@ -110,7 +108,8 @@ ...@@ -110,7 +108,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="¥" android:text="¥"
android:textColor="@color/textPrimary" android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_trolley_total" /> android:textSize="@dimen/ts_trolley_total"
android:textStyle="bold" />
<TextView <TextView
android:id="@+id/txt_total" android:id="@+id/txt_total"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorLogo">#FF006ECF</color> <color name="colorLogo">#FF006ECF</color>
<color name="colorPrimary">#FF2C9CFF</color> <color name="colorPrimary">#FF003AE9</color>
<color name="dialog_bg">#CC000000</color> <color name="dialog_bg">#99000000</color>
<color name="textPrimary">#FF000000</color> <color name="textPrimary">#FF333333</color>
<color name="textSecondPrimary">#FF666666</color> <color name="textSecondPrimary">#FF666666</color>
<color name="textDisable">#FF999999</color> <color name="textDisable">#FF999999</color>
<color name="line">#FF979797</color> <color name="textGray2B">#FF2B2B2B</color>
<color name="textRed">#FFFF001D</color> <color name="textGrayB3">#FFB3B3B3</color>
<color name="textGrayF0">#FFF0F0F0</color>
<color name="textGrayF6">#FFF6F6F6</color>
<color name="textGrayD8">#FFD8D8D8</color>
<color name="line">#FFECECEC</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="colorPrimaryDark">#FF00574B</color>
<color name="colorAccent">#FFD81B60</color>
<color name="colorPink">#FFFF72C1</color> <color name="colorPink">#FFFF72C1</color>
</resources> </resources>
...@@ -5,56 +5,121 @@ ...@@ -5,56 +5,121 @@
<dimen name="padding7">7dp</dimen> <dimen name="padding7">7dp</dimen>
<dimen name="padding5">5dp</dimen> <dimen name="padding5">5dp</dimen>
<dimen name="padding3">3dp</dimen> <dimen name="padding3">3dp</dimen>
<dimen name="rule_vertical_padding">3dp</dimen> <dimen name="toast_width">376px</dimen>
<dimen name="spec_rule_margin">5dp</dimen> <dimen name="toast_padding_hor">32px</dimen>
<dimen name="logo_width">200dp</dimen> <dimen name="toast_padding_ver">55px</dimen>
<dimen name="logo_padding">20dp</dimen> <dimen name="recommend_padding">5dp</dimen>
<dimen name="recommend_name_margin_top">82px</dimen>
<dimen name="recommend_name_margin_left">68px</dimen>
<dimen name="recommend_desc_margin_top">30px</dimen>
<dimen name="recommend_desc_margin_left">68px</dimen>
<dimen name="goods_padding_right">38px</dimen>
<dimen name="goods_padding_bottom">50px</dimen>
<dimen name="goods_thum_size">80dp</dimen> <dimen name="goods_thum_size">80dp</dimen>
<dimen name="category_padding">20dp</dimen> <dimen name="goods_thum_margin_right">10dp</dimen>
<dimen name="goods_recommend_margin">5dp</dimen>
<dimen name="goods_category_margin_top">20dp</dimen>
<dimen name="goods_category_margin_bottom">20dp</dimen>
<dimen name="goods_tag_margin_top">3dp</dimen>
<dimen name="goods_tag_padding_ver">3px</dimen>
<dimen name="goods_tag_padding_hor">9px</dimen>
<dimen name="goods_tag_margin_right">16px</dimen>
<dimen name="goods_desc_margin_top">26px</dimen>
<dimen name="goods_butns_margin_top">25px</dimen>
<dimen name="goods_price_margin">5px</dimen>
<dimen name="category_padding_ver">67px</dimen>
<dimen name="category_padding_hor">35px</dimen>
<dimen name="category_margin">50dp</dimen> <dimen name="category_margin">50dp</dimen>
<dimen name="category_divider_padding">20dp</dimen> <dimen name="category_divider_padding">0px</dimen>
<dimen name="tip_margin_top">40px</dimen>
<dimen name="tip_padding_top">33px</dimen>
<dimen name="tip_padding_bottom">33px</dimen>
<dimen name="menu_divider_padding_hor">10dp</dimen> <dimen name="menu_divider_padding_hor">10dp</dimen>
<dimen name="menu_divider_padding_ver">40dp</dimen> <dimen name="menu_divider_padding_ver">40dp</dimen>
<dimen name="qrcode_size">150dp</dimen>
<dimen name="goods_detail_padding_ver">55px</dimen>
<dimen name="goods_detail_padding_hor">40px</dimen>
<dimen name="goods_detail_content_margin_left">40px</dimen>
<dimen name="goods_detail_image_margin_top">50px</dimen>
<dimen name="goods_detail_spec_margin_top">25px</dimen>
<dimen name="goods_detail_rule_margin_top">28px</dimen>
<dimen name="goods_detail_rule_margin_right">16px</dimen>
<dimen name="goods_detail_rule_padding_hor">60px</dimen>
<dimen name="goods_detail_rule_padding_ver">10px</dimen>
<dimen name="goods_detail_layout_rule_margin_top">17dp</dimen>
<dimen name="goods_detail_rec_padding_hor">12px</dimen>
<dimen name="goods_detail_rec_padding_ver">5px</dimen>
<dimen name="goods_detail_oper_margin_top">24px</dimen>
<dimen name="goods_detail_oper_margin_left">55px</dimen>
<dimen name="goods_detail_oper_margin_bottom">28px</dimen>
<dimen name="goods_detail_oper_margin_right">35px</dimen>
<dimen name="goods_detail_butn_margin_top">28px</dimen>
<dimen name="goods_detail_butn_padding">23px</dimen>
<dimen name="goods_detail_count_margin_left">36px</dimen>
<dimen name="goods_detail_count_margin_right">40px</dimen>
<dimen name="dialog_detail_width">600dp</dimen> <dimen name="dialog_detail_width">600dp</dimen>
<dimen name="dialog_tip_width">600dp</dimen> <dimen name="dialog_tip_width">600dp</dimen>
<dimen name="dialog_close_margin">15dp</dimen>
<dimen name="trolley_width">400dp</dimen> <dimen name="trolley_width">400dp</dimen>
<dimen name="trolley_item_height">100dp</dimen> <dimen name="trolley_item_height">100dp</dimen>
<dimen name="trolley_bar_height">60dp</dimen> <dimen name="trolley_bar_height">60dp</dimen>
<dimen name="trolley_bar_goods_margin">80dp</dimen> <dimen name="trolley_bar_goods_margin">300dp</dimen>
<dimen name="trolley_pay_width">150dp</dimen> <dimen name="trolley_pay_width">150dp</dimen>
<dimen name="trolley_ic_size">40dp</dimen> <dimen name="trolley_ic_margin_left">80px</dimen>
<dimen name="trolley_ic_parent_width">110px</dimen>
<dimen name="trolley_ic_parent_height">120px</dimen>
<dimen name="trolley_ic_width">92dp</dimen>
<dimen name="trolley_ic_height">110dp</dimen>
<dimen name="trolley_ic_border_size">50dp</dimen> <dimen name="trolley_ic_border_size">50dp</dimen>
<dimen name="trolley_count_size">20dp</dimen> <dimen name="trolley_count_size">20dp</dimen>
<dimen name="rule_recommend_corners">3dp</dimen> <dimen name="trolley_title_margin_ver">30px</dimen>
<dimen name="trolley_title_margin_hor">38px</dimen>
<dimen name="trolley_clear_text_margin_left">8px</dimen>
<dimen name="trolley_clear_text_margin_right">30px</dimen>
<dimen name="trolley_line_margin">40px</dimen>
<dimen name="trolley_thum_size">142px</dimen>
<dimen name="trolley_thum_margin">40px</dimen>
<dimen name="trolley_item_padding_top">40px</dimen>
<dimen name="trolley_item_padding_left">40px</dimen>
<dimen name="trolley_item_padding_bottom">20px</dimen>
<dimen name="trolley_item_padding_right">40px</dimen>
<dimen name="trolley_options_margin_top">16px</dimen>
<dimen name="trolley_price_margin_top">25px</dimen>
<dimen name="trolley_price_margin_left">11px</dimen>
<dimen name="trolley_count_margin">28px</dimen>
<dimen name="confirm_order_width">1000px</dimen>
<dimen name="confirm_order_padding_top">62px</dimen>
<dimen name="confirm_order_padding_bottom">37px</dimen>
<dimen name="confirm_order_qr_margin_top">45px</dimen>
<dimen name="confirm_order_qrcode_size">375px</dimen>
<dimen name="confirm_order_icon_margin">40px</dimen>
<dimen name="confirm_order_text_one">62px</dimen>
<dimen name="confirm_order_text_two">7px</dimen>
<dimen name="ic_recommend">10dp</dimen> <dimen name="ic_recommend">10dp</dimen>
<dimen name="ic_clear_size">15dp</dimen> <dimen name="ic_clear_size">15dp</dimen>
<dimen name="ic_add_size">20dp</dimen> <dimen name="ic_add_size">20dp</dimen>
<dimen name="ic_subtract_size">20dp</dimen> <dimen name="ic_subtract_size">20dp</dimen>
<dimen name="ic_price">15dp</dimen>
<dimen name="ic_discount">10dp</dimen>
<dimen name="ic_checkbox">25dp</dimen> <dimen name="ic_checkbox">25dp</dimen>
<dimen name="ic_corners">10dp</dimen>
<dimen name="ic_detail_add_size">20dp</dimen> <dimen name="ic_detail_add_size">20dp</dimen>
<dimen name="ic_detail_subtract_size">20dp</dimen> <dimen name="ic_detail_subtract_size">20dp</dimen>
<dimen name="ic_detail_price">15dp</dimen>
<dimen name="ic_detail_discount">10dp</dimen>
<dimen name="ic_dialog_close">20dp</dimen> <dimen name="ic_dialog_close">20dp</dimen>
<dimen name="ic_trolley_price">30dp</dimen> <dimen name="ic_scan_succ_width">101px</dimen>
<dimen name="ic_scan_succ">40dp</dimen> <dimen name="ic_scan_succ_height">97px</dimen>
<dimen name="ic_scan_wx">20dp</dimen>
<dimen name="ts_toast">28px</dimen>
<dimen name="ts_trolley_item_price">20px</dimen>
<dimen name="ts_trolley_item_discount">22px</dimen>
<dimen name="ts_recommend_name">20sp</dimen> <dimen name="ts_recommend_name">20sp</dimen>
<dimen name="ts_recommend_desc">20sp</dimen> <dimen name="ts_recommend_desc">20sp</dimen>
<dimen name="ts_category_radio">12sp</dimen> <dimen name="ts_category_radio">12sp</dimen>
<dimen name="ts_category_item">18sp</dimen> <dimen name="ts_category_item">18sp</dimen>
<dimen name="ts_goods_item_name">14sp</dimen> <dimen name="ts_goods_item_name">14sp</dimen>
<dimen name="ts_goods_item_intro">12sp</dimen> <dimen name="ts_goods_item_intro">12sp</dimen>
<dimen name="ts_goods_item_price">12sp</dimen> <dimen name="ts_goods_item_price">9sp</dimen>
<dimen name="ts_goods_item_discount">9sp</dimen> <dimen name="ts_goods_item_discount">12sp</dimen>
<dimen name="ts_goods_item_sellout">12sp</dimen> <dimen name="ts_goods_item_sellout">12sp</dimen>
<dimen name="ts_goods_item_tag">9sp</dimen> <dimen name="ts_goods_item_tag">9sp</dimen>
<dimen name="ts_trolley_item_count">12sp</dimen> <dimen name="ts_trolley_item_count">12sp</dimen>
...@@ -69,9 +134,8 @@ ...@@ -69,9 +134,8 @@
<dimen name="ts_detail_spec_rec">6sp</dimen> <dimen name="ts_detail_spec_rec">6sp</dimen>
<dimen name="ts_detail_rule">12sp</dimen> <dimen name="ts_detail_rule">12sp</dimen>
<dimen name="ts_detail_count">14sp</dimen> <dimen name="ts_detail_count">14sp</dimen>
<dimen name="ts_detail_price">14sp</dimen> <dimen name="ts_detail_price">12sp</dimen>
<dimen name="ts_detail_discount">12sp</dimen> <dimen name="ts_detail_discount">14sp</dimen>
<dimen name="ts_detail_sellout">12sp</dimen>
<dimen name="ts_detail_add_trolley">14sp</dimen> <dimen name="ts_detail_add_trolley">14sp</dimen>
<dimen name="ts_detail_buynow">14sp</dimen> <dimen name="ts_detail_buynow">14sp</dimen>
<dimen name="ts_header_text">14sp</dimen> <dimen name="ts_header_text">14sp</dimen>
......
<resources> <resources>
<string name="app_name">hooloo</string> <string name="app_name">hooloo</string>
<string name="all_sku_sellout">商品已售罄</string>
<string name="default_sku_sellout">默认规格已售罄,已添加其他规格</string>
<string name="not_found_goods">未找到相应商品</string> <string name="not_found_goods">未找到相应商品</string>
<string name="count_limit">单次最多购买%1$s杯,请结算后再次下单</string> <string name="count_limit">单次最多购买%1$s杯,请结算后再次下单</string>
<string name="error_get_qrcode">获取二维码失败</string> <string name="error_get_qrcode">生成订单失败,请重新提交,多次失败请联系客服</string>
<string name="expire_times">%1$s秒后失效</string> <string name="expire_times">%1$s秒后失效</string>
<string name="scan_succeed">扫码成功(%s秒后转到首页)</string> <string name="scan_succeed">扫码成功(%s秒后转到首页)</string>
<string name="error_choose_spec">请选择规格</string> <string name="error_choose_spec">请选择规格</string>
...@@ -10,5 +12,5 @@ ...@@ -10,5 +12,5 @@
<string name="error_price">商品金额错误</string> <string name="error_price">商品金额错误</string>
<string name="error_sku_state">本商品已售罄或已经下架</string> <string name="error_sku_state">本商品已售罄或已经下架</string>
<string name="error_load_main_data">获取数据失败</string> <string name="error_load_main_data">获取数据失败</string>
<string name="error_check_sku">商品状态获取失败</string> <string name="error_check_sku">商品已售罄</string>
</resources> </resources>
<resources> <resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style> </style>
<style name="button_style" parent="Widget.AppCompat.Button.Borderless"> <style name="button_style" parent="Widget.AppCompat.Button.Borderless">
</style> </style>
</resources> </resources>
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