├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── vpcsd │ │ │ └── shopcartlogic │ │ │ ├── MainActivity.java │ │ │ ├── ShopCartAdapter.java │ │ │ └── bean │ │ │ └── ShopCartBean.java │ └── res │ │ ├── drawable-xhdpi │ │ ├── shopcart_activity.png │ │ ├── shopcart_add_btn.xml │ │ ├── shopcart_add_red.png │ │ ├── shopcart_allbuy.png │ │ ├── shopcart_delete.png │ │ ├── shopcart_dialog_finish.png │ │ ├── shopcart_entershop.png │ │ ├── shopcart_error_icon.png │ │ ├── shopcart_instructions.png │ │ ├── shopcart_minus_grey.png │ │ ├── shopcart_minus_red.png │ │ ├── shopcart_selected.png │ │ ├── shopcart_shop.png │ │ ├── shopcart_shopdetail.png │ │ ├── shopcart_shopsize.png │ │ └── shopcart_unselected.png │ │ ├── drawable │ │ ├── login_box.xml │ │ └── login_btn.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ └── item_shopcart.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── example │ └── vpcsd │ └── shopcartlogic │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── hs_err_pid1112.log ├── replay_pid1112.log └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 24 5 | buildToolsVersion "24.0.1" 6 | defaultConfig { 7 | applicationId "com.example.vpcsd.shopcartlogic" 8 | minSdkVersion 21 9 | targetSdkVersion 24 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:24.2.1' 28 | testCompile 'junit:junit:4.12' 29 | 30 | //ui 31 | compile 'com.android.support:design:24.2.1' 32 | compile 'com.github.bumptech.glide:glide:3.7.0' 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in F:\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vpcsd/shopcartlogic/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.vpcsd.shopcartlogic; 2 | 3 | import android.graphics.drawable.Drawable; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.support.v7.widget.LinearLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.support.v7.widget.Toolbar; 9 | import android.view.View; 10 | import android.widget.LinearLayout; 11 | import android.widget.RelativeLayout; 12 | import android.widget.TextView; 13 | 14 | import com.example.vpcsd.shopcartlogic.bean.ShopCartBean; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | public class MainActivity extends AppCompatActivity { 20 | 21 | private TextView tvShopCartSubmit,tvShopCartSelect,tvShopCartTotalNum; 22 | private View mEmtryView; 23 | 24 | private RecyclerView rlvShopCart,rlvHotProducts; 25 | private ShopCartAdapter mShopCartAdapter; 26 | private LinearLayout llPay; 27 | private RelativeLayout rlHaveProduct; 28 | private List mAllOrderList = new ArrayList<>(); 29 | private ArrayList mGoPayList = new ArrayList<>(); 30 | private List mHotProductsList = new ArrayList<>(); 31 | private TextView tvShopCartTotalPrice; 32 | private int mCount,mPosition; 33 | private float mTotalPrice1; 34 | private boolean mSelect; 35 | 36 | @Override 37 | protected void onCreate(Bundle savedInstanceState) { 38 | super.onCreate(savedInstanceState); 39 | setContentView(R.layout.activity_main); 40 | 41 | tvShopCartSelect = (TextView) findViewById(R.id.tv_shopcart_addselect); 42 | tvShopCartTotalPrice = (TextView) findViewById(R.id.tv_shopcart_totalprice); 43 | tvShopCartTotalNum = (TextView) findViewById(R.id.tv_shopcart_totalnum); 44 | 45 | rlHaveProduct = (RelativeLayout) findViewById(R.id.rl_shopcart_have); 46 | rlvShopCart = (RecyclerView) findViewById(R.id.rlv_shopcart); 47 | mEmtryView = (View) findViewById(R.id.emtryview); 48 | mEmtryView.setVisibility(View.GONE); 49 | llPay = (LinearLayout) findViewById(R.id.ll_pay); 50 | RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT,RelativeLayout.LayoutParams.WRAP_CONTENT); 51 | lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM,RelativeLayout.TRUE); 52 | llPay.setLayoutParams(lp); 53 | 54 | tvShopCartSubmit = (TextView) findViewById(R.id.tv_shopcart_submit); 55 | 56 | rlvShopCart.setLayoutManager(new LinearLayoutManager(this)); 57 | mShopCartAdapter = new ShopCartAdapter(this,mAllOrderList); 58 | rlvShopCart.setAdapter(mShopCartAdapter); 59 | //删除商品接口 60 | mShopCartAdapter.setOnDeleteClickListener(new ShopCartAdapter.OnDeleteClickListener() { 61 | @Override 62 | public void onDeleteClick(View view, int position,int cartid) { 63 | mShopCartAdapter.notifyDataSetChanged(); 64 | } 65 | }); 66 | //修改数量接口 67 | mShopCartAdapter.setOnEditClickListener(new ShopCartAdapter.OnEditClickListener() { 68 | @Override 69 | public void onEditClick(int position, int cartid, int count) { 70 | mCount = count; 71 | mPosition = position; 72 | } 73 | }); 74 | //实时监控全选按钮 75 | mShopCartAdapter.setResfreshListener(new ShopCartAdapter.OnResfreshListener() { 76 | @Override 77 | public void onResfresh( boolean isSelect) { 78 | mSelect = isSelect; 79 | if(isSelect){ 80 | Drawable left = getResources().getDrawable(R.drawable.shopcart_selected); 81 | tvShopCartSelect.setCompoundDrawablesWithIntrinsicBounds(left,null,null,null); 82 | }else { 83 | Drawable left = getResources().getDrawable(R.drawable.shopcart_unselected); 84 | tvShopCartSelect.setCompoundDrawablesWithIntrinsicBounds(left,null,null,null); 85 | } 86 | float mTotalPrice = 0; 87 | int mTotalNum = 0; 88 | mTotalPrice1 = 0; 89 | mGoPayList.clear(); 90 | for(int i = 0;i < mAllOrderList.size(); i++) 91 | if(mAllOrderList.get(i).getIsSelect()) { 92 | mTotalPrice += Float.parseFloat(mAllOrderList.get(i).getPrice()) * mAllOrderList.get(i).getCount(); 93 | mTotalNum += 1; 94 | mGoPayList.add(mAllOrderList.get(i)); 95 | } 96 | mTotalPrice1 = mTotalPrice; 97 | tvShopCartTotalPrice.setText("总价:" + mTotalPrice); 98 | tvShopCartTotalNum.setText("共" + mTotalNum + "件商品"); 99 | } 100 | }); 101 | 102 | //全选 103 | tvShopCartSelect.setOnClickListener(new View.OnClickListener() { 104 | @Override 105 | public void onClick(View v) { 106 | mSelect = !mSelect; 107 | if(mSelect){ 108 | Drawable left = getResources().getDrawable(R.drawable.shopcart_selected); 109 | tvShopCartSelect.setCompoundDrawablesWithIntrinsicBounds(left,null,null,null); 110 | for(int i = 0;i < mAllOrderList.size();i++){ 111 | mAllOrderList.get(i).setSelect(true); 112 | mAllOrderList.get(i).setShopSelect(true); 113 | } 114 | }else{ 115 | Drawable left = getResources().getDrawable(R.drawable.shopcart_unselected); 116 | tvShopCartSelect.setCompoundDrawablesWithIntrinsicBounds(left,null,null,null); 117 | for(int i = 0;i < mAllOrderList.size();i++){ 118 | mAllOrderList.get(i).setSelect(false); 119 | mAllOrderList.get(i).setShopSelect(false); 120 | } 121 | } 122 | mShopCartAdapter.notifyDataSetChanged(); 123 | 124 | } 125 | }); 126 | 127 | initData(); 128 | mShopCartAdapter.notifyDataSetChanged(); 129 | } 130 | 131 | private void initData(){ 132 | for(int i = 0;i < 2;i ++){ 133 | ShopCartBean.CartlistBean sb = new ShopCartBean.CartlistBean(); 134 | sb.setShopId(1); 135 | sb.setPrice("1.0"); 136 | sb.setDefaultPic("http://img2.3lian.com/2014/c7/25/d/40.jpg"); 137 | sb.setProductName("狼牙龙珠鼠标"); 138 | sb.setShopName("狼牙龙珠"); 139 | sb.setColor("蓝色"); 140 | sb.setCount(2); 141 | mAllOrderList.add(sb); 142 | } 143 | 144 | for(int i = 0;i < 2;i ++){ 145 | ShopCartBean.CartlistBean sb = new ShopCartBean.CartlistBean(); 146 | sb.setShopId(2); 147 | sb.setPrice("1.0"); 148 | sb.setDefaultPic("http://img2.3lian.com/2014/c7/25/d/40.jpg"); 149 | sb.setProductName("达尔优鼠标"); 150 | sb.setShopName("达尔优"); 151 | sb.setColor("绿色"); 152 | sb.setCount(2); 153 | mAllOrderList.add(sb); 154 | } 155 | isSelectFirst(mAllOrderList); 156 | } 157 | 158 | public static void isSelectFirst(List list){ 159 | if(list.size() > 0) { 160 | list.get(0).setIsFirst(1); 161 | for (int i = 1; i < list.size(); i++) { 162 | if (list.get(i).getShopId() == list.get(i - 1).getShopId()) { 163 | list.get(i).setIsFirst(2); 164 | } else { 165 | list.get(i).setIsFirst(1); 166 | } 167 | } 168 | } 169 | 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vpcsd/shopcartlogic/ShopCartAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.vpcsd.shopcartlogic; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | import android.widget.LinearLayout; 11 | import android.widget.TextView; 12 | 13 | import com.bumptech.glide.Glide; 14 | import com.example.vpcsd.shopcartlogic.bean.ShopCartBean; 15 | 16 | import java.util.List; 17 | 18 | /** 19 | * Created by Administrator on 2016/10/14. 20 | */ 21 | 22 | public class ShopCartAdapter extends RecyclerView.Adapter { 23 | 24 | private Context context; 25 | private List data; 26 | private View headerView; 27 | private OnDeleteClickListener mOnDeleteClickListener; 28 | private OnEditClickListener mOnEditClickListener; 29 | private OnResfreshListener mOnResfreshListener; 30 | 31 | public ShopCartAdapter(Context context, List data){ 32 | this.context = context; 33 | this.data = data; 34 | } 35 | 36 | @Override 37 | public ShopCartAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 38 | View view; 39 | view = LayoutInflater.from(context).inflate(R.layout.item_shopcart, parent, false); 40 | return new ShopCartAdapter.MyViewHolder(view); 41 | } 42 | 43 | @Override 44 | public void onBindViewHolder(final ShopCartAdapter.MyViewHolder holder, final int position) { 45 | 46 | Glide.with(context).load(data.get(position).getDefaultPic()).into(holder.ivShopCartClothPic); 47 | if (position > 0) { 48 | if (data.get(position).getShopId() == data.get(position - 1).getShopId()) { 49 | holder.llShopCartHeader.setVisibility(View.GONE); 50 | } else { 51 | holder.llShopCartHeader.setVisibility(View.VISIBLE); 52 | } 53 | }else { 54 | holder.llShopCartHeader.setVisibility(View.VISIBLE); 55 | } 56 | 57 | holder.tvShopCartClothColor.setText("颜色:" + data.get(position).getColor()); 58 | holder.tvShopCartClothSize.setText("尺寸:" + data.get(position).getSize()); 59 | holder.tvShopCartClothName.setText(data.get(position).getProductName()); 60 | holder.tvShopCartShopName.setText(data.get(position).getShopName()); 61 | holder.tvShopCartClothPrice.setText("¥" + data.get(position).getPrice()); 62 | holder.etShopCartClothNum.setText(data.get(position).getCount() + ""); 63 | 64 | if(mOnResfreshListener != null){ 65 | boolean isSelect = false; 66 | for(int i = 0;i < data.size(); i++){ 67 | if(!data.get(i).getIsSelect()){ 68 | isSelect = false; 69 | break; 70 | }else{ 71 | isSelect = true; 72 | } 73 | } 74 | mOnResfreshListener.onResfresh(isSelect); 75 | } 76 | 77 | holder.ivShopCartClothMinus.setOnClickListener(new View.OnClickListener() { 78 | @Override 79 | public void onClick(View v) { 80 | if(data.get(position).getCount() > 1) { 81 | int count = data.get(position).getCount() - 1; 82 | if (mOnEditClickListener != null) { 83 | mOnEditClickListener.onEditClick(position, data.get(position).getId(), count); 84 | } 85 | data.get(position).setCount(count); 86 | notifyDataSetChanged(); 87 | } 88 | } 89 | }); 90 | 91 | holder.ivShopCartClothAdd.setOnClickListener(new View.OnClickListener() { 92 | @Override 93 | public void onClick(View v) { 94 | int count = data.get(position).getCount() + 1; 95 | if(mOnEditClickListener != null){ 96 | mOnEditClickListener.onEditClick(position,data.get(position).getId(),count); 97 | } 98 | data.get(position).setCount(count); 99 | notifyDataSetChanged(); 100 | } 101 | }); 102 | 103 | if(data.get(position).getIsSelect()){ 104 | holder.ivShopCartClothSel.setImageDrawable(context.getResources().getDrawable(R.drawable.shopcart_selected)); 105 | }else { 106 | holder.ivShopCartClothSel.setImageDrawable(context.getResources().getDrawable(R.drawable.shopcart_unselected)); 107 | } 108 | 109 | if(data.get(position).getIsShopSelect()){ 110 | holder.ivShopCartShopSel.setImageDrawable(context.getResources().getDrawable(R.drawable.shopcart_selected)); 111 | }else { 112 | holder.ivShopCartShopSel.setImageDrawable(context.getResources().getDrawable(R.drawable.shopcart_unselected)); 113 | } 114 | 115 | holder.ivShopCartClothDelete.setOnClickListener(new View.OnClickListener() { 116 | @Override 117 | public void onClick(View v) { 118 | showDialog(v,position); 119 | } 120 | }); 121 | 122 | holder.ivShopCartClothSel.setOnClickListener(new View.OnClickListener() { 123 | @Override 124 | public void onClick(View v) { 125 | data.get(position).setSelect(!data.get(position).getIsSelect()); 126 | //通过循环找出不同商铺的第一个商品的位置 127 | for(int i = 0;i < data.size(); i++){ 128 | if(data.get(i).getIsFirst() == 1) { 129 | //遍历去找出同一家商铺的所有商品的勾选情况 130 | for(int j = 0;j < data.size();j++){ 131 | //如果是同一家商铺的商品,并且其中一个商品是未选中,那么商铺的全选勾选取消 132 | if(data.get(j).getShopId() == data.get(i).getShopId() && !data.get(j).getIsSelect()){ 133 | data.get(i).setShopSelect(false); 134 | break; 135 | }else{ 136 | //如果是同一家商铺的商品,并且所有商品是选中,那么商铺的选中全选勾选 137 | data.get(i).setShopSelect(true); 138 | } 139 | } 140 | } 141 | } 142 | notifyDataSetChanged(); 143 | } 144 | }); 145 | 146 | holder.ivShopCartShopSel.setOnClickListener(new View.OnClickListener() { 147 | @Override 148 | public void onClick(View v) { 149 | if(data.get(position).getIsFirst() == 1) { 150 | data.get(position).setShopSelect(!data.get(position).getIsShopSelect()); 151 | for(int i = 0;i < data.size();i++){ 152 | if(data.get(i).getShopId() == data.get(position).getShopId()){ 153 | data.get(i).setSelect(data.get(position).getIsShopSelect()); 154 | } 155 | } 156 | notifyDataSetChanged(); 157 | } 158 | } 159 | }); 160 | 161 | } 162 | 163 | private void showDialog(final View view, final int position){ 164 | //调用删除某个规格商品的接口 165 | if(mOnDeleteClickListener != null){ 166 | mOnDeleteClickListener.onDeleteClick(view,position,data.get(position).getId()); 167 | } 168 | data.remove(position); 169 | //重新排序,标记所有商品不同商铺第一个的商品位置 170 | MainActivity.isSelectFirst(data); 171 | notifyDataSetChanged(); 172 | } 173 | 174 | @Override 175 | public int getItemCount() { 176 | int count = (data == null ? 0 : data.size()); 177 | if(headerView != null){ 178 | count++; 179 | } 180 | return count; 181 | } 182 | 183 | 184 | class MyViewHolder extends RecyclerView.ViewHolder 185 | { 186 | private ImageView ivShopCartShopSel; 187 | private TextView tvShopCartShopName; 188 | private TextView tvShopCartClothName; 189 | private TextView tvShopCartClothPrice; 190 | private TextView etShopCartClothNum; 191 | private TextView tvShopCartClothColor; 192 | private TextView tvShopCartClothSize; 193 | private ImageView ivShopCartClothSel; 194 | private ImageView ivShopCartClothMinus; 195 | private ImageView ivShopCartClothAdd; 196 | private ImageView ivShopCartClothDelete; 197 | private ImageView ivShopCartClothPic; 198 | private LinearLayout llShopCartHeader; 199 | 200 | public MyViewHolder(View view) 201 | { 202 | super(view); 203 | llShopCartHeader = (LinearLayout) view.findViewById(R.id.ll_shopcart_header); 204 | ivShopCartShopSel = (ImageView) view.findViewById(R.id.iv_item_shopcart_shopselect); 205 | tvShopCartShopName = (TextView) view.findViewById(R.id.tv_item_shopcart_shopname); 206 | tvShopCartClothName = (TextView) view.findViewById(R.id.tv_item_shopcart_clothname); 207 | tvShopCartClothPrice = (TextView) view.findViewById(R.id.tv_item_shopcart_cloth_price); 208 | etShopCartClothNum = (TextView) view.findViewById(R.id.et_item_shopcart_cloth_num); 209 | tvShopCartClothColor = (TextView) view.findViewById(R.id.tv_item_shopcart_cloth_color); 210 | tvShopCartClothSize = (TextView) view.findViewById(R.id.tv_item_shopcart_cloth_size); 211 | ivShopCartClothSel = (ImageView) view.findViewById(R.id.tv_item_shopcart_clothselect); 212 | ivShopCartClothMinus = (ImageView) view.findViewById(R.id.iv_item_shopcart_cloth_minus); 213 | ivShopCartClothAdd = (ImageView) view.findViewById(R.id.iv_item_shopcart_cloth_add); 214 | ivShopCartClothPic = (ImageView) view.findViewById(R.id.iv_item_shopcart_cloth_pic); 215 | ivShopCartClothDelete = (ImageView) view.findViewById(R.id.iv_item_shopcart_cloth_delete); 216 | } 217 | } 218 | 219 | 220 | public View getHeaderView(){ 221 | return headerView; 222 | } 223 | 224 | private ShopCartAdapter.OnItemClickListener mOnItemClickListener; 225 | public interface OnItemClickListener{ 226 | void onItemClick(View view, int position); 227 | } 228 | 229 | public void setOnItemClickListener(ShopCartAdapter.OnItemClickListener mOnItemClickListener){ 230 | this.mOnItemClickListener = mOnItemClickListener; 231 | } 232 | 233 | public interface OnDeleteClickListener{ 234 | void onDeleteClick(View view, int position, int cartid); 235 | } 236 | 237 | public void setOnDeleteClickListener(OnDeleteClickListener mOnDeleteClickListener){ 238 | this.mOnDeleteClickListener = mOnDeleteClickListener; 239 | } 240 | 241 | public interface OnEditClickListener{ 242 | void onEditClick(int position, int cartid, int count); 243 | } 244 | 245 | public void setOnEditClickListener(OnEditClickListener mOnEditClickListener){ 246 | this.mOnEditClickListener = mOnEditClickListener; 247 | } 248 | 249 | public interface OnResfreshListener{ 250 | void onResfresh(boolean isSelect); 251 | } 252 | 253 | public void setResfreshListener(OnResfreshListener mOnResfreshListener){ 254 | this.mOnResfreshListener = mOnResfreshListener; 255 | } 256 | 257 | } 258 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/vpcsd/shopcartlogic/bean/ShopCartBean.java: -------------------------------------------------------------------------------- 1 | package com.example.vpcsd.shopcartlogic.bean; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by Administrator on 2016/10/14. 10 | */ 11 | 12 | public class ShopCartBean { 13 | 14 | /** 15 | * shopId : 2 16 | * shopName : null 17 | * cartlist : [{"id":2,"shopId":2,"shopName":null,"productId":2,"productName":null,"color":null,"size":null,"price":null,"count":null}] 18 | */ 19 | 20 | private int shopId; 21 | private Object shopName; 22 | /** 23 | * id : 2 24 | * shopId : 2 25 | * shopName : null 26 | * productId : 2 27 | * productName : null 28 | * color : null 29 | * size : null 30 | * price : null 31 | * count : null 32 | */ 33 | 34 | private List cartlist; 35 | 36 | 37 | public int getShopId() { 38 | return shopId; 39 | } 40 | 41 | public void setShopId(int shopId) { 42 | this.shopId = shopId; 43 | } 44 | 45 | public Object getShopName() { 46 | return shopName; 47 | } 48 | 49 | public void setShopName(Object shopName) { 50 | this.shopName = shopName; 51 | } 52 | 53 | public List getCartlist() { 54 | return cartlist; 55 | } 56 | 57 | public void setCartlist(List cartlist) { 58 | this.cartlist = cartlist; 59 | } 60 | 61 | 62 | public static class CartlistBean { 63 | private int id; 64 | private int shopId; 65 | private String shopName; 66 | private int productId; 67 | private String productName; 68 | private String color; 69 | private String size; 70 | private String price; 71 | private String defaultPic; 72 | private int count; 73 | private boolean isSelect = true; 74 | private int isFirst = 2; 75 | private boolean isShopSelect = true; 76 | 77 | public String getDefaultPic() { 78 | return defaultPic; 79 | } 80 | 81 | public void setDefaultPic(String defaultPic) { 82 | this.defaultPic = defaultPic; 83 | } 84 | 85 | public boolean getIsShopSelect() { 86 | return isShopSelect; 87 | } 88 | 89 | public void setShopSelect(boolean shopSelect) { 90 | isShopSelect = shopSelect; 91 | } 92 | 93 | public int getIsFirst() { 94 | return isFirst; 95 | } 96 | 97 | public void setIsFirst(int isFirst) { 98 | this.isFirst = isFirst; 99 | } 100 | 101 | public boolean getIsSelect() { 102 | return isSelect; 103 | } 104 | 105 | public void setSelect(boolean select) { 106 | isSelect = select; 107 | } 108 | 109 | public int getId() { 110 | return id; 111 | } 112 | 113 | public void setId(int id) { 114 | this.id = id; 115 | } 116 | 117 | public int getShopId() { 118 | return shopId; 119 | } 120 | 121 | public void setShopId(int shopId) { 122 | this.shopId = shopId; 123 | } 124 | 125 | public String getShopName() { 126 | return shopName; 127 | } 128 | 129 | public void setShopName(String shopName) { 130 | this.shopName = shopName; 131 | } 132 | 133 | public int getProductId() { 134 | return productId; 135 | } 136 | 137 | public void setProductId(int productId) { 138 | this.productId = productId; 139 | } 140 | 141 | public String getProductName() { 142 | return productName; 143 | } 144 | 145 | public void setProductName(String productName) { 146 | this.productName = productName; 147 | } 148 | 149 | public String getColor() { 150 | return color; 151 | } 152 | 153 | public void setColor(String color) { 154 | this.color = color; 155 | } 156 | 157 | public String getSize() { 158 | return size; 159 | } 160 | 161 | public void setSize(String size) { 162 | this.size = size; 163 | } 164 | 165 | public String getPrice() { 166 | return price; 167 | } 168 | 169 | public void setPrice(String price) { 170 | this.price = price; 171 | } 172 | 173 | public int getCount() { 174 | return count; 175 | } 176 | 177 | public void setCount(int count) { 178 | this.count = count; 179 | } 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_activity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_activity.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_add_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_add_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_add_red.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_allbuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_allbuy.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_delete.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_dialog_finish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_dialog_finish.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_entershop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_entershop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_error_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_error_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_instructions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_instructions.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_minus_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_minus_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_minus_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_minus_red.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_shop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_shopdetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_shopdetail.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_shopsize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_shopsize.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shopcart_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/drawable-xhdpi/shopcart_unselected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/login_box.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/login_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 16 | 17 | 23 | 24 | 27 | 28 | 29 | 30 | 39 | 40 | 49 | 50 | 56 | 57 | 67 | 68 | 77 | 78 | 79 | 80 | 93 | 94 | 95 | 96 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_shopcart.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 19 | 20 | 25 | 26 | 36 | 37 | 46 | 47 | 48 | 49 | 50 | 51 | 56 | 57 | 58 | 63 | 64 | 69 | 70 | 73 | 74 | 82 | 83 | 91 | 92 | 98 | 99 | 106 | 107 | 113 | 114 | 120 | 121 | 129 | 130 | 136 | 137 | 144 | 145 | 153 | 154 | 155 | 156 | 161 | 162 | 168 | 169 | 181 | 182 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 202 | 203 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 224 | 225 | 226 | 227 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #e53e42 6 | 7 | 8 | #f8f8f8 9 | #f6f6f6 10 | #f5f5f5 11 | 12 | 13 | #f9a340 14 | #f4736e 15 | 16 | 17 | #dddddd 18 | 19 | 20 | #999999 21 | #666666 22 | #333333 23 | #e53e42 24 | #ffffff 25 | #3C68FE 26 | 27 | 28 | #bbbbbb 29 | #999999 30 | #e53e42 31 | 32 | 33 | #44222222 34 | 35 | 36 | #00000000 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 15sp 7 | 18sp 8 | 14sp 9 | 12sp 10 | 11 | 16sp 12 | 14sp 13 | 12sp 14 | 10dp 15 | 5dp 16 | 2dp 17 | 10dp 18 | 2dp 19 | 10dp 20 | 21 | 22 | 14dp 23 | 14dp 24 | 14dp 25 | 14dp 26 | 27 | 28 | 1dp 29 | 2dp 30 | 3dp 31 | 4dp 32 | 5dp 33 | 6dp 34 | 7dp 35 | 8dp 36 | 10dp 37 | 10dp 38 | 10dp 39 | 15dp 40 | 20dp 41 | 25dp 42 | 30dp 43 | 50dp 44 | 45 | 2dp 46 | 3dp 47 | 4dp 48 | 5dp 49 | 6dp 50 | 7dp 51 | 8dp 52 | 10dp 53 | 12dp 54 | 13dp 55 | 14dp 56 | 15dp 57 | 20dp 58 | 59 | 10sp 60 | 12sp 61 | 13sp 62 | 14sp 63 | 15sp 64 | 16sp 65 | 18sp 66 | 20sp 67 | 22sp 68 | 30sp 69 | 70 | 71 | 12sp 72 | 16sp 73 | 36dp 74 | 200dp 75 | 200dp 76 | 5dp 77 | 78 | 79 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ShopCartLogic 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/com/example/vpcsd/shopcartlogic/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.example.vpcsd.shopcartlogic; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /hs_err_pid1112.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/19snow93/ShopCartLogic/355cf799c6a463d7f469dd88ad03e56392ee821b/hs_err_pid1112.log -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------