Commit daa586fa by wjg

init

parent 4b8660af
package com.ihaoin.hooloo.device.adapter; package com.ihaoin.hooloo.device.adapter;
import android.content.Context; import android.content.Context;
import android.graphics.Paint;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -84,10 +85,7 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo ...@@ -84,10 +85,7 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
helper.setText(R.id.txt_price, String.valueOf(sku.getPrice())); helper.setText(R.id.txt_price, String.valueOf(sku.getPrice()));
helper.setText(R.id.txt_discount, String.valueOf(sku.getDiscount())); helper.setText(R.id.txt_discount, String.valueOf(sku.getDiscount()));
if (Base.FALSE.equals(sku.getState())) { if (Base.TRUE.equals(sku.getState())) {
helper.setGone(R.id.txt_sellout, true);
helper.setGone(R.id.butn_add, false);
} else {
helper.setGone(R.id.txt_sellout, false); helper.setGone(R.id.txt_sellout, false);
helper.setGone(R.id.butn_add, true); helper.setGone(R.id.butn_add, true);
View butnAdd = helper.getView(R.id.butn_add); View butnAdd = helper.getView(R.id.butn_add);
...@@ -95,9 +93,23 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo ...@@ -95,9 +93,23 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
ViewGroup layoutItem = helper.getView(R.id.layout_item); ViewGroup layoutItem = helper.getView(R.id.layout_item);
Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd)); Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd));
} else {
helper.setGone(R.id.txt_sellout, true);
helper.setGone(R.id.butn_add, false);
} }
} }
if (Base.TRUE.equals(goods.getIsRecommend())) {
helper.setVisible(R.id.img_recommend, true);
} else {
helper.setGone(R.id.img_recommend, false);
}
TextView icoDiscount = helper.getView(R.id.ico_discount);
TextView txtDiscount = helper.getView(R.id.txt_discount);
icoDiscount.setPaintFlags(icoDiscount.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtDiscount.setPaintFlags(txtDiscount.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
View layoutItem = helper.getView(R.id.layout_item); View layoutItem = helper.getView(R.id.layout_item);
layoutItem.setOnClickListener(v -> Utils.showGoodsDetail(mContext, goods)); layoutItem.setOnClickListener(v -> Utils.showGoodsDetail(mContext, goods));
......
package com.ihaoin.hooloo.device.adapter; package com.ihaoin.hooloo.device.adapter;
import android.content.Context; import android.content.Context;
import android.graphics.Paint;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -39,6 +40,7 @@ public class TrolleyAdapter extends BaseAdapter { ...@@ -39,6 +40,7 @@ public class TrolleyAdapter extends BaseAdapter {
TextView txtOptions = convertView.findViewById(R.id.txt_options); TextView txtOptions = convertView.findViewById(R.id.txt_options);
TextView txtPrice = convertView.findViewById(R.id.txt_price); TextView txtPrice = convertView.findViewById(R.id.txt_price);
TextView txtDiscount = convertView.findViewById(R.id.txt_discount); TextView txtDiscount = convertView.findViewById(R.id.txt_discount);
TextView icoDiscount = convertView.findViewById(R.id.ico_discount);
View butnSubtract = convertView.findViewById(R.id.butn_subtract); View butnSubtract = convertView.findViewById(R.id.butn_subtract);
TextView txtCount = convertView.findViewById(R.id.txt_count); TextView txtCount = convertView.findViewById(R.id.txt_count);
View butnAdd = convertView.findViewById(R.id.butn_add); View butnAdd = convertView.findViewById(R.id.butn_add);
...@@ -67,6 +69,9 @@ public class TrolleyAdapter extends BaseAdapter { ...@@ -67,6 +69,9 @@ public class TrolleyAdapter extends BaseAdapter {
txtPrice.setText(goods.getPrice().toString()); txtPrice.setText(goods.getPrice().toString());
txtDiscount.setText(goods.getDiscount().toString()); txtDiscount.setText(goods.getDiscount().toString());
icoDiscount.setPaintFlags(icoDiscount.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtDiscount.setPaintFlags(txtDiscount.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtCount.setText(goods.getCount().toString()); txtCount.setText(goods.getCount().toString());
butnSubtract.setOnClickListener(v -> trolleyView.subtractGoods(position)); butnSubtract.setOnClickListener(v -> trolleyView.subtractGoods(position));
butnAdd.setOnClickListener(v -> trolleyView.addGoods(position)); butnAdd.setOnClickListener(v -> trolleyView.addGoods(position));
......
...@@ -2,13 +2,13 @@ package com.ihaoin.hooloo.device.view; ...@@ -2,13 +2,13 @@ package com.ihaoin.hooloo.device.view;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.graphics.Paint;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
...@@ -42,6 +42,7 @@ public class GoodsDetailDialog extends Dialog { ...@@ -42,6 +42,7 @@ public class GoodsDetailDialog extends Dialog {
private LinearLayout layoutSpecs; private LinearLayout layoutSpecs;
private LinearLayout layoutImages; private LinearLayout layoutImages;
private TextView txtPrice; private TextView txtPrice;
private TextView icoDiscount;
private TextView txtDiscount; private TextView txtDiscount;
private Button butnSubtract; private Button butnSubtract;
private TextView txtCount; private TextView txtCount;
...@@ -76,6 +77,7 @@ public class GoodsDetailDialog extends Dialog { ...@@ -76,6 +77,7 @@ public class GoodsDetailDialog extends Dialog {
layoutSpecs = findViewById(R.id.layout_specs); layoutSpecs = findViewById(R.id.layout_specs);
layoutImages = findViewById(R.id.layout_images); layoutImages = findViewById(R.id.layout_images);
txtPrice = findViewById(R.id.txt_price); txtPrice = findViewById(R.id.txt_price);
icoDiscount = findViewById(R.id.ico_discount);
txtDiscount = findViewById(R.id.txt_discount); txtDiscount = findViewById(R.id.txt_discount);
butnSubtract = findViewById(R.id.butn_subtract); butnSubtract = findViewById(R.id.butn_subtract);
txtCount = findViewById(R.id.txt_count); txtCount = findViewById(R.id.txt_count);
...@@ -97,6 +99,9 @@ public class GoodsDetailDialog extends Dialog { ...@@ -97,6 +99,9 @@ public class GoodsDetailDialog extends Dialog {
butnSubtract.setOnClickListener(v -> subtractGoods()); butnSubtract.setOnClickListener(v -> subtractGoods());
butnAdd.setOnClickListener(v -> addGoods()); butnAdd.setOnClickListener(v -> addGoods());
icoDiscount.setPaintFlags(icoDiscount.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtDiscount.setPaintFlags(txtDiscount.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
butnBuy.setOnClickListener(v -> buyNow()); butnBuy.setOnClickListener(v -> buyNow());
butnTrolley.setOnClickListener(v -> addTrolley()); butnTrolley.setOnClickListener(v -> addTrolley());
...@@ -157,29 +162,55 @@ public class GoodsDetailDialog extends Dialog { ...@@ -157,29 +162,55 @@ public class GoodsDetailDialog extends Dialog {
} }
View specView = getLayoutInflater().inflate(R.layout.item_spec, null); View specView = getLayoutInflater().inflate(R.layout.item_spec, null);
TextView txtName = specView.findViewById(R.id.txt_name); TextView txtName = specView.findViewById(R.id.txt_name);
RadioGroup specGroup = specView.findViewById(R.id.group_spec); LinearLayout layoutRules = specView.findViewById(R.id.layout_rules);
txtName.setText(spec.getSpecName()); txtName.setText(spec.getSpecName());
spec.getRules().forEach(rule -> { spec.getRules().forEach(rule -> {
RadioGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(RadioGroup.LayoutParams.WRAP_CONTENT, RadioGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(RadioGroup.LayoutParams.WRAP_CONTENT, RadioGroup.LayoutParams.WRAP_CONTENT);
layoutParams.rightMargin = Utils.getDimens(getContext(), R.dimen.padding5); layoutParams.rightMargin = Utils.getDimens(getContext(), R.dimen.padding5);
RadioButton button = (RadioButton) getLayoutInflater().inflate(R.layout.item_spec_rule, null);
View ruleView = getLayoutInflater().inflate(R.layout.item_spec_rule, null);
ruleView.setTag(rule);
TextView button = ruleView.findViewById(R.id.butn_rule);
button.setId(rule.getRuleId()); button.setId(rule.getRuleId());
button.setText(rule.getRuleName()); button.setText(rule.getRuleName());
button.setTag(rule);
if (!Base.TRUE.equals(rule.getState())) { if (!Base.TRUE.equals(rule.getState())) {
button.setEnabled(false); button.setEnabled(false);
} else if (Base.TRUE.equals(rule.getIsDefault())) { } else if (Base.TRUE.equals(rule.getIsDefault())) {
button.setChecked(true); button.setSelected(true);
ruleView.setSelected(true);
} }
specGroup.addView(button, layoutParams); if (Base.TRUE.equals(rule.getIsRecommend())) {
ruleView.findViewById(R.id.txt_recommend).setVisibility(View.VISIBLE);
}
layoutRules.addView(ruleView, layoutParams);
ruleView.setOnClickListener(v -> {
clearSelected(layoutRules);
ruleView.setSelected(true);
button.setSelected(true);
changeSkuWithRule();
});
}); });
layoutSpecs.addView(specView); layoutSpecs.addView(specView);
specGroup.setOnCheckedChangeListener((group, checkedId) -> changeSkuWithRule()); // layoutRules.setOnCheckedChangeListener((group, checkedId) -> changeSkuWithRule());
}); });
changeSkuWithRule(); changeSkuWithRule();
} }
private void clearSelected(ViewGroup group) {
if (group.getChildCount() <= 0) {
return;
}
for (int i = 0; i < group.getChildCount(); i++) {
View v = group.getChildAt(i);
v.setSelected(false);
if (v instanceof ViewGroup) {
clearSelected((ViewGroup) v);
}
}
}
private void changeSkuWithRule() { private void changeSkuWithRule() {
if (layoutSpecs.getChildCount() <= 0) { if (layoutSpecs.getChildCount() <= 0) {
return; return;
...@@ -187,12 +218,12 @@ public class GoodsDetailDialog extends Dialog { ...@@ -187,12 +218,12 @@ public class GoodsDetailDialog extends Dialog {
List<GoodsRule> rules = new ArrayList<>(); List<GoodsRule> rules = new ArrayList<>();
for (int i = 0; i < layoutSpecs.getChildCount(); i++) { for (int i = 0; i < layoutSpecs.getChildCount(); i++) {
View v = layoutSpecs.getChildAt(i); View v = layoutSpecs.getChildAt(i);
RadioGroup group = v.findViewById(R.id.group_spec); LinearLayout layoutRules = (LinearLayout) v.findViewById(R.id.layout_rules);
RadioButton button = group.findViewById(group.getCheckedRadioButtonId()); View view = getSelectedView(layoutRules);
if (button == null) { if (view == null) {
continue; continue;
} }
rules.add((GoodsRule) button.getTag()); rules.add((GoodsRule) view.getTag());
} }
checkSku = matchSku(rules); checkSku = matchSku(rules);
if (checkSku == null) { if (checkSku == null) {
...@@ -203,6 +234,19 @@ public class GoodsDetailDialog extends Dialog { ...@@ -203,6 +234,19 @@ public class GoodsDetailDialog extends Dialog {
txtDiscount.setText(String.valueOf(checkSku.getDiscount())); txtDiscount.setText(String.valueOf(checkSku.getDiscount()));
} }
private View getSelectedView(LinearLayout layoutRules) {
if (layoutRules.getChildCount() <= 0) {
return null;
}
for (int i = 0; i < layoutRules.getChildCount(); i++) {
View v = layoutRules.getChildAt(i);
if (v.isSelected()) {
return v;
}
}
return null;
}
private Sku matchSku(List<GoodsRule> rules) { private Sku matchSku(List<GoodsRule> rules) {
if (CollectionUtils.isEmpty(rules)) { if (CollectionUtils.isEmpty(rules)) {
return null; return null;
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/rule_recommend_corners" />
<solid
android:width="1dp"
android:color="@color/colorPink" />
</shape>
</item>
</layer-list>
<vector android:height="18dp" android:tint="#999999"
android:viewportHeight="24" android:viewportWidth="24"
android:width="18dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8,9h8v10L8,19L8,9zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z"/>
</vector>
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> <selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<item android:drawable="@mipmap/duigou_2x" android:state_checked="true" /> <item android:drawable="@mipmap/duigou_2x" android:state_checked="true" />
<item android:drawable="@mipmap/duigou_2x" android:state_selected="true" /> <item android:drawable="@mipmap/duigou_2x" android:state_selected="true" />
<item android:drawable="@mipmap/duigou_2x" /> <item android:drawable="@mipmap/weixuanzhong_2x" />
</selector> </selector>
...@@ -11,21 +11,24 @@ ...@@ -11,21 +11,24 @@
android:id="@+id/rec_recommend" android:id="@+id/rec_recommend"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="7" /> android:layout_weight="7"
android:descendantFocusability="afterDescendants" />
<FrameLayout <FrameLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/padding10" android:layout_marginLeft="@dimen/padding10"
android:layout_weight="4.5"> android:layout_weight="4.5">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:paddingTop="@dimen/padding20"
android:id="@+id/rec_right" android:id="@+id/rec_right"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"
android:descendantFocusability="afterDescendants"
android:paddingTop="@dimen/padding20" />
</FrameLayout> </FrameLayout>
<ScrollView <ScrollView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:descendantFocusability="afterDescendants"
android:scrollbars="none"> android:scrollbars="none">
<RadioGroup <RadioGroup
android:id="@+id/group_category" android:id="@+id/group_category"
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:descendantFocusability="afterDescendants"
android:scrollbars="none"> android:scrollbars="none">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
android:layout_height="@dimen/ic_recommend" android:layout_height="@dimen/ic_recommend"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_margin="@dimen/padding5" android:layout_margin="@dimen/padding5"
android:src="@mipmap/aixin_2x" /> android:src="@mipmap/aixin_2x"
android:visibility="gone" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
android:id="@+id/layout_right" android:id="@+id/layout_right"
...@@ -61,37 +62,42 @@ ...@@ -61,37 +62,42 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding3"> android:layout_marginTop="@dimen/padding3">
<ImageView <TextView
android:id="@+id/img_price" android:id="@+id/ico_price"
android:layout_width="@dimen/ic_price" android:layout_width="wrap_content"
android:layout_height="@dimen/ic_price" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:src="@drawable/ms__arrow" /> android:src="@drawable/ms__arrow"
android:text="¥"
android:textColor="@color/textRed"
android:textSize="@dimen/ts_goods_item_price" />
<TextView <TextView
android:id="@+id/txt_price" android:id="@+id/txt_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_toRightOf="@id/img_price" android:layout_toRightOf="@id/ico_price"
android:text="19.9" android:text="19.9"
android:textColor="@color/textRed" android:textColor="@color/textRed"
android:textSize="@dimen/ts_goods_item_price" android:textSize="@dimen/ts_goods_item_price"
android:textStyle="bold" /> android:textStyle="bold" />
<ImageView <TextView
android:id="@+id/img_discount" android:id="@+id/ico_discount"
android:layout_width="@dimen/ic_discount" android:layout_width="wrap_content"
android:layout_height="@dimen/ic_discount" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/padding5" android:layout_marginStart="@dimen/padding5"
android:layout_toEndOf="@id/txt_price" android:layout_toEndOf="@id/txt_price"
android:src="@drawable/ms__arrow" /> android:text="¥"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" />
<TextView <TextView
android:id="@+id/txt_discount" android:id="@+id/txt_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_toEndOf="@id/img_discount" android:layout_toEndOf="@id/ico_discount"
android:text="29.9" android:text="29.9"
android:textColor="@color/textSecondPrimary" android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" /> android:textSize="@dimen/ts_goods_item_discount" />
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
android:textColor="@color/textPrimary" android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_detail_spec" android:textSize="@dimen/ts_detail_spec"
android:textStyle="bold" /> android:textStyle="bold" />
<RadioGroup <LinearLayout
android:id="@+id/group_spec" android:id="@+id/layout_rules"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spec_rule_margin" android:layout_marginTop="@dimen/spec_rule_margin"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RadioButton xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/butn_rule" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_marginEnd="@dimen/padding10" <TextView
android:background="@drawable/sel_spec_bg" android:id="@+id/butn_rule"
android:button="@null" android:layout_width="wrap_content"
android:paddingHorizontal="@dimen/padding10" android:layout_height="wrap_content"
android:paddingVertical="@dimen/rule_vertical_padding" android:layout_marginTop="@dimen/padding5"
android:singleLine="true" android:layout_marginEnd="@dimen/padding10"
android:textColor="@drawable/sel_spec_color" android:background="@drawable/sel_spec_bg"
android:textSize="@dimen/ts_detail_rule" /> android:paddingHorizontal="@dimen/padding10"
android:paddingVertical="@dimen/rule_vertical_padding"
android:singleLine="true"
android:text="加糖"
android:textColor="@drawable/sel_spec_color"
android:textSize="@dimen/ts_detail_rule"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/txt_recommend"
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: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
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/txt_recommend"
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:text="推荐"
android:textColor="@color/white"
android:textSize="@dimen/ts_detail_spec_rec" />
...@@ -49,10 +49,13 @@ ...@@ -49,10 +49,13 @@
android:layout_marginTop="@dimen/padding5" android:layout_marginTop="@dimen/padding5"
android:gravity="bottom" android:gravity="bottom"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <TextView
android:layout_width="@dimen/ic_price" android:id="@+id/ico_price"
android:layout_height="@dimen/ic_price" android:layout_width="wrap_content"
android:src="@drawable/ms__arrow" /> android:layout_height="wrap_content"
android:text="¥"
android:textColor="@color/textRed"
android:textSize="@dimen/ts_goods_item_price" />
<TextView <TextView
android:id="@+id/txt_price" android:id="@+id/txt_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -61,12 +64,14 @@ ...@@ -61,12 +64,14 @@
android:textColor="@color/textRed" android:textColor="@color/textRed"
android:textSize="@dimen/ts_goods_item_price" android:textSize="@dimen/ts_goods_item_price"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView
<ImageView android:id="@+id/ico_discount"
android:layout_width="@dimen/ic_discount" android:layout_width="wrap_content"
android:layout_height="@dimen/ic_discount" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5" android:layout_marginStart="@dimen/padding5"
android:src="@drawable/ms__arrow" /> android:text="¥"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_goods_item_discount" />
<TextView <TextView
android:id="@+id/txt_discount" android:id="@+id/txt_discount"
android:layout_width="0dp" android:layout_width="0dp"
......
...@@ -71,10 +71,13 @@ ...@@ -71,10 +71,13 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="bottom" android:gravity="bottom"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <TextView
android:layout_width="@dimen/ic_detail_price" android:id="@+id/ico_price"
android:layout_height="@dimen/ic_detail_price" android:layout_width="wrap_content"
android:src="@drawable/ms__arrow" /> android:layout_height="wrap_content"
android:text="¥"
android:textColor="@color/textRed"
android:textSize="@dimen/ts_detail_price" />
<TextView <TextView
android:id="@+id/txt_price" android:id="@+id/txt_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -85,11 +88,14 @@ ...@@ -85,11 +88,14 @@
android:textSize="@dimen/ts_detail_price" android:textSize="@dimen/ts_detail_price"
android:textStyle="bold" /> android:textStyle="bold" />
<ImageView <TextView
android:layout_width="@dimen/ic_detail_discount" android:id="@+id/ico_discount"
android:layout_height="@dimen/ic_detail_discount" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding5" android:layout_marginStart="@dimen/padding5"
android:src="@drawable/ms__arrow" /> android:text="¥"
android:textColor="@color/textSecondPrimary"
android:textSize="@dimen/ts_detail_discount" />
<TextView <TextView
android:id="@+id/txt_discount" android:id="@+id/txt_discount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
android:padding="@dimen/padding10" android:orientation="horizontal"
android:orientation="horizontal"> android:padding="@dimen/padding10">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
android:layout_width="@dimen/ic_clear_size" android:layout_width="@dimen/ic_clear_size"
android:layout_height="@dimen/ic_clear_size" android:layout_height="@dimen/ic_clear_size"
android:layout_marginStart="@dimen/padding5" android:layout_marginStart="@dimen/padding5"
android:src="@drawable/ic_baseline_delete_outline_24" /> android:src="@mipmap/lajitong_2x" />
<Button <Button
android:id="@+id/butn_clear" android:id="@+id/butn_clear"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
android:id="@+id/list_trolley" android:id="@+id/list_trolley"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/trolley_item_height" android:layout_height="@dimen/trolley_item_height"
android:descendantFocusability="afterDescendants"
android:divider="@null" /> android:divider="@null" />
<ImageView <ImageView
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -84,8 +85,8 @@ ...@@ -84,8 +85,8 @@
android:layout_width="@dimen/trolley_count_size" android:layout_width="@dimen/trolley_count_size"
android:layout_height="@dimen/trolley_count_size" android:layout_height="@dimen/trolley_count_size"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:background="@drawable/ic_dot"
android:layout_margin="@dimen/padding7" android:layout_margin="@dimen/padding7"
android:background="@drawable/ic_dot"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/ts_trolley_count" android:textSize="@dimen/ts_trolley_count"
...@@ -97,10 +98,13 @@ ...@@ -97,10 +98,13 @@
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <TextView
android:layout_width="@dimen/ic_trolley_price" android:id="@+id/ico_total"
android:layout_height="@dimen/ic_trolley_price" android:layout_width="wrap_content"
android:src="@drawable/ms__menu_down" /> android:layout_height="wrap_content"
android:text="¥"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_trolley_total" />
<TextView <TextView
android:id="@+id/txt_total" android:id="@+id/txt_total"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<dimen name="trolley_ic_size">80dp</dimen> <dimen name="trolley_ic_size">80dp</dimen>
<dimen name="trolley_ic_border_size">120dp</dimen> <dimen name="trolley_ic_border_size">120dp</dimen>
<dimen name="trolley_count_size">30dp</dimen> <dimen name="trolley_count_size">30dp</dimen>
<dimen name="rule_recommend_corners">5dp</dimen>
<dimen name="ic_recommend">20dp</dimen> <dimen name="ic_recommend">20dp</dimen>
<dimen name="ic_clear_size">30dp</dimen> <dimen name="ic_clear_size">30dp</dimen>
...@@ -64,6 +65,7 @@ ...@@ -64,6 +65,7 @@
<dimen name="ts_tips">18sp</dimen> <dimen name="ts_tips">18sp</dimen>
<dimen name="ts_detail_name">30sp</dimen> <dimen name="ts_detail_name">30sp</dimen>
<dimen name="ts_detail_spec">24sp</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_rule">22sp</dimen>
<dimen name="ts_detail_count">24sp</dimen> <dimen name="ts_detail_count">24sp</dimen>
<dimen name="ts_detail_price">24sp</dimen> <dimen name="ts_detail_price">24sp</dimen>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<color name="textRed">#FFFF001D</color> <color name="textRed">#FFFF001D</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="colorPrimaryDark">#00574B</color> <color name="colorPrimaryDark">#FF00574B</color>
<color name="colorAccent">#D81B60</color> <color name="colorAccent">#FFD81B60</color>
<color name="colorPink">#FFFF72C1</color>
</resources> </resources>
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<dimen name="trolley_ic_size">40dp</dimen> <dimen name="trolley_ic_size">40dp</dimen>
<dimen name="trolley_ic_border_size">50dp</dimen> <dimen name="trolley_ic_border_size">50dp</dimen>
<dimen name="trolley_count_size">20dp</dimen> <dimen name="trolley_count_size">20dp</dimen>
<dimen name="rule_recommend_corners">3dp</dimen>
<dimen name="ic_recommend">10dp</dimen> <dimen name="ic_recommend">10dp</dimen>
<dimen name="ic_clear_size">15dp</dimen> <dimen name="ic_clear_size">15dp</dimen>
...@@ -40,7 +41,7 @@ ...@@ -40,7 +41,7 @@
<dimen name="ic_detail_subtract_size">20dp</dimen> <dimen name="ic_detail_subtract_size">20dp</dimen>
<dimen name="ic_detail_price">15dp</dimen> <dimen name="ic_detail_price">15dp</dimen>
<dimen name="ic_detail_discount">10dp</dimen> <dimen name="ic_detail_discount">10dp</dimen>
<dimen name="ic_dialog_close">30dp</dimen> <dimen name="ic_dialog_close">20dp</dimen>
<dimen name="ic_trolley_price">30dp</dimen> <dimen name="ic_trolley_price">30dp</dimen>
<dimen name="ic_scan_succ">40dp</dimen> <dimen name="ic_scan_succ">40dp</dimen>
<dimen name="ic_scan_wx">20dp</dimen> <dimen name="ic_scan_wx">20dp</dimen>
...@@ -64,6 +65,7 @@ ...@@ -64,6 +65,7 @@
<dimen name="ts_tips">9sp</dimen> <dimen name="ts_tips">9sp</dimen>
<dimen name="ts_detail_name">20sp</dimen> <dimen name="ts_detail_name">20sp</dimen>
<dimen name="ts_detail_spec">14sp</dimen> <dimen name="ts_detail_spec">14sp</dimen>
<dimen name="ts_detail_spec_rec">6sp</dimen>
<dimen name="ts_detail_rule">12sp</dimen> <dimen name="ts_detail_rule">12sp</dimen>
<dimen name="ts_detail_count">14sp</dimen> <dimen name="ts_detail_count">14sp</dimen>
<dimen name="ts_detail_price">14sp</dimen> <dimen name="ts_detail_price">14sp</dimen>
......
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