购物车luoji代码
来源:互联网 发布:sql培训学校 编辑:程序博客网 时间:2024/06/06 04:34
适配器
/** * 改变全选的状态 * * @param flag */ private void changeAllCbState(boolean flag) { MessageEvent messageEvent = new MessageEvent(); messageEvent.setChecked(flag); EventBus.getDefault().post(messageEvent); } /** * 改变一级列表checkbox状态 * * @param groupPosition */ private void changGroupCbState(int groupPosition, boolean flag) {// GoosBean.DataBean dataBean = groupList.get(groupPosition); MessageBean.DataBean dataBean = groupList.get(groupPosition); dataBean.setChecked(flag); } /** * 改变二级列表checkbox状态 * * @param groupPosition * @param flag */ private void changeChildCbState(int groupPosition, boolean flag) { List<MessageBean.DataBean.ListBean> datasBeen = childList.get(groupPosition); for (int i = 0; i < datasBeen.size(); i++) { MessageBean.DataBean.ListBean datasBean = datasBeen.get(i); datasBean.setChecked(flag); } } /** * 判断一级列表是否全部选中 * * @return */ private boolean isAllGroupCbSelected() { for (int i = 0; i < groupList.size(); i++) { MessageBean.DataBean dataBean = groupList.get(i); if (!dataBean.isChecked()) { return false; } } return true; } /** * 判断二级列表是否全部选中 * * @param groupPosition * @return */ private boolean isAllChildCbSelected(int groupPosition) { List<MessageBean.DataBean.ListBean> datasBeen = childList.get(groupPosition); for (int i = 0; i < datasBeen.size(); i++) { MessageBean.DataBean.ListBean datasBean = datasBeen.get(i); if (!datasBean.isChecked()) { return false; } } return true; } /** * 计算列表中,选中的钱和数量 */ private PriceAndCountEvent compute() { int count = 0; int price = 0; for (int i = 0; i < childList.size(); i++) { List<MessageBean.DataBean.ListBean> datasBeen = childList.get(i); for (int j = 0; j < datasBeen.size(); j++) { MessageBean.DataBean.ListBean datasBean = datasBeen.get(j); if (datasBean.isChecked()) { price += datasBean.getNum() * datasBean.getPrice(); count += datasBean.getNum(); } } } PriceAndCountEvent priceAndCountEvent = new PriceAndCountEvent(); priceAndCountEvent.setCount(count); priceAndCountEvent.setPrice(price); return priceAndCountEvent; } /** * 设置全选、反选 * * @param flag */ public void changeAllListCbState(boolean flag) { for (int i = 0; i < groupList.size(); i++) { changGroupCbState(i, flag); changeChildCbState(i, flag); } EventBus.getDefault().post(compute()); notifyDataSetChanged(); } class GroupViewClick implements View.OnClickListener { private int groupPosition; private Button edtor; private MessageBean.DataBean dataBean; public GroupViewClick(int groupPosition, Button edtor, MessageBean.DataBean dataBean) { this.groupPosition = groupPosition; this.edtor = edtor; this.dataBean = dataBean; } @Override public void onClick(View v) { int groupId = v.getId(); if (groupId == edtor.getId()) { if (dataBean.isEdtor()) { dataBean.setEdtor(false); } else { dataBean.setEdtor(true); } notifyDataSetChanged(); } } }商家final GroupViewHolder holder; if (view == null) { holder = new GroupViewHolder(); view = view.inflate(context, R.layout.item_shopcart_group, null); holder.determineChekbox = view.findViewById(R.id.determine_chekbox); holder.tvSourceName = view.findViewById(R.id.tv_source_name); holder.tvStoreEdtor = view.findViewById(R.id.tv_store_edtor); view.setTag(holder); } else { holder = (GroupViewHolder) view.getTag(); } final MessageBean.DataBean dataBean = groupList.get(i); holder.determineChekbox.setChecked(dataBean.isChecked());// holder.tv_number.setText(dataBean.getTitle()); holder.tvSourceName.setText(dataBean.getSellerName()); //一级checkbox holder.determineChekbox.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dataBean.setChecked(holder.determineChekbox.isChecked()); changeChildCbState(i, holder.determineChekbox.isChecked()); EventBus.getDefault().post(compute()); changeAllCbState(isAllGroupCbSelected()); notifyDataSetChanged(); } }); if (dataBean.isEdtor()) { holder.tvStoreEdtor.setText("完成"); } else { holder.tvStoreEdtor.setText("编辑"); } holder.tvStoreEdtor.setOnClickListener(new GroupViewClick(i, holder.tvStoreEdtor,dataBean)); notifyDataSetChanged(); return view;商品final ChildViewHolder holder; if (view == null) { holder = new ChildViewHolder(); view = view.inflate(context,R.layout.item_shopcart_product, null); holder.checkBox = view.findViewById(R.id.check_box); holder.tvIntro = view.findViewById(R.id.tv_intro);// holder.tv_content = view.findViewById(R.id.tv_content);// holder.tv_time = view.findViewById(R.id.tv_time); holder.ivAdapterListPic = view.findViewById(R.id.iv_adapter_list_pic); holder.tvPrice = view.findViewById(R.id.tv_price); holder.tvGoodsDelete = view.findViewById(R.id.tv_goods_delete); holder.btAdd = view.findViewById(R.id.bt_add); holder.btReduce = view.findViewById(R.id.bt_reduce); holder.etNum = view.findViewById(R.id.et_num); holder.llEdtor = view.findViewById(R.id.ll_edtor); holder.rlNoEdtor = view.findViewById(R.id.rl_no_edtor); holder.stub = view.findViewById(R.id.stub); holder.tvBuyNum=view.findViewById(R.id.tv_buy_num); view.setTag(holder); } else { holder = (ChildViewHolder) view.getTag(); } if (groupList.get(i).isEdtor() == true) { holder.llEdtor.setVisibility(View.VISIBLE); holder.rlNoEdtor.setVisibility(View.GONE); } else { holder.llEdtor.setVisibility(View.GONE); holder.rlNoEdtor.setVisibility(View.VISIBLE); } final MessageBean.DataBean.ListBean datasBean = childList.get(i).get(i1); if(b&&getChild(i,i1)!=null){ holder.stub.setVisibility(View.VISIBLE); // TextView tv= (TextView) cholder.stub.findViewById(R.id.txtFooter);//这里用来动态显示店铺满99元包邮文字内容 }else{ holder.stub.setVisibility(View.GONE); } if (childList!=null){ holder.checkBox.setChecked(datasBean.isChecked());// holder.tv_tel.setText(datasBean.getType_name()); holder.tvIntro.setText(datasBean.getTitle());// holder.tv_content.setText(datasBean.getMsg());// holder.tv_time.setText(datasBean.getAdd_time()); holder.tvPrice.setText("¥"+datasBean.getPrice() ); holder.etNum.setText(datasBean.getNum() + ""); String images = datasBean.getImages().trim(); String[] split = images.split("[|]"); holder.tvBuyNum.setText("X"+childList.get(i).get(i1).getNum()); Uri uri=Uri.parse(split[0]); holder.ivAdapterListPic.setImageURI(uri);// Glide.with(context).load(split[0]).into(holder.ivAdapterListPic); //二级checkbox holder.checkBox.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //设置该条目对象里的checked属性值 datasBean.setChecked(holder.checkBox.isChecked()); PriceAndCountEvent priceAndCountEvent = compute(); EventBus.getDefault().post(priceAndCountEvent); if (holder.checkBox.isChecked()) { //当前checkbox是选中状态 if (isAllChildCbSelected(i)) { changGroupCbState(i, true); changeAllCbState(isAllGroupCbSelected()); } } else { changGroupCbState(i, false); changeAllCbState(isAllGroupCbSelected()); } notifyDataSetChanged(); } }); //加号 holder.btAdd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { num = datasBean.getNum(); holder.etNum.setText(++num + ""); datasBean.setNum(num); if (holder.checkBox.isChecked()) { EventBus.getDefault().post(compute()); } } }); //减号 holder.btReduce.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { int num = datasBean.getNum(); if (num == 1) { return; } holder.etNum.setText(--num + ""); datasBean.setNum(num); if (holder.checkBox.isChecked()) { EventBus.getDefault().post(compute()); } } }); //删除 holder.tvGoodsDelete.setOnClickListener(new View.OnClickListener() { private AlertDialog dialog; @Override public void onClick(View v) { final List<MessageBean.DataBean.ListBean> datasBeen = childList.get(i); AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle("提示"); builder.setMessage("确认是否删除?"); builder.setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int ii) { MessageBean.DataBean.ListBean remove = datasBeen.remove(i1); if (datasBeen.size() == 0) { childList.remove(i); groupList.remove(i);// Retrofit build = new Retrofit.Builder()// .addConverterFactory(GsonConverterFactory.create())// .baseUrl("http://120.27.23.105/")// .build();// ShangchuJieko jieko = build.create(ShangchuJieko.class);// int a=i;// int b=i1;// Log.d("sasa","删除"+childList.get(i).get(i1).getPid());// Call<ShangchuBean> data = jieko.getData(2983, childList.get(a).get(b).getPid());//// data.enqueue(new Callback<ShangchuBean>() {// @Override// public void onResponse(Call<ShangchuBean> call, Response<ShangchuBean> response) {//// }//// @Override// public void onFailure(Call<ShangchuBean> call, Throwable t) {//// }// }); } EventBus.getDefault().post(compute()); notifyDataSetChanged(); } }); builder.setNegativeButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { dialog.dismiss(); } }); dialog = builder.create(); dialog.show(); } }); } return view;
activity页面
注册even接收EventBus.getDefault().register(this);
控件private ExpandableListView exlistView; private LinearLayout llShar; private LinearLayout llInfo; private TextView subtitle; private TextView tvTotalPrice; private CheckBox allChekbox; private TextView tvDelete; private TextView tvGoToPay; private TextView tvShare; private TextView tvSave; private double totalPrice = 0.00;// 购买的商品总价 private int totalCount = 0;// 购买的商品总数量 private ShopcartAdapter selva; private NewsPresenter presenter; private List<MessageBean.DataBean> groupList = new ArrayList<>(); private List<List<MessageBean.DataBean.ListBean>> childList = new ArrayList<>();private int flag = 0;
接收even@Subscribe public void onMessageEvent(MessageEvent event) { allChekbox.setChecked(event.isChecked()); } @Subscribe public void onMessageEvent(PriceAndCountEvent event) { tvGoToPay.setText("结算(" + event.getCount() + ")"); tvTotalPrice.setText("¥"+event.getPrice() ); totalCount = event.getCount(); totalPrice = event.getPrice(); } private void clearCart() { subtitle.setText("编辑"); tvTotalPrice.setText("¥:0.00"); }
得到数据MessageBean bean= (MessageBean) o; List<MessageBean.DataBean> data = bean.getData(); for (int i = 0; i < data.size(); i++) { if(data ==null|| data.get(i).getList().size()==0){ data.remove(i); } List<MessageBean.DataBean.ListBean> datas =data.get(i).getList(); childList.add(datas); } groupList.addAll(data); selva.notifyDataSetChanged(); exlistView.setGroupIndicator(null); for (int i=0;i<groupList.size();i++){ exlistView.expandGroup(i); }
销毁activity@Override protected void onDestroy() { super.onDestroy(); selva = null; groupList.clear(); totalPrice = 0; totalCount = 0; childList.clear(); EventBus.getDefault().unregister(this); if (presenter != null) { presenter.xiaohui(); } }
点击事件@Override public void onClick(View view) { AlertDialog alert; switch (view.getId()) { case R.id.all_chekbox: selva.changeAllListCbState(allChekbox.isChecked()); break; case R.id.tv_delete: if (totalCount == 0) { Toast.makeText(this, "请选择要移除的商品", Toast.LENGTH_LONG).show(); return; } alert = new AlertDialog.Builder(this).create(); alert.setTitle("操作提示"); alert.setMessage("您确定要将这些商品从购物车中移除吗?"); alert.setButton(DialogInterface.BUTTON_NEGATIVE, "取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { return; } }); alert.setButton(DialogInterface.BUTTON_POSITIVE, "确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (allChekbox.isChecked()){ groupList.clear(); clearCart(); selva.notifyDataSetChanged(); } } }); alert.show(); break; case R.id.tv_go_to_pay: if (totalCount == 0) { Toast.makeText(this, "请选择要支付的商品", Toast.LENGTH_LONG).show(); return; } alert = new AlertDialog.Builder(this).create(); alert.setTitle("操作提示"); alert.setMessage("总计:\n" + totalCount + "种商品\n" + totalPrice + "元"); alert.setButton(DialogInterface.BUTTON_NEGATIVE, "取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { return; } }); alert.setButton(DialogInterface.BUTTON_POSITIVE, "确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { return; } }); alert.show(); break; case R.id.subtitle: if (flag == 0) { llInfo.setVisibility(View.GONE); tvGoToPay.setVisibility(View.GONE); llShar.setVisibility(View.VISIBLE); subtitle.setText("完成"); } else if (flag == 1) { llInfo.setVisibility(View.VISIBLE); tvGoToPay.setVisibility(View.VISIBLE); llShar.setVisibility(View.GONE); subtitle.setText("编辑"); } flag = (flag + 1) % 2;//其余得到循环执行上面2个不同的功能 break; case R.id.tv_share: if (totalCount == 0) { Toast.makeText(this, "请选择要分享的商品", Toast.LENGTH_LONG).show(); return; } Toast.makeText(this, "分享成功", Toast.LENGTH_SHORT).show(); break; case R.id.tv_save: if (totalCount == 0) { Toast.makeText(this, "请选择要保存的商品", Toast.LENGTH_LONG).show(); return; } Toast.makeText(this, "保存成功", Toast.LENGTH_SHORT).show(); break; } }messageeven类public class MessageEvent { private boolean checked; public boolean isChecked() { return checked; } public void setChecked(boolean checked) { this.checked = checked; }}价格even类public class PriceAndCountEvent { private int price; private int count; public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } public int getCount() { return count; } public void setCount(int count) { this.count = count; }}activityxml<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/gwc_re1" android:layout_alignParentTop="true" android:layout_alignParentStart="true"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="购物车" android:id="@+id/gwctext" android:paddingBottom="5dp" android:textSize="25dp" android:layout_centerInParent="true"/> <TextView android:id="@+id/subtitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_marginRight="40dp" android:gravity="center" android:minHeight="48dp" android:text="编辑" android:textColor="#1a1a1a" android:textSize="14sp" android:visibility="visible" /> </RelativeLayout> <TextView android:layout_below="@+id/gwc_re1" android:layout_width="match_parent" android:layout_height="1dp" android:id="@+id/gwc_text1" android:background="#ccc"/> <RelativeLayout android:layout_below="@+id/gwc_text1" android:layout_width="match_parent" android:layout_height="match_parent"> <include android:id="@+id/layout_cart_empty" android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/cart_empty" android:visibility="gone"/> <ExpandableListView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/exListView"></ExpandableListView> </RelativeLayout> <LinearLayout android:layout_alignParentBottom="true" android:layout_width="match_parent" android:layout_height="50dp" android:background="#fff" android:id="@+id/gwc_xia" android:gravity="center_vertical" android:orientation="horizontal" > <CheckBox android:id="@+id/all_chekbox" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:layout_gravity="center_vertical" android:layout_marginRight="4dp" android:button="@drawable/check_box_bg" android:checkMark="?android:attr/listChoiceIndicatorMultiple" android:gravity="center" android:minHeight="64dp" android:layout_marginLeft="10dp" android:text="全选" android:textSize="15dp" android:textAppearance="?android:attr/textAppearanceLarge" /> <LinearLayout android:id="@+id/ll_info" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="4" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_marginRight="20dp" android:layout_weight="1" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="right" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:text="合计:" android:textSize="18sp" android:textStyle="bold" /> <TextView android:id="@+id/tv_total_price" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="¥0.00" android:textColor="@color/orangered" android:textSize="16sp" android:textStyle="bold" /> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="不含运费" android:gravity="right" android:textColor="@color/gray" android:textSize="16sp" android:textStyle="bold" /> </LinearLayout> <TextView android:id="@+id/tv_go_to_pay" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="3" android:background="@color/orange" android:clickable="true" android:gravity="center" android:text="结算(0)" android:textColor="#FAFAFA" /> </LinearLayout> <LinearLayout android:id="@+id/ll_shar" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="4" android:orientation="horizontal" android:visibility="gone" > <TextView android:id="@+id/tv_share" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:layout_weight="1" android:layout_marginLeft="5dp" android:text="分享宝贝" android:textColor="@color/white" android:background="@color/orange" android:textSize="16sp" android:layout_marginRight="5dp" android:textStyle="bold" /> <TextView android:id="@+id/tv_save" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center" android:text="移到收藏夹" android:background="@color/orange" android:textColor="@color/white" android:layout_marginRight="5dp" android:textSize="16sp" android:textStyle="bold" /> <TextView android:id="@+id/tv_delete" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:background="@color/crimson" android:clickable="true" android:gravity="center" android:text="删除" android:textColor="#FAFAFA" /> </LinearLayout> </LinearLayout>
child_footer xml<TextView android:id="@+id/txtFooter" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#345746" android:textColor="#ffffff" android:text="店铺满99元包邮"/>item_shopcart_group xml<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/white" > <CheckBox android:id="@+id/determine_chekbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="10dp" android:layout_marginRight="4dp" android:button="@drawable/check_box_bg" android:checkMark="?android:attr/listChoiceIndicatorMultiple" android:gravity="center" android:minHeight="38dp" android:minWidth="32dp" android:textAppearance="?android:attr/textAppearanceLarge" android:visibility="visible" /> <TextView android:id="@+id/tv_source_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginBottom="10dp" android:layout_marginTop="10dp" android:layout_toRightOf="@id/determine_chekbox" android:background="@android:color/white" android:drawableLeft="@drawable/shop_ico" android:drawablePadding="10dp" android:text="第八号当铺" android:textColor="@color/grey_color2" android:textSize="@dimen/txt_14" /> <Button android:id="@+id/tv_store_edtor" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="4dp" android:background="@null" android:text="编辑"/> </RelativeLayout>
item_shopcart_product xml<View android:layout_width="match_parent" android:layout_height="1dp" android:background="#CCCCCC" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/page_backgroup" android:orientation="horizontal"> <CheckBox android:id="@+id/check_box" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginLeft="10dp" android:layout_marginRight="4dp" android:button="@drawable/check_box_bg" android:checkMark="?android:attr/listChoiceIndicatorMultiple" android:gravity="center" android:minHeight="64dp" android:minWidth="32dp" android:textAppearance="?android:attr/textAppearanceLarge" android:visibility="visible" /> <com.facebook.drawee.view.SimpleDraweeView android:id="@+id/iv_adapter_list_pic" android:layout_width="85dp" android:layout_height="85dp" android:layout_marginBottom="15dp" android:layout_marginTop="13dp" /> <RelativeLayout android:id="@+id/rl_no_edtor" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginLeft="13dp"> <TextView android:id="@+id/tv_intro" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="10dp" android:layout_marginTop="20dp" android:ellipsize="end" android:maxLines="2" android:singleLine="true" android:text="第八号店铺" android:textColor="@color/grey_color1" android:textSize="@dimen/txt_12" /> <TextView android:id="@+id/tv_color_size" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_centerVertical="true" android:layout_marginTop="5dp" android:text="颜色:黑色;尺码:29" android:textColor="@color/gray" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_marginBottom="20dp" android:orientation="horizontal"> <TextView android:id="@+id/tv_price" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:singleLine="true" android:text="¥ 308.00" android:textColor="@color/orange_color" android:textSize="@dimen/txt_14" android:textStyle="bold" /> <TextView android:id="@+id/tv_discount_price" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="10dp" android:layout_toRightOf="@+id/tv_price" android:text="" android:textColor="@color/gray" android:textSize="@dimen/txt_10" /> <TextView android:id="@+id/tv_buy_num" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="20dp" android:text="X 1" android:textColor="@color/gray" android:textSize="@dimen/txt_10" /> </RelativeLayout> </RelativeLayout> <LinearLayout android:id="@+id/ll_edtor" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="13dp" android:orientation="horizontal" android:visibility="gone"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical"> <RelativeLayout android:id="@+id/ll_change_num" android:layout_width="match_parent" android:layout_height="26dip" android:layout_marginTop="20dp" android:gravity="center" android:orientation="horizontal"> <Button android:id="@+id/bt_reduce" android:layout_width="26dip" android:layout_height="26dip" android:background="@drawable/cart_minus_selector" android:clickable="false" android:focusableInTouchMode="false" /> <EditText android:id="@+id/et_num" style="@style/textStyle.Normal.black" android:layout_width="40dip" android:layout_height="26dip" android:layout_toRightOf="@id/bt_reduce" android:background="@drawable/icon_cart_count" android:focusable="true" android:focusableInTouchMode="true" android:gravity="center" android:inputType="number" android:text="1" /> <Button android:id="@+id/bt_add" android:layout_width="26dip" android:layout_height="26dip" android:layout_toRightOf="@id/et_num" android:background="@drawable/cart_plus_selector" android:focusable="false" android:focusableInTouchMode="false" /> </RelativeLayout> <TextView android:id="@+id/tv_colorsize" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="left" android:layout_marginTop="10dp" android:text="颜色:黑色;尺码:29" android:textColor="@color/gray" /> </LinearLayout> <TextView android:id="@+id/tv_goods_delete" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:layout_weight="3" android:background="@color/orange" android:gravity="center" android:text="删除" android:textColor="@color/white" /> </LinearLayout> </LinearLayout> <ViewStub android:id="@+id/stub" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" android:layout="@layout/child_footer" />
阅读全文
1 0
- 购物车luoji代码
- 更新购物车代码
- 购物车详细代码
- 购物车代码
- 购物车JSP代码
- 购物车代码
- 购物车代码分析
- 购物车代码
- 一个购物车代码
- 购物车代码
- 购物车的代码
- 购物车关键代码
- 购物车代码
- 购物车的代码
- 购物车的代码
- 购物车的代码
- 购物车JSP代码
- 购物车js代码
- Linux(ubuntu)下tomcat的下载安装以及mysql的下载和安装
- 轮播图
- RecyclerView线性布局和网格布局的切换
- 掘金最热文章收藏评论分析代码实现(mongodb+express+vue)
- Zookeeper的集群配置和Java测试程序
- 购物车luoji代码
- 原简书博客不再更新,原代码也不再转移
- Okhttp的Get_Poast请求封装
- admob广告代码参考 安卓 banner广告
- 【配置】deploy.sh、runRemoteCmd.sh脚本工具的配置使用
- Js New一个函数和直接调用的区别
- 想在硅谷近距离接触蚂蚁金服的CTO和一众技术高管?这个机会一定不能错过!
- 添加购物车
- 我还是小瞧了三胖!“WannaCry“勒索病毒竟然是朝鲜人干的!