From e191fc91087c74a8c8ec989c3135d578c96b5ed7 Mon Sep 17 00:00:00 2001 From: itgaojian163 Date: Fri, 23 Dec 2022 17:15:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/widget/views/AddOrDelView.java | 78 ++++++++++++++ .../res/drawable-xhdpi/ic_add_circle_icon.png | Bin 0 -> 868 bytes .../res/drawable-xhdpi/ic_del_circle_icon.png | Bin 0 -> 750 bytes .../drawable-xhdpi/ic_goods_sort_default.png | Bin 0 -> 351 bytes .../src/main/res/layout/layout_add_delete.xml | 37 +++++++ moduleshop/src/main/AndroidManifest.xml | 6 +- .../activitys/GoodsDetailActivity.java | 7 +- .../moduleshop/activitys/ShopCarActivity.java | 42 +++++++- .../moduleshop/adapter/CarGoodsAdapter.java | 64 +++++++++++ .../moduleshop/adapter/GoodsCarAdapter.java | 40 +++++++ .../moduleshop/adapter/ShopSortAdapter.java | 9 ++ .../adapter/ShopSortSecondAdapter.java | 4 + .../moduleshop/beans/CustomCarBean.java | 37 +++++++ .../moduleshop/beans/ShopGoodsDetailBean.java | 12 ++- .../moduleshop/holder/CarGoodsHolder.java | 35 ++++++ .../moduleshop/holder/GoodsCarHolder.java | 24 +++++ .../src/main/res/layout/item_car_goods.xml | 102 ++++++++++++++++++ .../src/main/res/layout/item_goods_car.xml | 22 ++++ .../main/res/layout/item_second_shop_sort.xml | 2 + 19 files changed, 513 insertions(+), 8 deletions(-) create mode 100644 cm_utils/src/main/java/com/sucstepsoft/cm_utils/core/widget/views/AddOrDelView.java create mode 100644 cm_utils/src/main/res/drawable-xhdpi/ic_add_circle_icon.png create mode 100644 cm_utils/src/main/res/drawable-xhdpi/ic_del_circle_icon.png create mode 100644 cm_utils/src/main/res/drawable-xhdpi/ic_goods_sort_default.png create mode 100644 cm_utils/src/main/res/layout/layout_add_delete.xml create mode 100644 moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/CarGoodsAdapter.java create mode 100644 moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/GoodsCarAdapter.java create mode 100644 moduleshop/src/main/java/com/tenlionsoft/moduleshop/beans/CustomCarBean.java create mode 100644 moduleshop/src/main/java/com/tenlionsoft/moduleshop/holder/CarGoodsHolder.java create mode 100644 moduleshop/src/main/java/com/tenlionsoft/moduleshop/holder/GoodsCarHolder.java create mode 100644 moduleshop/src/main/res/layout/item_car_goods.xml create mode 100644 moduleshop/src/main/res/layout/item_goods_car.xml diff --git a/cm_utils/src/main/java/com/sucstepsoft/cm_utils/core/widget/views/AddOrDelView.java b/cm_utils/src/main/java/com/sucstepsoft/cm_utils/core/widget/views/AddOrDelView.java new file mode 100644 index 0000000..6ae3737 --- /dev/null +++ b/cm_utils/src/main/java/com/sucstepsoft/cm_utils/core/widget/views/AddOrDelView.java @@ -0,0 +1,78 @@ +package com.sucstepsoft.cm_utils.core.widget.views; + +import android.content.Context; +import android.content.res.TypedArray; +import android.util.AttributeSet; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +import com.sucstepsoft.cm_utils.R; + +public class AddOrDelView extends LinearLayout { + private OnAddDelClickListener listener; + private EditText et_number; + + public interface OnAddDelClickListener { + void onAddClick(View v); + + void onDelClick(View v); + } + + public AddOrDelView(Context context) { + this(context, null); + } + + public AddOrDelView(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public AddOrDelView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + initView(context, attrs, defStyleAttr); + } + + private void initView(Context context, AttributeSet attrs, int defStyleAttr) { + View.inflate(context, R.layout.layout_add_delete, this); + ImageView but_add = findViewById(R.id.iv_add); + ImageView but_delete = findViewById(R.id.iv_del); + et_number = findViewById(R.id.et_number); + + //释放资源 typedArray.recycle(); + but_add.setOnClickListener(view -> listener.onAddClick(view)); + but_delete.setOnClickListener(view -> listener.onDelClick(view)); + } + + /** + * 对外提供设置EditText值的方法 + */ + public void setNumber(int number) { + if (number > 0) { + et_number.setText(number + ""); + } + } + + /** + * 得到控件原来的值 + */ + public int getNumber() { + int number = 0; + try { + String numberStr = et_number.getText().toString().trim(); + number = Integer.valueOf(numberStr); + } catch (Exception e) { + number = 0; + } + return number; + } + + public void setOnAddDelClickListener(OnAddDelClickListener listener) { + if (listener != null) { + this.listener = listener; + } + } +} diff --git a/cm_utils/src/main/res/drawable-xhdpi/ic_add_circle_icon.png b/cm_utils/src/main/res/drawable-xhdpi/ic_add_circle_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cbd3aca757945efb673ac61d21498feb286c59d3 GIT binary patch literal 868 zcmV-q1DpJbP)Px&9!W$&R9HvFmrF=gVHC&z=hLx8q2AY|8!-tYXc1Al$b~@!6-7aUMA+Ohu#Jlz zBt&4F7D;VtCFH$YMD$pgiwIgIq+k)a2!ev52o#;`9YYZEaZh|c$8ko#J45>I=Fb0| z|8EX+zjF>Db^1#8^6c-FOdERiCl%yhdOmiP0s0X1AK;_yo z+{;Wo(?!#dn}#O5_42O?;FgtEA`s1BGy{mNmn`l3uK?QYgzu~smleRZbopx^0N5VV zc!ivRm$NM5jh;7=DNja#1@q_m7^lV(@NK3rIC^n-{8xI;RRA5PeoGKqmCTvDL3CP4 z3!s3-fdY9~R|qnK!3 z79Id#?zX+;nNA^~1EJ0Hs{okrG(PH|BPXigCC1f_29SQUe`gGGqxuIh4sHej zz$eJH^zQ(wHU)sFK>~~eC`ki&5iq_iJ`?hdUwC6ubpkx9w4_RKf$R-xhjAH%3jp@21uPFD83E+OE=#Kk zK<^b3%05!6sQqat{2l4qjC(=5X_gmJAn%6bipkfM$=(u6DSN6o>t@srL?V{fN+7wG z73T=jPb}JEo|kpnUUxZtWEi^xLNgOL0NAPs@`H)nQ~zw);?@ON40Ou2SrkO-z^G%8 uDFA~36Tl>ZF%aY?JP76Px%s7XXYR9HvFmrH09Q51&%leTf;gXCr=QE}r|K|w{(g|-ORN9)cmL@`sUf`z)# zb#bj53kqt`1Ro32CP&gVA(PA`F=o=)&D?wb|2t>y z+TqnlqcAA&8 zm~dk_rOs4p+W_L4ww)>e)(i8JCb4fv)Uw`{?<>u`%-*dE zmRdIiWS2IvqFr1I9%iBko|-R-6Z1gSNi}0vjN;)zgqh<-y=H#u%c&P zKlbgXWdkTK#L#_!2fc-$X+zE(DS6lqqgz^VAWt;yC4i54@T8S4@3=L`vA0#QXJ7LQ z3J+povD?Qe?24<}SqTDu-xwBSV4P!MLo*-*dwI&;S4c literal 0 HcmV?d00001 diff --git a/cm_utils/src/main/res/drawable-xhdpi/ic_goods_sort_default.png b/cm_utils/src/main/res/drawable-xhdpi/ic_goods_sort_default.png new file mode 100644 index 0000000000000000000000000000000000000000..c46912f1f80b1bdd24cf16c87d709b7c7b0371d7 GIT binary patch literal 351 zcmV-l0igbgP)Px$8A(JzR9Hu2WEfz;IKcKZj5+{o2rLj0G5*W&&lgwpFfsjqmH6uYG-UY&B7%{B z85q@Z>S6eIAo0zI1L*P?4wx?@;K0Dhw4YGgVEoTelJMqTFG$^dQK5bY28IH{dYDWS z-n==BtPaBgb47$2m>3!A2^q$~@c%&K>-UZj2MF$GU|@70r03s%hQ{PK?;1uOFd71* zAuzZ@fVh19|25NpW}EmoZ*D=<3m7mkFs)}`U{JtW7W`+pn)v3O4#AR;P+>xC`N3Hm z5-wV47zLEo1^+Q>J4BQ*I?%i>NPPVcYm~xj*ii?JhQRO-0fztoz)du)fRSlGQ6Vtk xjZ%>72eesE?aGFbd4sbuBIIgn$`5!5003nuKQKYRXnp_y002ovPDHLkV1m~mlTQEu literal 0 HcmV?d00001 diff --git a/cm_utils/src/main/res/layout/layout_add_delete.xml b/cm_utils/src/main/res/layout/layout_add_delete.xml new file mode 100644 index 0000000..3e932af --- /dev/null +++ b/cm_utils/src/main/res/layout/layout_add_delete.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/moduleshop/src/main/AndroidManifest.xml b/moduleshop/src/main/AndroidManifest.xml index 9eb6b15..a6d4484 100644 --- a/moduleshop/src/main/AndroidManifest.xml +++ b/moduleshop/src/main/AndroidManifest.xml @@ -4,21 +4,21 @@ { setPrice(b.getGoodsItemUnitPrice()); + mDetailBean.setGoodsPrice(b.getGoodsItemUnitPrice()+""); mTvGoodsStock.setText("库存:" + b.getGoodsItemTotal()); mStandardAdapter.setSelPos(p); }); mTvAddCar.setOnClickListener(v -> addToCar(mDetailBean)); - + mLlCar.setOnClickListener(v -> ARouter.getInstance() + .build(PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_CAR) + .navigation()); } private void parserShopCar() { @@ -185,6 +189,7 @@ public class GoodsDetailActivity extends BaseActivity { mCarDatas.get(pos).setCarAmount(mCarDatas.get(pos).getCarAmount() + 1); } else { bean.setCarAmount(1); + bean.setGoodsPrice(""); mCarDatas.add(bean); } } diff --git a/moduleshop/src/main/java/com/tenlionsoft/moduleshop/activitys/ShopCarActivity.java b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/activitys/ShopCarActivity.java index 9f0907d..5c619f2 100644 --- a/moduleshop/src/main/java/com/tenlionsoft/moduleshop/activitys/ShopCarActivity.java +++ b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/activitys/ShopCarActivity.java @@ -2,6 +2,9 @@ package com.tenlionsoft.moduleshop.activitys; import android.text.TextUtils; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + import com.alibaba.android.arouter.facade.annotation.Route; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; @@ -9,11 +12,16 @@ import com.sucstepsoft.cm_utils.constant.PathConfig; import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity; import com.sucstepsoft.cm_utils.utils.UserLgUtils; import com.tengshisoft.moduleshop.R; +import com.tengshisoft.moduleshop.R2; +import com.tenlionsoft.moduleshop.adapter.GoodsCarAdapter; +import com.tenlionsoft.moduleshop.beans.CustomCarBean; import com.tenlionsoft.moduleshop.beans.ShopGoodsDetailBean; import java.lang.reflect.Type; +import java.util.ArrayList; import java.util.List; +import butterknife.BindView; import butterknife.ButterKnife; /** @@ -21,9 +29,11 @@ import butterknife.ButterKnife; */ @Route(path = PathConfig.PATH_MODULE_SHOP_ACTIVITY_SHOP_CAR) public class ShopCarActivity extends BaseActivity { - - + @BindView(R2.id.rlv_car) + RecyclerView mRlvCar; private List mCarDatas; + private List mDatas; + private GoodsCarAdapter mAdapter; @Override protected int setLayoutId() { @@ -34,6 +44,10 @@ public class ShopCarActivity extends BaseActivity { public void initData() { ButterKnife.bind(this); mTvBaseTitle.setText("购物车"); + mDatas = new ArrayList<>(); + mAdapter = new GoodsCarAdapter(mActivity, mDatas); + mRlvCar.setLayoutManager(new LinearLayoutManager(mActivity)); + mRlvCar.setAdapter(mAdapter); parserShopCar(); } @@ -46,7 +60,7 @@ public class ShopCarActivity extends BaseActivity { Type type = new TypeToken>() { }.getType(); mCarDatas = gson.fromJson(shopCar, type); - refreshView(STATE_LOAD_SUCCESS); + parserDatas(); } else { refreshView(STATE_LOAD_EMPTY); mTvErrorHint.setText("购物车暂无数据"); @@ -55,4 +69,26 @@ public class ShopCarActivity extends BaseActivity { e.printStackTrace(); } } + + /** + * 构建数据 + */ + private void parserDatas() { + mDatas = new ArrayList<>(); + for (int i = 0; i < mCarDatas.size(); i++) { + ShopGoodsDetailBean bean = mCarDatas.get(i); + CustomCarBean b = new CustomCarBean(); + b.setShopId(bean.getShopId()); + b.setShopName(bean.getShopName()); + b.setGoods(new ArrayList<>()); + for (int j = 0; j < mCarDatas.size(); j++) { + if (bean.getShopId().equals(mCarDatas.get(j).getShopId())) { + b.getGoods().add(mCarDatas.get(j)); + } + } + mDatas.add(b); + } + mAdapter.setData(mDatas); + refreshView(STATE_LOAD_SUCCESS); + } } \ No newline at end of file diff --git a/moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/CarGoodsAdapter.java b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/CarGoodsAdapter.java new file mode 100644 index 0000000..d0b0758 --- /dev/null +++ b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/CarGoodsAdapter.java @@ -0,0 +1,64 @@ +package com.tenlionsoft.moduleshop.adapter; + +import android.content.Context; +import android.text.Html; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.RequestOptions; +import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi; +import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter; +import com.sucstepsoft.cm_utils.core.widget.views.AddOrDelView; +import com.tengshisoft.moduleshop.R; +import com.tenlionsoft.moduleshop.beans.ShopGoodsDetailBean; +import com.tenlionsoft.moduleshop.holder.CarGoodsHolder; + +import java.util.List; + +/** + * 购物车中商品适配器 + */ +public class CarGoodsAdapter extends BaseRecyclerAdapter { + + public CarGoodsAdapter(Context ctx, List list) { + super(ctx, list); + } + + @Override + public CarGoodsHolder createHolder(ViewGroup parent, int viewType) { + View view = LayoutInflater.from(mContext).inflate(R.layout.item_car_goods, parent, false); + return new CarGoodsHolder(view); + } + + @Override + public void bindHolder(CarGoodsHolder h, int i) { + ShopGoodsDetailBean bean = mData.get(i); + h.mTvName.setText(Html.fromHtml(bean.getGoodsName())); + Glide.with(mContext) + .load(BaseUrlApi.BASE_SHOP_IMG_URL + bean.getGoodsIcon()) + .apply(new RequestOptions() + .placeholder(R.drawable.ic_img_default) + .error(R.drawable.ic_img_default)) + .into(h.mIvIcon); + h.mTvPrice.setText("¥ " + bean.getGoodsPrice()); + h.mTvSales.setText("销量:" + bean.getGoodsSalesVolume() + ""); + h.mTvFreight.setText("1".equals(bean.getGoodsNotFreight()) ? "不包邮" : "包邮"); + h.mTvEvaluate.setText("评分:" + bean.getGoodStar() + ""); + h.mAodView.setNumber(bean.getCarAmount()); + h.mAodView.setOnAddDelClickListener(new AddOrDelView.OnAddDelClickListener() { + @Override + public void onAddClick(View v) { + bean.setCarAmount(bean.getCarAmount() + 1); + notifyDataSetChanged(); + } + + @Override + public void onDelClick(View v) { + bean.setCarAmount(bean.getCarAmount() - 1); + notifyDataSetChanged(); + } + }); + } +} diff --git a/moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/GoodsCarAdapter.java b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/GoodsCarAdapter.java new file mode 100644 index 0000000..c0fae06 --- /dev/null +++ b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/GoodsCarAdapter.java @@ -0,0 +1,40 @@ +package com.tenlionsoft.moduleshop.adapter; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.recyclerview.widget.LinearLayoutManager; + +import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter; +import com.tengshisoft.moduleshop.R; +import com.tenlionsoft.moduleshop.beans.CustomCarBean; +import com.tenlionsoft.moduleshop.holder.GoodsCarHolder; + +import java.util.List; + +/** + * 购物车适配器 + */ +public class GoodsCarAdapter extends BaseRecyclerAdapter { + + public GoodsCarAdapter(Context ctx, List list) { + super(ctx, list); + } + + @Override + public GoodsCarHolder createHolder(ViewGroup parent, int viewType) { + View view = LayoutInflater.from(mContext).inflate(R.layout.item_goods_car, parent, false); + return new GoodsCarHolder(view); + } + + @Override + public void bindHolder(GoodsCarHolder h, int i) { + CustomCarBean bean = mData.get(i); + h.mTvShopName.setText(bean.getShopName()); + CarGoodsAdapter adapter = new CarGoodsAdapter(mContext, bean.getGoods()); + h.mRlvGoods.setLayoutManager(new LinearLayoutManager(mContext)); + h.mRlvGoods.setAdapter(adapter); + } +} diff --git a/moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/ShopSortAdapter.java b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/ShopSortAdapter.java index 9f3e451..3ff2ca6 100644 --- a/moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/ShopSortAdapter.java +++ b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/adapter/ShopSortAdapter.java @@ -5,6 +5,9 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.RequestOptions; +import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi; import com.sucstepsoft.cm_utils.core.widget.base.BaseRecyclerAdapter; import com.tengshisoft.moduleshop.R; import com.tenlionsoft.moduleshop.beans.ShopSortListBean; @@ -28,5 +31,11 @@ public class ShopSortAdapter extends BaseRecyclerAdapter goods; + + public String getShopName() { + return shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId; + } + + public List getGoods() { + return goods; + } + + public void setGoods(List goods) { + this.goods = goods; + } +} diff --git a/moduleshop/src/main/java/com/tenlionsoft/moduleshop/beans/ShopGoodsDetailBean.java b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/beans/ShopGoodsDetailBean.java index 2cf2b54..137dbc0 100644 --- a/moduleshop/src/main/java/com/tenlionsoft/moduleshop/beans/ShopGoodsDetailBean.java +++ b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/beans/ShopGoodsDetailBean.java @@ -33,8 +33,18 @@ public class ShopGoodsDetailBean { private String shopId; private String shopName; private int userEvaluate; - private int carAmount; + //自定义 购物车中数量与商品单价 + private int carAmount; + private String goodsPrice; + + public String getGoodsPrice() { + return goodsPrice; + } + + public void setGoodsPrice(String goodsPrice) { + this.goodsPrice = goodsPrice; + } public int getCarAmount() { return carAmount; diff --git a/moduleshop/src/main/java/com/tenlionsoft/moduleshop/holder/CarGoodsHolder.java b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/holder/CarGoodsHolder.java new file mode 100644 index 0000000..db36c00 --- /dev/null +++ b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/holder/CarGoodsHolder.java @@ -0,0 +1,35 @@ +package com.tenlionsoft.moduleshop.holder; + +import android.view.View; +import android.widget.ImageView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.sucstepsoft.cm_utils.core.widget.views.AddOrDelView; +import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView; +import com.tengshisoft.moduleshop.R; + +/** + * 购物车中商品 + */ +public class CarGoodsHolder extends RecyclerView.ViewHolder { + public ImageView mIvIcon; + public TypeFaceTextView mTvName; + public TypeFaceTextView mTvPrice; + public TypeFaceTextView mTvSales; + public TypeFaceTextView mTvEvaluate; + public TypeFaceTextView mTvFreight; + public AddOrDelView mAodView; + + public CarGoodsHolder(@NonNull View itemView) { + super(itemView); + mIvIcon = itemView.findViewById(R.id.iv_goods_icon); + mTvName = itemView.findViewById(R.id.tv_goods_name); + mTvPrice = itemView.findViewById(R.id.tv_goods_price); + mTvSales = itemView.findViewById(R.id.tv_goods_sales); + mTvEvaluate = itemView.findViewById(R.id.tv_goods_evaluate); + mTvFreight = itemView.findViewById(R.id.tv_goods_freight); + mAodView = itemView.findViewById(R.id.aod_control); + } +} diff --git a/moduleshop/src/main/java/com/tenlionsoft/moduleshop/holder/GoodsCarHolder.java b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/holder/GoodsCarHolder.java new file mode 100644 index 0000000..ad8724d --- /dev/null +++ b/moduleshop/src/main/java/com/tenlionsoft/moduleshop/holder/GoodsCarHolder.java @@ -0,0 +1,24 @@ +package com.tenlionsoft.moduleshop.holder; + +import android.view.View; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.sucstepsoft.cm_utils.core.widget.views.TypeFaceTextView; +import com.tengshisoft.moduleshop.R; + +/** + * 购物车列表 + */ +public class GoodsCarHolder extends RecyclerView.ViewHolder { + + public TypeFaceTextView mTvShopName; + public RecyclerView mRlvGoods; + + public GoodsCarHolder(@NonNull View itemView) { + super(itemView); + mTvShopName = itemView.findViewById(R.id.tv_shop_name); + mRlvGoods = itemView.findViewById(R.id.rlv_goods); + } +} diff --git a/moduleshop/src/main/res/layout/item_car_goods.xml b/moduleshop/src/main/res/layout/item_car_goods.xml new file mode 100644 index 0000000..0992fd7 --- /dev/null +++ b/moduleshop/src/main/res/layout/item_car_goods.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/moduleshop/src/main/res/layout/item_goods_car.xml b/moduleshop/src/main/res/layout/item_goods_car.xml new file mode 100644 index 0000000..8465bc4 --- /dev/null +++ b/moduleshop/src/main/res/layout/item_goods_car.xml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/moduleshop/src/main/res/layout/item_second_shop_sort.xml b/moduleshop/src/main/res/layout/item_second_shop_sort.xml index c16107d..9bbc4c6 100644 --- a/moduleshop/src/main/res/layout/item_second_shop_sort.xml +++ b/moduleshop/src/main/res/layout/item_second_shop_sort.xml @@ -40,6 +40,8 @@ android:layout_marginLeft="10dp" android:layout_marginTop="5dp" android:layout_marginRight="10dp" + android:layout_marginBottom="10dp" + app:cardCornerRadius="5dp" app:cardElevation="1dp">