Commit 2a06429a by wjg

重做UI

parent a3352462
......@@ -5,17 +5,22 @@ import android.util.Log;
import com.ihaoin.hooloo.device.config.AppConfig;
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.util.SharedPreferencesUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.umeng.commonsdk.UMConfigure;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import cn.jpush.android.api.JPushInterface;
public class HLApplication extends Application {
public static HLApplication SELF = null;
private static MainData mainData = new MainData();
private static List<TrolleyGoods> TROLLEY_GOODS = new ArrayList<>();
public static MainData getMainData() {
return mainData;
}
......@@ -24,6 +29,10 @@ public class HLApplication extends Application {
mainData = data;
}
public static List<TrolleyGoods> getTrolleyGoods() {
return TROLLEY_GOODS;
}
@Override
public void onCreate() {
super.onCreate();
......@@ -48,4 +57,26 @@ public class HLApplication extends Application {
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
@Override
protected void convertHead(BaseViewHolder helper, ScrollBean item) {
helper.setText(R.id.txt_category, item.header);
// TODO test
helper.setOnClickListener(R.id.txt_category, v -> Utils.showToast(mContext, item.header));
}
@Override
protected void convert(BaseViewHolder helper, ScrollBean item) {
ScrollBean.ScrollItemBean t = item.t;
ViewGroup layoutItem = helper.getView(R.id.layout_item);
Goods goods = (Goods) t.getObject();
helper.setText(R.id.txt_name, goods.getName());
if (StringUtils.isEmpty(goods.getDesc())) {
helper.setGone(R.id.txt_intro, false);
helper.setVisible(R.id.txt_intro, false);
} else {
helper.setGone(R.id.txt_intro, true);
helper.setVisible(R.id.txt_intro, true);
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);
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 -> {
View tagView = LayoutInflater.from(mContext).inflate(R.layout.item_tag, null);
((TextView) tagView.findViewById(R.id.txt_tag)).setText(x);
......@@ -69,33 +76,53 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
if (goods.getPics() == null) {
imgThumbnail.setImageDrawable(null);
} 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());
if (sku == null) {
helper.setText(R.id.txt_price, Utils.toString(goods.getPrice()));
helper.setText(R.id.txt_discount, Utils.toString(goods.getDiscount()));
helper.setGone(R.id.txt_sellout, true);
helper.setGone(R.id.butn_add, false);
// if (sku == null) {
// if (goods.getPrice().compareTo(goods.getDiscount()) == 0) {
// helper.setGone(R.id.ico_price, false);
// helper.setGone(R.id.txt_price, false);
// } else {
// 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 {
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_price, Utils.toString(sku.getPrice()));
if (SkuState.isSellin(sku.getState())) {
helper.setGone(R.id.txt_sellout, false);
helper.setGone(R.id.butn_add, true);
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));
layoutItem.setOnClickListener(v -> Utils.showGoodsDetail(mContext, goods));
} else {
helper.setGone(R.id.txt_sellout, true);
helper.setGone(R.id.butn_add, false);
layoutItem.setOnClickListener(v -> Utils.showToast(mContext, R.string.all_sku_sellout));
}
}
// }
if (Base.TRUE.equals(goods.getIsRecommend())) {
helper.setVisible(R.id.img_recommend, true);
......@@ -108,16 +135,16 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
icoPrice.setPaintFlags(icoPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtPrice.setPaintFlags(txtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
View layoutItem = helper.getView(R.id.layout_item);
layoutItem.setOnClickListener(v -> Utils.showGoodsDetail(mContext, goods));
int padding = Utils.getDimens(mContext, R.dimen.padding10);
layoutItem.setPadding(padding, padding, padding, padding);
// 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);
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;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
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.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.component.SettingsQueue;
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.Sku;
import com.ihaoin.hooloo.device.util.Utils;
public class RecommendAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHolder> {
public class RecommendAdapter extends BaseQuickAdapter<ScrollBean, BaseViewHolder> {
private Context mContext;
public RecommendAdapter(Context context, int layoutResId, int sectionHeadResId) {
super(layoutResId, sectionHeadResId, null);
public RecommendAdapter(Context context, int layoutResId) {
super(layoutResId, null);
this.mContext = context;
}
@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) {
ScrollBean.ScrollItemBean t = item.t;
Recommend recommend = (Recommend) t.getObject();
......@@ -42,7 +36,16 @@ public class RecommendAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseVi
Utils.getGlide(mContext).load(recommend.getPic()).apply(options).into(imgRecommend);
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;
import android.widget.TextView;
import android.widget.ToggleButton;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.vo.Goods;
......@@ -71,6 +72,14 @@ public class TrolleyAdapter extends BaseAdapter {
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()));
txtDiscount.setText(Utils.toString(sku.getDiscount()));
......@@ -79,7 +88,7 @@ public class TrolleyAdapter extends BaseAdapter {
txtCount.setText(trolleyGoods.getCount().toString());
butnSubtract.setOnClickListener(v -> trolleyView.subtractGoods(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);
Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd, butnSubtract));
......@@ -88,7 +97,7 @@ public class TrolleyAdapter extends BaseAdapter {
}
private List<TrolleyGoods> getTrolleyGoods() {
return trolleyView.getTrolleyGoods();
return HLApplication.getTrolleyGoods();
}
@Override
......
......@@ -6,12 +6,13 @@ import android.os.Handler;
import android.os.Message;
import android.util.Log;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.JsonNode;
import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.JsonUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
......@@ -37,16 +38,20 @@ public class PushMessageReceiver extends JPushMessageReceiver {
public void onMessage(Context context, CustomMessage customMessage) {
Log.e(AppConfig.TAG_PUSH, "[onMessage] " + customMessage);
this.showToast("onMessage");
try {
dispatchMsg(customMessage);
} catch (IOException e) {
e.printStackTrace();
}
}
private void dispatchMsg(CustomMessage customMessage) {
private void dispatchMsg(CustomMessage customMessage) throws IOException {
// if (CollectionUtils.isEmpty(subscribers)) {
// Log.e(AppConfig.DEBUG_TAG_PUSH,"msg subscribers is empty");
// return;
// }
JSONObject jsonObject = JSON.parseObject(customMessage.message);
String action = jsonObject.getString("action");
JsonNode jsonNode = JsonUtils.getMapper().readValue(customMessage.message, JsonNode.class);
String action = jsonNode.get("action").asText();
if (StringUtils.isEmpty(action)) {
Log.e(AppConfig.TAG_PUSH, "msg action is empty");
return;
......@@ -56,8 +61,8 @@ public class PushMessageReceiver extends JPushMessageReceiver {
Log.e(AppConfig.TAG_PUSH, String.format("msg action[%s] subscribers is empty", action));
return;
}
JSONObject data = jsonObject.getJSONObject("data");
Message msg = handler.obtainMessage(1, data.toJSONString());
JsonNode data = jsonNode.get("data");
Message msg = handler.obtainMessage(1, JsonUtils.getMapper().writeValueAsString(data));
handler.sendMessage(msg);
}
......@@ -128,7 +133,6 @@ public class PushMessageReceiver extends JPushMessageReceiver {
}
private void showToast(String content) {
// Toast.makeText(HLApplication.SELF, content, Toast.LENGTH_SHORT).show();
}
@Override
......
......@@ -24,20 +24,6 @@ public class SettingsQueue extends ArrayList<Boolean> {
this.oneView = oneView;
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.zeroView.setOnClickListener(v -> add(false));
}
......@@ -62,7 +48,6 @@ public class SettingsQueue extends ArrayList<Boolean> {
break;
}
}
// Toast.makeText(context, String.valueOf(matched), Toast.LENGTH_SHORT).show();
if (matched) {
Utils.openAppSettings(context);
clear();
......
......@@ -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_SKU_STATE_CHANGED = "SKU_STATE_CHANGED";
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_GOODS_CHANGED = "ACTION_GOODS_CHANGED";
......
......@@ -23,6 +23,16 @@ public class Recommend implements Serializable {
*/
private Goods goods;
private Integer index;
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
public String getTitle() {
return title;
}
......
......@@ -75,13 +75,13 @@ public class HttpUtil {
private static void onResponse(Handler handler, Call call, Response response) {
try {
String responseBody = response.body().string();
JsonNode jsonObject = JsonUtils.getMapper().readValue(responseBody, JsonNode.class);
if (jsonObject == null) {
JsonNode jsonNode = JsonUtils.getMapper().readValue(responseBody, JsonNode.class);
if (jsonNode == null) {
onFailure(handler, call, new BizException("返回body为空"));
return;
}
if (jsonObject.get("code").asInt() != 200) {
onFailure(handler, call, new BizException(jsonObject.get("msg").asText()));
if (jsonNode.get("code").asInt() != 200) {
onFailure(handler, call, new BizException(jsonNode.get("msg").asText()));
return;
}
if (handler == null) {
......@@ -89,7 +89,7 @@ public class HttpUtil {
Log.i(AppConfig.TAG_NETWORK, msgText);
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) {
onFailure(handler, call, e);
}
......
......@@ -5,10 +5,14 @@ import android.content.Context;
import android.content.Intent;
import android.graphics.Rect;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.TouchDelegate;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.coordinatorlayout.widget.ViewGroupUtils;
......@@ -133,7 +137,7 @@ public class Utils {
}
public static String toString(BigDecimal num) {
DecimalFormat df = new DecimalFormat("0.00");
DecimalFormat df = new DecimalFormat("0.#");
return df.format(num);
}
......@@ -175,4 +179,27 @@ public class Utils {
RequestOptions options = new RequestOptions().placeholder(R.mipmap.placeholder);
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;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
......@@ -126,7 +125,7 @@ public class ConfirmOrderDialog extends Dialog {
HttpUtil.postConfirmOrder(genJson(), confirmOrderHandler);
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(getContext(), R.string.error_get_qrcode, Toast.LENGTH_LONG).show();
Utils.showToast(getContext(), R.string.error_get_qrcode);
dismiss();
}
}
......@@ -149,7 +148,6 @@ public class ConfirmOrderDialog extends Dialog {
private String genJson() {
try {
// Toast.makeText(getContext(), "屏幕编码:" + SharedPreferencesUtils.getScreenNo(getContext()), Toast.LENGTH_SHORT).show();
ConfirmOrder confirmOrder = new ConfirmOrder();
confirmOrder.setMachineCode(AppConfig.MACHINE_CODE);
confirmOrder.setScreenNo(SharedPreferencesUtils.getScreenNo(getContext()));
......@@ -269,7 +267,7 @@ public class ConfirmOrderDialog extends Dialog {
stopLoading();
Object obj = msg.obj;
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();
return;
}
......@@ -280,7 +278,7 @@ public class ConfirmOrderDialog extends Dialog {
imgQRCode.setImageBitmap(bitmap);
startExpireThread();
} catch (Exception e) {
Toast.makeText(getContext(), R.string.error_get_qrcode, Toast.LENGTH_LONG).show();
Utils.showToast(getContext(), R.string.error_get_qrcode);
dismiss();
}
}
......
......@@ -15,7 +15,6 @@ import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.viewpager.widget.ViewPager;
......@@ -35,6 +34,7 @@ import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......@@ -63,7 +63,6 @@ public class GoodsDetailDialog extends Dialog {
private Button butnTrolley;
private View layoutOperate;
private View layoutButns;
private View txtSellout;
private List<View> introViews;
......@@ -82,7 +81,6 @@ public class GoodsDetailDialog extends Dialog {
private void initViews() {
layoutButns = findViewById(R.id.layout_butns);
layoutOperate = findViewById(R.id.layout_operate);
txtSellout = findViewById(R.id.txt_sellout);
butnClose = findViewById(R.id.butn_close);
introPager = findViewById(R.id.intro_pager);
introIndicator = findViewById(R.id.intro_indicator);
......@@ -135,24 +133,35 @@ public class GoodsDetailDialog extends Dialog {
}
Optional<Sku> optional = mGoods.getSkus().stream().filter(x -> Base.TRUE.equals(x.getIsDefault())).findAny();
BigDecimal price, discount;
if (optional.isPresent()) {
Sku defaultSku = optional.get();
txtPrice.setText(Utils.toString(defaultSku.getPrice()));
txtDiscount.setText(Utils.toString(defaultSku.getDiscount()));
price = optional.get().getPrice();
discount = optional.get().getDiscount();
} else {
txtPrice.setText(Utils.toString(mGoods.getPrice()));
txtDiscount.setText(Utils.toString(mGoods.getDiscount()));
price = mGoods.getPrice();
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());
butnSubtract.setOnClickListener(v -> subtractGoods());
butnAdd.setOnClickListener(v -> addGoods());
butnSubtract.setOnClickListener(v -> subtractCount());
butnAdd.setOnClickListener(v -> addCount());
icoPirce.setPaintFlags(icoPirce.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtPrice.setPaintFlags(txtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
butnBuy.setOnClickListener(v -> buyNow());
butnTrolley.setOnClickListener(v -> addTrolley());
butnBuy.setOnClickListener(v -> prepareBuyNow());
butnTrolley.setOnClickListener(v -> prepareAddTrolley());
ViewGroup layoutItem = findViewById(R.id.layout_item);
Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd, butnSubtract));
......@@ -247,54 +256,73 @@ public class GoodsDetailDialog extends Dialog {
private Goods goods;
private Sku sku;
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();
this.goods = goods;
this.sku = sku;
this.count = count;
this.type = type;
}
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
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;
}
Utils.showConfirmOrder(getContext(), goods, sku, count);
dismiss();
if (this.type == 1) {
buyNow(goods, sku, count);
} else {
addTrolley(goods, sku, count);
}
}
}
private void buyNow() {
public void prepareBuyNow() {
if (mSku == null) {
Toast.makeText(getContext(), R.string.not_found_goods, Toast.LENGTH_SHORT).show();
Utils.showToast(getContext(), R.string.not_found_goods);
return;
}
CheckGoodsHandler handler = new CheckGoodsHandler(mGoods, mSku, mCount);
CheckGoodsHandler handler = new CheckGoodsHandler(mGoods, mSku, mCount, 1);
HttpUtil.checkSku(mSku.getSkuId(), handler);
}
private void addTrolley() {
public void prepareAddTrolley() {
if (mSku == null) {
Toast.makeText(getContext(), R.string.not_found_goods, Toast.LENGTH_SHORT).show();
Utils.showToast(getContext(), R.string.not_found_goods);
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();
}
private void addGoods() {
if (mCount >= HLApplication.getMainData().getCountOfOrder()) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getMainData().getCountOfOrder().toString()), Toast.LENGTH_SHORT).show();
private void addTrolley(Goods goods, Sku sku, Integer count) {
Utils.sendAddGoodsBroadcast(getContext(), goods, sku, count);
dismiss();
}
private void addCount() {
if (mCount + HLApplication.getGoodsCount() >= HLApplication.getCountOfOrder()) {
Utils.showToast(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getCountOfOrder().toString()));
return;
}
mCount++;
txtCount.setText(String.valueOf(mCount));
}
private void subtractGoods() {
private void subtractCount() {
if (mCount <= 1) {
return;
}
......@@ -379,7 +407,6 @@ public class GoodsDetailDialog extends Dialog {
}
mSku = matchSku(rules);
if (mSku == null) {
// Toast.makeText(getContext(), R.string.not_found_goods, Toast.LENGTH_SHORT).show();
return;
}
txtPrice.setText(Utils.toString(mSku.getPrice()));
......@@ -512,21 +539,22 @@ public class GoodsDetailDialog extends Dialog {
}
private void showSelloutViews() {
layoutOperate.setVisibility(View.GONE);
layoutButns.setVisibility(View.GONE);
txtSellout.setVisibility(View.VISIBLE);
setAllRuleSellouts(); // 所有规格设置为售罄
}
private void setAllRuleSellouts() {
if (mGoods == null || CollectionUtils.isEmpty(mGoods.getSpecs())) {
return;
}
mGoods.getSpecs().forEach(spec -> {
if (CollectionUtils.isEmpty(spec.getRules())) {
return;
}
spec.getRules().forEach(rule -> rule.setState(SkuState.SELLOUT.getCode()));
});
}
dismiss();
// layoutOperate.setVisibility(View.GONE);
// layoutButns.setVisibility(View.GONE);
// txtSellout.setVisibility(View.VISIBLE);
// setAllRuleSellouts(); // 所有规格设置为售罄
}
// private void setAllRuleSellouts() {
// if (mGoods == null || CollectionUtils.isEmpty(mGoods.getSpecs())) {
// return;
// }
// mGoods.getSpecs().forEach(spec -> {
// if (CollectionUtils.isEmpty(spec.getRules())) {
// return;
// }
// spec.getRules().forEach(rule -> rule.setState(SkuState.SELLOUT.getCode()));
// });
// }
}
......@@ -18,7 +18,7 @@ import android.view.View;
import android.view.WindowManager;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
......@@ -31,6 +31,7 @@ import com.ihaoin.hooloo.device.adapter.GoodsAdapter;
import com.ihaoin.hooloo.device.adapter.RecommendAdapter;
import com.ihaoin.hooloo.device.component.NetworkHandler;
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.Base;
import com.ihaoin.hooloo.device.data.MainData;
......@@ -53,11 +54,12 @@ import java.util.List;
public class LauncherActivity extends Activity {
private SkuStateChangeHandler skuStateChangeHandler;
private GoodsChangeHandler goodsChangeHandler;
private RadioGroup groupCategory;
private RecyclerView recGoods;
private RecyclerView recRecommends;
// private TextView rightTitle;
private TextView txtCategory;
private View layoutTips;
private List<ScrollBean> scrollRecommends;
......@@ -85,6 +87,7 @@ public class LauncherActivity extends Activity {
requestPermissions();
txtCategory = findViewById(R.id.txt_category);
trolleyView = findViewById(R.id.view_trolley);
groupCategory = findViewById(R.id.group_category);
recGoods = findViewById(R.id.rec_right);
......@@ -105,8 +108,16 @@ public class LauncherActivity extends Activity {
registSettingChangedReceiver();
prepareMenuView();
regsitSkuChangeListener();
regsitGoodsChangeListener();
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() {
......@@ -120,16 +131,10 @@ public class LauncherActivity extends Activity {
private void initRecommends() {
recommendManager = new GridLayoutManager(mContext, 2);
recommendManager.setSpanSizeLookup(new MySpanSizeLookup());
recRecommends.addItemDecoration(new RecyclerView.ItemDecoration() {
@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);
}
});
recRecommends.addItemDecoration(new MyItemDecoration());
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.setLayoutManager(recommendManager);
} else {
......@@ -141,26 +146,43 @@ public class LauncherActivity extends Activity {
private void setRecommendsData() {
List<Recommend> recommends = HLApplication.getMainData().getRecommends();
scrollRecommends = new ArrayList<>();
ScrollBean header = new ScrollBean(true, null);
scrollRecommends.add(header);
recommendAdapter.setNewData(scrollRecommends);
if (CollectionUtils.isEmpty(recommends)) {
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);
}
class MySpanSizeLookup extends GridLayoutManager.SpanSizeLookup {
@Override
public int getSpanSize(int position) {
if (position == 0 || position == 1) {
if (position == 0) {
return 2;
}
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() {
goodsLayoutManager = new LinearLayoutManager(mContext);
if (goodsAdapter == null) {
......@@ -190,6 +212,7 @@ public class LauncherActivity extends Activity {
} else {
title = scrollGoods.get(first).t.getType();
}
txtCategory.setText(title);
}
// 遍历分类列表,设置选中分类
......@@ -319,7 +342,7 @@ public class LauncherActivity extends Activity {
try {
Object obj = msg.obj;
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;
}
MainData mainData = JsonUtils.getMapper().readValue(obj.toString(), MainData.class);
......@@ -351,6 +374,7 @@ public class LauncherActivity extends Activity {
this.unregistTrolleyStateChangedReceiver();
this.unregistSettingChangedReceiver();
this.unregsitSkuChangeListener();
this.unregsitGoodsChangeListener();
System.exit(0);
}
......@@ -462,9 +486,9 @@ public class LauncherActivity extends Activity {
}
} else if (intent.getAction().equals(Base.BROADCAST_ACTION_LOGCAT_STATE_CHANGED)) {
if (SharedPreferencesUtils.getShowMenu(LauncherActivity.this)) {
Toast.makeText(LauncherActivity.this, "展示Logcat", Toast.LENGTH_SHORT).show();
Utils.showToast(LauncherActivity.this, "展示Logcat");
} else {
Toast.makeText(LauncherActivity.this, "隐藏Logcat", Toast.LENGTH_SHORT).show();
Utils.showToast(LauncherActivity.this, "隐藏Logcat");
}
}
}
......@@ -481,7 +505,7 @@ public class LauncherActivity extends Activity {
/** 显示菜单屏KDS */
private void showMenuView() {
if (AppConfig.DEBUG) {
Toast.makeText(this, "展示菜单屏", Toast.LENGTH_SHORT).show();
Utils.showToast(this, "展示菜单屏");
}
if (menu != null) {
return;
......@@ -489,7 +513,7 @@ public class LauncherActivity extends Activity {
DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
Display[] displays = displayManager.getDisplays();
if (CollectionUtils.isEmpty(displays) || displays.length < 2) {
Toast.makeText(this, "未获取到菜单屏硬件", Toast.LENGTH_SHORT).show();
Utils.showToast(this, "未获取到菜单屏硬件");
return;
}
menu = new MenuPresentation(this, displays[1]);
......@@ -498,7 +522,7 @@ public class LauncherActivity extends Activity {
private void hideMenuView() {
if (AppConfig.DEBUG) {
Toast.makeText(this, "隐藏菜单屏", Toast.LENGTH_SHORT).show();
Utils.showToast(this, "隐藏菜单屏");
}
if (menu == null) {
return;
......@@ -522,6 +546,15 @@ public class LauncherActivity extends Activity {
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 {
@Override
public void handleMessage(@NonNull Message msg) {
......@@ -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;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.LayoutInflater;
......@@ -12,7 +11,6 @@ import android.view.animation.AnimationUtils;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
......@@ -29,13 +27,10 @@ import com.ihaoin.hooloo.device.util.RandomUtils;
import com.ihaoin.hooloo.device.util.Utils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
public class TrolleyView extends RelativeLayout {
private List<TrolleyGoods> trolleyGoods = new ArrayList<>();
private Boolean state = false;
private Boolean trolleyAniming = false;
......@@ -48,7 +43,7 @@ public class TrolleyView extends RelativeLayout {
private TextView txtTotal;
private View butnPay;
TrolleyAdapter trolleyAdapter;
private TrolleyAdapter trolleyAdapter;
private void init() {
View view = LayoutInflater.from(getContext()).inflate(R.layout.view_trolley, this);
......@@ -94,38 +89,27 @@ public class TrolleyView extends RelativeLayout {
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
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;
}
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) {
// if (!checkSkuState(sku.getSkuId())) {
// Toast.makeText(this.getContext(), R.string.error_sku_state, Toast.LENGTH_SHORT).show();
// return;
// }
if (getCount() >= getCountOfOrder()) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, getCountOfOrder().toString()), Toast.LENGTH_SHORT).show();
if (HLApplication.getGoodsCount() >= HLApplication.getCountOfOrder()) {
Utils.showToast(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getCountOfOrder().toString()));
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()) {
TrolleyGoods g = optional.get();
g.setCount(g.getCount() + count);
} else {
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.setGoods(goods);
g.setSku(sku);
......@@ -141,7 +125,7 @@ public class TrolleyView extends RelativeLayout {
// g.setDiscount(sku.getDiscount());
// g.setRules(sku.getRules());
g.setCount(count);
this.trolleyGoods.add(g);
HLApplication.getTrolleyGoods().add(g);
}
this.goodsChanged();
......@@ -149,24 +133,20 @@ public class TrolleyView extends RelativeLayout {
/** 购物车商品增加数量 */
public void addGoods(Integer position) {
// if (!checkSkuState(goods.getSkuId())) {
// Toast.makeText(this.getContext(), R.string.error_sku_state, Toast.LENGTH_SHORT).show();
// return;
// }
if (getCount() >= getCountOfOrder()) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, getCountOfOrder().toString()), Toast.LENGTH_SHORT).show();
if (HLApplication.getGoodsCount() >= HLApplication.getCountOfOrder()) {
Utils.showToast(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getCountOfOrder().toString()));
return;
}
TrolleyGoods goods = this.trolleyGoods.get(position);
TrolleyGoods goods = HLApplication.getTrolleyGoods().get(position);
goods.setCount(goods.getCount() + 1);
this.goodsChanged();
}
/** 购物车商品减少数量 */
public void subtractGoods(Integer position) {
TrolleyGoods goods = this.trolleyGoods.get(position);
TrolleyGoods goods = HLApplication.getTrolleyGoods().get(position);
if (goods.getCount() <= 1) {
this.trolleyGoods.remove(goods);
HLApplication.getTrolleyGoods().remove(goods);
} else {
goods.setCount(goods.getCount() - 1);
}
......@@ -175,38 +155,22 @@ public class TrolleyView extends RelativeLayout {
public void goodsChanged() {
this.trolleyAdapter.notifyDataSetChanged();
this.txtCount.setText(getCheckedCount().toString());
this.txtTotal.setText(Utils.toString(getCheckedTotal()));
this.txtCount.setText(HLApplication.getGoodsCheckedCount().toString());
this.txtTotal.setText(Utils.toString(HLApplication.getGoodsCheckedTotal()));
this.setView();
this.measureListHeight();
}
public Boolean checkGoodsCount() {
if (getCount() > getCountOfOrder()) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, getCountOfOrder().toString()), Toast.LENGTH_SHORT).show();
if (HLApplication.getGoodsCount() > HLApplication.getCountOfOrder()) {
Utils.showToast(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getCountOfOrder().toString()));
return false;
}
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() {
if (this.trolleyGoods.isEmpty()) {
if (HLApplication.getTrolleyGoods().isEmpty()) {
this.setVisibility(View.INVISIBLE);
viewBackground.setVisibility(View.INVISIBLE);
layoutTrolley.setVisibility(View.INVISIBLE);
......@@ -219,7 +183,7 @@ public class TrolleyView extends RelativeLayout {
}
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;
ViewGroup.LayoutParams layoutParams = listTrolley.getLayoutParams();
layoutParams.height = height;
......@@ -227,7 +191,7 @@ public class TrolleyView extends RelativeLayout {
}
public void clearTrolley() {
this.trolleyGoods.clear();
HLApplication.getTrolleyGoods().clear();
setView();
}
......@@ -299,23 +263,16 @@ public class TrolleyView extends RelativeLayout {
}
private void showPayDialog() {
if (getCheckedCount() <= 0) {
Toast.makeText(getContext(), R.string.error_choose_goods, Toast.LENGTH_LONG).show();
if (HLApplication.getGoodsCheckedCount() <= 0) {
Utils.showToast(getContext(), R.string.error_choose_goods);
return;
}
if (getCheckedTotal().compareTo(BigDecimal.ZERO) < 0) {
Toast.makeText(getContext(), R.string.error_price, Toast.LENGTH_LONG).show();
if (HLApplication.getGoodsCheckedTotal().compareTo(BigDecimal.ZERO) < 0) {
Utils.showToast(getContext(), R.string.error_price);
return;
}
Utils.showConfirmOrder(getContext(), trolleyGoods);
}
class CheckSkuStateHandler extends Handler {
@Override
public void handleMessage(@NonNull Message msg) {
}
Utils.showConfirmOrder(getContext(), HLApplication.getTrolleyGoods());
}
public TrolleyView(Context context) {
......@@ -337,8 +294,4 @@ public class TrolleyView extends RelativeLayout {
super(context, attrs, defStyleAttr, defStyleRes);
init();
}
public List<TrolleyGoods> getTrolleyGoods() {
return trolleyGoods;
}
}
......@@ -2,9 +2,9 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="2dp" />
<corners android:radius="1px" />
<solid
android:width="1dp"
android:width="1px"
android:color="@color/colorPrimary" />
</shape>
</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 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/rule_recommend_corners" />
<corners android:radius="1px" />
<solid
android:width="1dp"
android:width="1px"
android:color="@color/colorPink" />
</shape>
</item>
......
......@@ -2,7 +2,10 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="5dp" />
<corners android:radius="1px" />
<solid
android:width="1px"
android:color="@color/textGrayF0" />
</shape>
</item>
</layer-list>
......@@ -2,10 +2,11 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="2dp" />
<stroke
android:width="1dp"
android:color="@color/colorPrimary" />
<corners android:radius="2px" />
<solid android:color="@color/textGrayF0" />
<!-- <stroke-->
<!-- android:width="1dp"-->
<!-- android:color="@color/colorPrimary" />-->
</shape>
</item>
</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 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval">
<solid android:color="@color/colorPrimary" />
<solid android:color="@color/colorPink" />
<size
android:width="30dp"
android:height="30dp" />
......
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="30dp"
android:viewportWidth="30"
android:viewportHeight="30">
xmlns:aapt="http://schemas.android.com/aapt"
android:width="33dp"
android:height="33dp"
android:viewportWidth="33"
android:viewportHeight="33">
<path
android:pathData="M0,0L0,30"
android:strokeWidth="2"
android:pathData="M0,0L0,33"
android:strokeWidth="0.5"
android:strokeColor="@color/line" />
<path
android:pathData="M1,0L1,30"
android:strokeWidth="3"
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>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="30dp"
android:viewportWidth="30"
android:viewportHeight="30">
android:width="33dp"
android:height="33dp"
android:viewportWidth="33"
android:viewportHeight="33">
<path
android:pathData="M0,0L0,30"
android:pathData="M0,0L0,33"
android:strokeWidth="0.5"
android:strokeColor="@color/line" />
</vector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<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/duigou_2x" android:state_selected="true" />
<item android:drawable="@mipmap/weixuanzhong_2x" />
<item android:drawable="@mipmap/xuanzhong" android:state_checked="true" />
<item android:drawable="@mipmap/xuanzhong" android:state_selected="true" />
<item android:drawable="@mipmap/weixuanzhong" />
</selector>
......@@ -4,6 +4,6 @@
<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_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" />
</selector>
......@@ -4,6 +4,6 @@
<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_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" />
</selector>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
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
android:id="@+id/rec_recommend"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="7"
android:descendantFocusability="afterDescendants" />
</LinearLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/padding10"
android:layout_weight="4.5">
android:layout_weight="0.30833"
android:paddingTop="@dimen/padding20">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rec_right"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="afterDescendants"
android:paddingTop="@dimen/padding20" />
android:background="@color/white"
android:descendantFocusability="afterDescendants" />
<include layout="@layout/item_goods_category" />
</FrameLayout>
<ScrollView
android:layout_width="wrap_content"
......@@ -40,13 +49,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/category_margin"
android:divider="@color/line"
android:dividerPadding="@dimen/category_divider_padding"
android:gravity="center"
android:orientation="vertical"
android:showDividers="middle" />
<include
android:id="@+id/layout_tips"
layout="@layout/item_tips"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
......
......@@ -6,10 +6,8 @@
android:button="@null"
android:foreground="?selectableItemBackground"
android:gravity="center"
android:paddingStart="@dimen/padding10"
android:paddingTop="@dimen/category_padding"
android:paddingEnd="@dimen/padding10"
android:paddingBottom="@dimen/category_padding"
android:paddingHorizontal="@dimen/category_padding_hor"
android:paddingVertical="@dimen/category_padding_ver"
android:textColor="@drawable/sel_category_color"
android:textSize="@dimen/ts_category_radio" />
......@@ -5,12 +5,11 @@
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="@dimen/padding10">
android:orientation="horizontal">
<RelativeLayout
android:layout_width="@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
android:id="@+id/img_thumbnail"
android:layout_width="match_parent"
......@@ -21,7 +20,7 @@
android:layout_width="@dimen/ic_recommend"
android:layout_height="@dimen/ic_recommend"
android:layout_alignParentEnd="true"
android:layout_margin="@dimen/padding5"
android:layout_margin="@dimen/goods_recommend_margin"
android:src="@mipmap/aixin_2x"
android:visibility="gone" />
</RelativeLayout>
......@@ -31,7 +30,8 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="bottom"
android:orientation="vertical">
android:orientation="vertical"
android:paddingEnd="@dimen/goods_padding_right">
<TextView
android:id="@+id/txt_name"
android:layout_width="match_parent"
......@@ -44,24 +44,24 @@
android:id="@+id/layout_tags"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding3"
android:layout_marginTop="@dimen/goods_tag_margin_top"
android:gravity="center_vertical"
android:orientation="horizontal" />
<TextView
android:id="@+id/txt_intro"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding3"
android:layout_marginTop="@dimen/goods_desc_margin_top"
android:ellipsize="end"
android:lines="1"
android:text="茶叶与咖啡完美的碰撞"
android:text=""
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_intro" />
<RelativeLayout
android:id="@+id/layout_butns"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding3">
android:layout_marginTop="@dimen/goods_butns_margin_top">
<TextView
android:id="@+id/ico_discount"
android:layout_width="wrap_content"
......@@ -69,17 +69,19 @@
android:layout_alignParentBottom="true"
android:src="@drawable/ms__arrow"
android:text="¥"
android:textColor="@color/textRed"
android:textSize="@dimen/ts_goods_item_price" />
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_goods_item_discount"
android:textStyle="bold" />
<TextView
android:id="@+id/txt_discount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginEnd="@dimen/goods_price_margin"
android:layout_toRightOf="@id/ico_discount"
android:text="19.9"
android:textColor="@color/textRed"
android:textSize="@dimen/ts_goods_item_price"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_goods_item_discount"
android:textStyle="bold" />
<TextView
......@@ -87,11 +89,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/padding5"
android:layout_toEndOf="@id/txt_discount"
android:text="¥"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" />
android:textSize="@dimen/ts_goods_item_price" />
<TextView
android:id="@+id/txt_price"
android:layout_width="wrap_content"
......@@ -100,7 +101,7 @@
android:layout_toEndOf="@id/ico_price"
android:text="29.9"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" />
android:textSize="@dimen/ts_goods_item_price" />
<TextView
android:id="@+id/txt_sellout"
......@@ -109,7 +110,7 @@
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="已售罄"
android:textColor="@color/textRed"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_sellout"
android:visibility="gone" />
<Button
......@@ -118,7 +119,7 @@
android:layout_width="@dimen/ic_add_size"
android:layout_height="@dimen/ic_add_size"
android:layout_alignParentEnd="true"
android:background="@mipmap/jiahao_2x"
android:background="@mipmap/jiahao"
android:foreground="?selectableItemBackground" />
</RelativeLayout>
</LinearLayout>
......
......@@ -2,14 +2,14 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/padding10">
android:background="@color/white">
<TextView
android:id="@+id/txt_category"
android:layout_width="match_parent"
android:paddingTop="@dimen/padding5"
android:layout_height="wrap_content"
android:paddingTop="@dimen/goods_category_margin_top"
android:paddingBottom="@dimen/goods_category_margin_bottom"
android:singleLine="true"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_category_item"
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_item"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/colorLogo"
android:paddingHorizontal="@dimen/padding20"
android:paddingVertical="@dimen/padding15">
android:id="@+id/layout_logo"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="@dimen/logo_width"
android:id="@+id/img_logo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@mipmap/logo_2x" />
android:src="@mipmap/logo" />
</FrameLayout>
</FrameLayout>
\ No newline at end of file
......@@ -17,10 +17,11 @@
android:id="@+id/txt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding20"
android:layout_marginTop="@dimen/padding20"
android:layout_marginStart="@dimen/recommend_name_margin_left"
android:layout_marginTop="@dimen/recommend_name_margin_top"
android:singleLine="true"
android:textColor="@color/white"
android:text=""
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_recommend_name"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
......@@ -30,12 +31,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/txt_name"
android:layout_marginStart="@dimen/padding20"
android:layout_marginBottom="@dimen/padding15"
android:layout_marginStart="@dimen/recommend_desc_margin_left"
android:layout_marginTop="@dimen/recommend_desc_margin_top"
android:singleLine="true"
android:textColor="@color/white"
android:text=""
android:textColor="@color/textDisable"
android:textSize="@dimen/ts_recommend_desc"
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>
\ No newline at end of file
......@@ -7,15 +7,15 @@
android:id="@+id/txt_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding10"
android:layout_marginTop="@dimen/goods_detail_spec_margin_top"
android:text="温度"
android:textColor="@color/textPrimary"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_detail_spec"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/layout_rules"
android:layout_width="match_parent"
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" />
</LinearLayout>
......@@ -7,14 +7,14 @@
android:id="@+id/butn_rule"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding5"
android:layout_marginEnd="@dimen/padding10"
android:layout_marginTop="@dimen/goods_detail_rule_margin_top"
android:layout_marginEnd="@dimen/goods_detail_rule_margin_right"
android:background="@drawable/sel_spec_bg"
android:paddingHorizontal="@dimen/padding10"
android:paddingVertical="@dimen/rule_vertical_padding"
android:foreground="?selectableItemBackground"
android:paddingHorizontal="@dimen/goods_detail_rule_padding_hor"
android:paddingVertical="@dimen/goods_detail_rule_padding_ver"
android:singleLine="true"
android:text="加糖"
android:foreground="?selectableItemBackground"
android:textColor="@drawable/sel_spec_color"
android:textSize="@dimen/ts_detail_rule"
app:layout_constraintLeft_toLeftOf="parent"
......@@ -26,12 +26,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_spec_recommend"
android:paddingHorizontal="@dimen/padding5"
android:paddingVertical="@dimen/padding3"
android:paddingHorizontal="@dimen/goods_detail_rec_padding_hor"
android:paddingVertical="@dimen/goods_detail_rec_padding_ver"
android:text="推荐"
android:textColor="@color/white"
android:textSize="@dimen/ts_detail_spec_rec"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -2,14 +2,16 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="@dimen/padding5">
android:paddingRight="@dimen/goods_tag_margin_right">
<TextView
android:id="@+id/txt_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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:textColor="@color/colorPrimary"
android:textColor="@color/textDisable"
android:text=""
android:textSize="@dimen/ts_goods_item_tag" />
</FrameLayout>
\ No newline at end of file
<?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_height="wrap_content"
android:layout_marginTop="@dimen/tip_margin_top"
android:button="@null"
android:drawableEnd="@drawable/ic_baseline_chevron_right_24"
android:foreground="?selectableItemBackground"
android:gravity="center"
android:lines="1"
android:padding="@dimen/padding10"
android:paddingTop="@dimen/tip_padding_top"
android:paddingBottom="@dimen/tip_padding_bottom"
android:text="温馨提示"
android:textColor="@color/colorPrimary"
android:textColor="@color/textDisable"
android:textSize="@dimen/ts_tips" />
</FrameLayout>
......@@ -5,7 +5,10 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
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
android:id="@+id/butn_state"
style="@style/button_style"
......@@ -18,10 +21,10 @@
android:textOn="" />
<ImageView
android:id="@+id/img_thumbnail"
android:layout_width="@dimen/goods_thum_size"
android:layout_height="@dimen/goods_thum_size"
android:layout_marginLeft="@dimen/padding10"
android:layout_marginRight="@dimen/padding10"
android:layout_width="@dimen/trolley_thum_size"
android:layout_height="@dimen/trolley_thum_size"
android:layout_marginLeft="@dimen/trolley_thum_margin"
android:layout_marginRight="@dimen/trolley_thum_margin"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="0dp"
......@@ -40,14 +43,14 @@
android:id="@+id/txt_options"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding5"
android:layout_marginTop="@dimen/trolley_options_margin_top"
android:text="冰/无糖"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_intro" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding5"
android:layout_marginTop="@dimen/trolley_price_margin_top"
android:gravity="bottom"
android:orientation="horizontal">
<TextView
......@@ -55,32 +58,33 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥"
android:textColor="@color/textRed"
android:textSize="@dimen/ts_goods_item_price" />
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_goods_item_discount"
android:textStyle="bold" />
<TextView
android:id="@+id/txt_discount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="19.9"
android:textColor="@color/textRed"
android:textSize="@dimen/ts_goods_item_price"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_goods_item_discount"
android:textStyle="bold" />
<TextView
android:id="@+id/ico_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5"
android:layout_marginStart="@dimen/trolley_price_margin_left"
android:text="¥"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" />
android:textColor="@color/textDisable"
android:textSize="@dimen/ts_goods_item_price" />
<TextView
android:id="@+id/txt_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="29.9"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" />
android:textColor="@color/textDisable"
android:textSize="@dimen/ts_goods_item_price" />
</LinearLayout>
</LinearLayout>
<LinearLayout
......@@ -94,14 +98,14 @@
style="@style/button_style"
android:layout_width="@dimen/ic_subtract_size"
android:layout_height="@dimen/ic_subtract_size"
android:background="@mipmap/jianhao_2x"
android:background="@mipmap/jianhao"
android:foreground="?selectableItemBackground" />
<TextView
android:id="@+id/txt_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/padding10"
android:layout_marginRight="@dimen/padding10"
android:layout_marginLeft="@dimen/trolley_count_margin"
android:layout_marginRight="@dimen/trolley_count_margin"
android:text="1"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_trolley_item_count"
......@@ -111,7 +115,7 @@
style="@style/button_style"
android:layout_width="@dimen/ic_add_size"
android:layout_height="@dimen/ic_add_size"
android:background="@mipmap/jiahao_2x"
android:background="@mipmap/jiahao"
android:foreground="?selectableItemBackground" />
</LinearLayout>
</LinearLayout>
\ 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_width="@dimen/confirm_order_width"
android:layout_height="wrap_content"
android:background="@color/white"
android:padding="@dimen/padding15">
android:paddingTop="@dimen/confirm_order_padding_top"
android:paddingBottom="@dimen/confirm_order_padding_bottom">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
......@@ -19,13 +20,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/title"
android:layout_marginTop="@dimen/padding10"
android:layout_marginTop="@dimen/confirm_order_qr_margin_top"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/img_qrcode"
android:layout_width="@dimen/qrcode_size"
android:layout_height="@dimen/qrcode_size"
android:layout_width="@dimen/confirm_order_qrcode_size"
android:layout_height="@dimen/confirm_order_qrcode_size"
android:adjustViewBounds="true"
android:src="@mipmap/qrcode" />
<LinearLayout
......@@ -34,63 +35,54 @@
android:layout_height="wrap_content"
android:gravity="center_horizontal"
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
android:id="@+id/txt_scan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5"
android:layout_marginTop="@dimen/confirm_order_text_one"
android:text="使用微信扫一扫,确认订单并付款"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_scan" />
</LinearLayout>
<TextView
android:id="@+id/txt_expire"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding5"
android:layout_marginTop="@dimen/confirm_order_text_two"
android:text="60秒后失效"
android:textColor="@color/textPrimary"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_expire" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_succeed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/confirm_order_text_one"
android:gravity="center_vertical"
android:visibility="gone">
<ImageView
android:id="@+id/img_succeed"
android:layout_width="@dimen/ic_scan_succ"
android:layout_height="@dimen/ic_scan_succ"
android:src="@mipmap/weixinduigou_2x" />
android:layout_width="@dimen/ic_scan_succ_width"
android:layout_height="@dimen/ic_scan_succ_height"
android:src="@mipmap/zhifuchenggong" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5"
android:layout_marginStart="@dimen/confirm_order_icon_margin"
android:orientation="vertical">
<TextView
android:id="@+id/txt_return"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="扫码成功(1秒后转到首页)"
android:text="扫码成功"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_scan" />
android:textSize="@dimen/ts_scan"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding5"
android:layout_marginTop="@dimen/confirm_order_text_two"
android:text="在微信小程序上确认订单并付款"
android:textColor="@color/textPrimary"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_expire" />
</LinearLayout>
</LinearLayout>
......@@ -107,6 +99,7 @@
android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close"
android:layout_alignParentEnd="true"
android:layout_marginRight="@dimen/confirm_order_padding_top"
android:foreground="?selectableItemBackground"
android:src="@mipmap/chahao_2x" />
android:src="@mipmap/chazi" />
</RelativeLayout>
\ No newline at end of file
......@@ -17,11 +17,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/padding10">
android:paddingHorizontal="@dimen/goods_detail_padding_hor"
android:paddingVertical="@dimen/goods_detail_padding_ver">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/padding10"
android:layout_weight="1">
<com.ihaoin.hooloo.device.component.IntroViewPager
android:id="@+id/intro_pager"
......@@ -42,7 +42,7 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/padding10"
android:layout_marginLeft="@dimen/goods_detail_content_margin_left"
android:layout_weight="1"
android:orientation="vertical">
<TextView
......@@ -61,16 +61,16 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding10"
android:layout_marginTop="@dimen/goods_detail_image_margin_top"
android:text="商品详细"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_detail_spec"
android:textSize="@dimen/ts_detail_name"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/layout_images"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding10"
android:layout_marginTop="@dimen/goods_detail_image_margin_top"
android:orientation="vertical" />
</LinearLayout>
</LinearLayout>
......@@ -80,45 +80,49 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:orientation="vertical">
android:orientation="vertical"
android:paddingStart="@dimen/goods_detail_oper_margin_left"
android:paddingTop="@dimen/goods_detail_oper_margin_top"
android:paddingRight="@dimen/goods_detail_oper_margin_right"
android:paddingBottom="@dimen/goods_detail_oper_margin_bottom">
<LinearLayout
android:id="@+id/layout_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="@dimen/padding10">
android:gravity="bottom"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="bottom"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/ico_discount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥"
android:textColor="@color/textRed"
android:textSize="@dimen/ts_detail_price" />
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_detail_discount"
android:textStyle="bold" />
<TextView
android:id="@+id/txt_discount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/padding5"
android:gravity="center_vertical"
android:text="19.9"
android:textColor="@color/textRed"
android:textSize="@dimen/ts_detail_price"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_detail_discount"
android:textStyle="bold" />
<TextView
android:id="@+id/ico_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5"
android:text="¥"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_detail_discount" />
android:textSize="@dimen/ts_detail_price" />
<TextView
android:id="@+id/txt_price"
android:layout_width="wrap_content"
......@@ -126,13 +130,12 @@
android:gravity="center_vertical"
android:text="29.9"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_detail_discount" />
android:textSize="@dimen/ts_detail_price" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_operate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding10"
android:gravity="center"
android:orientation="horizontal">
<Button
......@@ -140,39 +143,32 @@
style="@style/button_style"
android:layout_width="@dimen/ic_detail_add_size"
android:layout_height="@dimen/ic_detail_add_size"
android:foreground="?selectableItemBackground"
android:background="@mipmap/jianhao_2x" />
android:background="@mipmap/jianhao"
android:foreground="?selectableItemBackground" />
<TextView
android:id="@+id/txt_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding10"
android:layout_marginEnd="@dimen/padding10"
android:layout_marginStart="@dimen/goods_detail_count_margin_left"
android:layout_marginEnd="@dimen/goods_detail_count_margin_right"
android:text="1"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_detail_count" />
android:textSize="@dimen/ts_detail_count"
android:textStyle="bold" />
<Button
android:id="@+id/butn_add"
style="@style/button_style"
android:layout_width="@dimen/ic_detail_add_size"
android:foreground="?selectableItemBackground"
android:layout_height="@dimen/ic_detail_add_size"
android:background="@mipmap/jiahao_2x" />
android:background="@mipmap/jiahao"
android:foreground="?selectableItemBackground" />
</LinearLayout>
<TextView
android:id="@+id/txt_sellout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="已售罄"
android:textColor="@color/textRed"
android:textSize="@dimen/ts_detail_sellout"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_butns"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/goods_detail_butn_margin_top"
android:gravity="center_vertical"
android:orientation="horizontal">
<Button
......@@ -182,7 +178,7 @@
android:layout_weight="1"
android:background="@drawable/bg_button"
android:foreground="?selectableItemBackground"
android:padding="@dimen/padding10"
android:padding="@dimen/goods_detail_butn_padding"
android:text="加入购物袋"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/ts_detail_add_trolley"
......@@ -194,7 +190,7 @@
android:layout_weight="1"
android:background="@color/colorPrimary"
android:foreground="?selectableItemBackground"
android:padding="@dimen/padding10"
android:padding="@dimen/goods_detail_butn_padding"
android:text="立即购买"
android:textColor="@color/white"
android:textSize="@dimen/ts_detail_buynow"
......@@ -208,7 +204,7 @@
android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close"
android:layout_alignParentEnd="true"
android:layout_margin="@dimen/padding15"
android:layout_margin="@dimen/dialog_close_margin"
android:foreground="?selectableItemBackground"
android:src="@mipmap/chahao_2x" />
android:src="@mipmap/chazi" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_height="1px"
android:background="@color/line" />
\ No newline at end of file
......@@ -15,5 +15,5 @@
android:layout_alignParentEnd="true"
android:layout_margin="@dimen/padding15"
android:foreground="?selectableItemBackground"
android:src="@mipmap/chahao_2x" />
android:src="@mipmap/chazi" />
</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 @@
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding10"
android:layout_weight="1"
android:paddingHorizontal="@dimen/trolley_title_margin_hor"
android:paddingVertical="@dimen/trolley_title_margin_ver"
android:text="购物袋"
android:textColor="@android:color/black"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_trolley_name"
android:textStyle="bold" />
<LinearLayout
......@@ -37,24 +38,25 @@
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/padding20">
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/ic_clear_size"
android:layout_height="@dimen/ic_clear_size"
android:src="@mipmap/lajitong_2x" />
android:src="@mipmap/lajitong" />
<TextView
android:layout_width="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:textColor="@color/textSecondPrimary"
android:textColor="@color/textDisable"
android:textSize="@dimen/ts_trolley_clear" />
</LinearLayout>
</LinearLayout>
<ImageView
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" />
<ListView
android:id="@+id/list_trolley"
......@@ -62,10 +64,6 @@
android:layout_height="@dimen/trolley_item_height"
android:descendantFocusability="afterDescendants"
android:divider="@null" />
<ImageView
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/line" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
......@@ -78,20 +76,20 @@
android:gravity="center_vertical"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="@dimen/trolley_ic_border_size"
android:layout_height="match_parent">
android:layout_width="@dimen/trolley_ic_parent_width"
android:layout_height="@dimen/trolley_ic_parent_height"
android:layout_marginStart="@dimen/trolley_ic_margin_left">
<ImageView
android:id="@+id/img_trolley"
android:layout_width="@dimen/trolley_ic_size"
android:layout_height="@dimen/trolley_ic_size"
android:layout_width="@dimen/trolley_ic_width"
android:layout_height="@dimen/trolley_ic_height"
android:layout_centerInParent="true"
android:src="@mipmap/handbag_2x" />
android:src="@mipmap/gouwudai" />
<TextView
android:id="@+id/txt_count"
android:layout_width="@dimen/trolley_count_size"
android:layout_height="@dimen/trolley_count_size"
android:layout_alignParentEnd="true"
android:layout_margin="@dimen/padding7"
android:background="@drawable/ic_dot"
android:gravity="center"
android:textColor="@color/white"
......@@ -110,7 +108,8 @@
android:layout_height="wrap_content"
android:text="¥"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_trolley_total" />
android:textSize="@dimen/ts_trolley_total"
android:textStyle="bold" />
<TextView
android:id="@+id/txt_total"
android:layout_width="wrap_content"
......
......@@ -5,79 +5,143 @@
<dimen name="padding7">14dp</dimen>
<dimen name="padding5">10dp</dimen>
<dimen name="padding3">5dp</dimen>
<dimen name="rule_vertical_padding">8dp</dimen>
<dimen name="spec_rule_margin">13dp</dimen>
<dimen name="logo_width">400dp</dimen>
<dimen name="logo_padding">40dp</dimen>
<dimen name="goods_thum_size">150dp</dimen>
<dimen name="category_padding">40dp</dimen>
<dimen name="category_margin">100dp</dimen>
<dimen name="category_divider_padding">40dp</dimen>
<dimen name="toast_width">376px</dimen>
<dimen name="toast_padding_hor">32px</dimen>
<dimen name="toast_padding_ver">55px</dimen>
<dimen name="recommend_padding">38px</dimen>
<dimen name="recommend_name_margin_top">82px</dimen>
<dimen name="recommend_name_margin_left">68px</dimen>
<dimen name="recommend_desc_margin_top">18px</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">174px</dimen>
<dimen name="goods_thum_margin_right">40px</dimen>
<dimen name="goods_recommend_margin">30px</dimen>
<dimen name="goods_category_margin_top">43px</dimen>
<dimen name="goods_category_margin_bottom">31px</dimen>
<dimen name="goods_tag_margin_top">13px</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">129px</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">20dp</dimen>
<dimen name="menu_divider_padding_ver">80dp</dimen>
<dimen name="qrcode_size">300dp</dimen>
<dimen name="dialog_detail_width">1200dp</dimen>
<dimen name="dialog_tip_width">1200dp</dimen>
<dimen name="goods_detail_padding_ver">55px</dimen>
<dimen name="goods_detail_padding_hor">40px</dimen>
<dimen name="goods_detail_content_margin_left">90px</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">16px</dimen>
<dimen name="goods_detail_rule_margin_right">28px</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">17px</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">25px</dimen>
<dimen name="goods_detail_oper_margin_left">55px</dimen>
<dimen name="goods_detail_oper_margin_bottom">40px</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="trolley_width">800dp</dimen>
<dimen name="trolley_item_height">200dp</dimen>
<dimen name="trolley_bar_height">120dp</dimen>
<dimen name="trolley_bar_goods_margin">150dp</dimen>
<dimen name="trolley_pay_width">300dp</dimen>
<dimen name="trolley_ic_size">80dp</dimen>
<dimen name="trolley_ic_border_size">120dp</dimen>
<dimen name="trolley_count_size">30dp</dimen>
<dimen name="rule_recommend_corners">5dp</dimen>
<dimen name="dialog_detail_width">1800px</dimen>
<dimen name="dialog_tip_width">1100px</dimen>
<dimen name="dialog_close_margin">35px</dimen>
<dimen name="ic_recommend">20dp</dimen>
<dimen name="ic_clear_size">30dp</dimen>
<dimen name="ic_add_size">40dp</dimen>
<dimen name="ic_subtract_size">40dp</dimen>
<dimen name="ic_price">30dp</dimen>
<dimen name="ic_discount">20dp</dimen>
<dimen name="ic_checkbox">40dp</dimen>
<dimen name="ic_corners">20dp</dimen>
<dimen name="ic_detail_add_size">40dp</dimen>
<dimen name="ic_detail_subtract_size">40dp</dimen>
<dimen name="ic_detail_price">30dp</dimen>
<dimen name="ic_detail_discount">20dp</dimen>
<dimen name="ic_dialog_close">35dp</dimen>
<dimen name="ic_trolley_price">60dp</dimen>
<dimen name="ic_scan_succ">80dp</dimen>
<dimen name="ic_scan_wx">40dp</dimen>
<dimen name="trolley_width">850px</dimen>
<dimen name="trolley_item_height">210px</dimen>
<dimen name="trolley_bar_height">195px</dimen>
<dimen name="trolley_bar_goods_margin">400px</dimen>
<dimen name="trolley_pay_width">385px</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">92px</dimen>
<dimen name="trolley_ic_height">110px</dimen>
<dimen name="trolley_ic_border_size">116px</dimen>
<dimen name="trolley_count_size">48px</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="ts_recommend_name">36sp</dimen>
<dimen name="ts_recommend_desc">30sp</dimen>
<dimen name="ts_category_radio">20sp</dimen>
<dimen name="ts_category_item">26sp</dimen>
<dimen name="ts_goods_item_name">20sp</dimen>
<dimen name="ts_goods_item_intro">16sp</dimen>
<dimen name="ts_goods_item_price">16sp</dimen>
<dimen name="ts_goods_item_discount">14sp</dimen>
<dimen name="ts_goods_item_sellout">15sp</dimen>
<dimen name="ts_goods_item_tag">12sp</dimen>
<dimen name="ts_trolley_name">28sp</dimen>
<dimen name="ts_trolley_clear">22sp</dimen>
<dimen name="ts_trolley_total">26sp</dimen>
<dimen name="ts_trolley_item_count">20sp</dimen>
<dimen name="ts_trolley_count">18sp</dimen>
<dimen name="ts_trolley_pay">28sp</dimen>
<dimen name="ts_tips">18sp</dimen>
<dimen name="ts_detail_name">30sp</dimen>
<dimen name="ts_detail_spec">24sp</dimen>
<dimen name="ts_detail_spec_rec">12sp</dimen>
<dimen name="ts_detail_rule">22sp</dimen>
<dimen name="ts_detail_count">24sp</dimen>
<dimen name="ts_detail_price">24sp</dimen>
<dimen name="ts_detail_discount">22sp</dimen>
<dimen name="ts_detail_sellout">22sp</dimen>
<dimen name="ts_detail_add_trolley">24sp</dimen>
<dimen name="ts_detail_buynow">24sp</dimen>
<dimen name="ts_header_text">26sp</dimen>
<dimen name="ts_dialog_title">28sp</dimen>
<dimen name="ts_scan">24sp</dimen>
<dimen name="ts_expire">22sp</dimen>
<dimen name="ic_recommend">17px</dimen>
<dimen name="ic_clear_size">20px</dimen>
<dimen name="ic_add_size">40px</dimen>
<dimen name="ic_subtract_size">40px</dimen>
<dimen name="ic_checkbox">40px</dimen>
<dimen name="ic_detail_add_size">60px</dimen>
<dimen name="ic_detail_subtract_size">60px</dimen>
<dimen name="ic_dialog_close">36px</dimen>
<dimen name="ic_scan_succ_width">101px</dimen>
<dimen name="ic_scan_succ_height">97px</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">60px</dimen>
<dimen name="ts_recommend_desc">36px</dimen>
<dimen name="ts_category_radio">28px</dimen>
<dimen name="ts_category_item">40px</dimen>
<dimen name="ts_goods_item_name">28px</dimen>
<dimen name="ts_goods_item_intro">20px</dimen>
<dimen name="ts_goods_item_price">20px</dimen>
<dimen name="ts_goods_item_discount">24px</dimen>
<dimen name="ts_goods_item_sellout">20px</dimen>
<dimen name="ts_goods_item_tag">20px</dimen>
<dimen name="ts_trolley_name">40px</dimen>
<dimen name="ts_trolley_clear">24px</dimen>
<dimen name="ts_trolley_total">48px</dimen>
<dimen name="ts_trolley_item_count">36px</dimen>
<dimen name="ts_trolley_count">36px</dimen>
<dimen name="ts_trolley_pay">48px</dimen>
<dimen name="ts_tips">28px</dimen>
<dimen name="ts_detail_name">40px</dimen>
<dimen name="ts_detail_spec">28px</dimen>
<dimen name="ts_detail_spec_rec">16px</dimen>
<dimen name="ts_detail_rule">28px</dimen>
<dimen name="ts_detail_count">36px</dimen>
<dimen name="ts_detail_price">36px</dimen>
<dimen name="ts_detail_discount">48px</dimen>
<dimen name="ts_detail_add_trolley">48px</dimen>
<dimen name="ts_detail_buynow">48px</dimen>
<dimen name="ts_header_text">40px</dimen>
<dimen name="ts_dialog_title">40px</dimen>
<dimen name="ts_scan">36px</dimen>
<dimen name="ts_expire">36px</dimen>
<dimen name="ts_order_number">22sp</dimen>
<dimen name="ts_menu_title">22sp</dimen>
<dimen name="ts_menu_subtitle">18sp</dimen>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorLogo">#FF006ECF</color>
<color name="colorPrimary">#FF2C9CFF</color>
<color name="dialog_bg">#CC000000</color>
<color name="textPrimary">#FF000000</color>
<color name="colorPrimary">#FF003AE9</color>
<color name="dialog_bg">#99000000</color>
<color name="textPrimary">#FF333333</color>
<color name="textSecondPrimary">#FF666666</color>
<color name="textDisable">#FF999999</color>
<color name="line">#FF979797</color>
<color name="textRed">#FFFF001D</color>
<color name="textGray2B">#FF2B2B2B</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="black">#FF000000</color>
<color name="colorPrimaryDark">#FF00574B</color>
<color name="colorAccent">#FFD81B60</color>
<color name="colorPink">#FFFF72C1</color>
</resources>
......@@ -5,56 +5,121 @@
<dimen name="padding7">7dp</dimen>
<dimen name="padding5">5dp</dimen>
<dimen name="padding3">3dp</dimen>
<dimen name="rule_vertical_padding">3dp</dimen>
<dimen name="spec_rule_margin">5dp</dimen>
<dimen name="logo_width">200dp</dimen>
<dimen name="logo_padding">20dp</dimen>
<dimen name="toast_width">376px</dimen>
<dimen name="toast_padding_hor">32px</dimen>
<dimen name="toast_padding_ver">55px</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="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_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_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_tip_width">600dp</dimen>
<dimen name="dialog_close_margin">15dp</dimen>
<dimen name="trolley_width">400dp</dimen>
<dimen name="trolley_item_height">100dp</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_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_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_clear_size">15dp</dimen>
<dimen name="ic_add_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_corners">10dp</dimen>
<dimen name="ic_detail_add_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_trolley_price">30dp</dimen>
<dimen name="ic_scan_succ">40dp</dimen>
<dimen name="ic_scan_wx">20dp</dimen>
<dimen name="ic_scan_succ_width">101px</dimen>
<dimen name="ic_scan_succ_height">97px</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_desc">20sp</dimen>
<dimen name="ts_category_radio">12sp</dimen>
<dimen name="ts_category_item">18sp</dimen>
<dimen name="ts_goods_item_name">14sp</dimen>
<dimen name="ts_goods_item_intro">12sp</dimen>
<dimen name="ts_goods_item_price">12sp</dimen>
<dimen name="ts_goods_item_discount">9sp</dimen>
<dimen name="ts_goods_item_price">9sp</dimen>
<dimen name="ts_goods_item_discount">12sp</dimen>
<dimen name="ts_goods_item_sellout">12sp</dimen>
<dimen name="ts_goods_item_tag">9sp</dimen>
<dimen name="ts_trolley_item_count">12sp</dimen>
......@@ -69,9 +134,8 @@
<dimen name="ts_detail_spec_rec">6sp</dimen>
<dimen name="ts_detail_rule">12sp</dimen>
<dimen name="ts_detail_count">14sp</dimen>
<dimen name="ts_detail_price">14sp</dimen>
<dimen name="ts_detail_discount">12sp</dimen>
<dimen name="ts_detail_sellout">12sp</dimen>
<dimen name="ts_detail_price">12sp</dimen>
<dimen name="ts_detail_discount">14sp</dimen>
<dimen name="ts_detail_add_trolley">14sp</dimen>
<dimen name="ts_detail_buynow">14sp</dimen>
<dimen name="ts_header_text">14sp</dimen>
......
<resources>
<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="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="scan_succeed">扫码成功(%s秒后转到首页)</string>
<string name="error_choose_spec">请选择规格</string>
......@@ -10,5 +12,5 @@
<string name="error_price">商品金额错误</string>
<string name="error_sku_state">本商品已售罄或已经下架</string>
<string name="error_load_main_data">获取数据失败</string>
<string name="error_check_sku">商品状态获取失败</string>
<string name="error_check_sku">商品已售罄</string>
</resources>
<resources>
<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 name="button_style" parent="Widget.AppCompat.Button.Borderless">
</style>
</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