master
viola 2 years ago
parent d58d719975
commit 00b36ec069

@ -0,0 +1,14 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx

@ -0,0 +1,116 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<compositeConfiguration>
<compositeBuild compositeDefinitionSource="SCRIPT" />
</compositeConfiguration>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="resolveModulePerSourceSet" value="false" />
<option name="testRunner" value="PLATFORM" />
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,42 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AlibabaAvoidCommentBehindStatement" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaCommentsMustBeJavadocFormat" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="ConstantConditions" enabled="false" level="WARNING" enabled_by_default="false">
<option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" />
<option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" />
</inspection_tool>
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="date" />
</inspection_tool>
</profile>
</component>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

@ -0,0 +1,50 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.llw.cart"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//Gson
implementation 'com.google.code.gson:gson:2.8.6'
//RecyclerView
implementation 'androidx.recyclerview:recyclerview:1.1.0'
//RecyclerView
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.22'
//
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
//
implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-14'
//使Header
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0-alpha-14'
}

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

@ -0,0 +1,27 @@
package com.llw.cart;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.llw.cart", appContext.getPackageName());
}
}

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.llw.cart">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

@ -0,0 +1,389 @@
package com.llw.cart;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.annotation.SuppressLint;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.google.gson.Gson;
import com.llw.cart.adapter.StoreAdapter;
import com.llw.cart.bean.CarResponse;
import com.llw.cart.util.Constant;
import com.llw.cart.util.GoodsCallback;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*
* @author llw
*/
public class MainActivity extends AppCompatActivity implements GoodsCallback, View.OnClickListener {
public static final String TAG = "MainActivity";
private RecyclerView rvStore;
private StoreAdapter storeAdapter;
private List<CarResponse.OrderDataBean> mList = new ArrayList<>();
private TextView tvEdit;//编辑
private ImageView ivCheckedAll;//全选
private TextView tvTotal;//合计价格
private TextView tvSettlement;//结算
private LinearLayout layEdit;//编辑底部布局
private TextView tvShareGoods;//分享商品
private TextView tvCollectGoods;//收藏商品
private TextView tvDeleteGoods;//删除商品
private boolean isEdit = false;//是否编辑
private boolean isAllChecked = false;//是否全选
private List<Integer> shopIdList = new ArrayList<>();//店铺列表
private double totalPrice = 0.00;//商品总价
private int totalCount = 0;//商品总数量
private AlertDialog dialog;//弹窗
private boolean isHaveGoods = false;//购物车是否有商品
private SmartRefreshLayout refresh;//刷新布局
private LinearLayout layEmpty;//空布局
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
}
/**
*
*/
private void initView() {
//设置亮色状态栏模式 systemUiVisibility在Android11中弃用了可以尝试一下。
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
rvStore = findViewById(R.id.rv_store);
tvEdit = findViewById(R.id.tv_edit);
ivCheckedAll = findViewById(R.id.iv_checked_all);
tvTotal = findViewById(R.id.tv_total);
tvSettlement = findViewById(R.id.tv_settlement);
layEdit = findViewById(R.id.lay_edit);
tvShareGoods = findViewById(R.id.tv_share_goods);
tvCollectGoods = findViewById(R.id.tv_collect_goods);
tvDeleteGoods = findViewById(R.id.tv_delete_goods);
refresh = findViewById(R.id.refresh);
layEmpty = findViewById(R.id.lay_empty);
//禁用下拉刷新和上拉加载更多
refresh.setEnableRefresh(false);
refresh.setEnableLoadMore(false);
//下拉刷新监听
refresh.setOnRefreshListener(refreshLayout -> initView());
tvEdit.setOnClickListener(this);
ivCheckedAll.setOnClickListener(this);
tvSettlement.setOnClickListener(this);
tvShareGoods.setOnClickListener(this);
tvCollectGoods.setOnClickListener(this);
tvDeleteGoods.setOnClickListener(this);
CarResponse carResponse = new Gson().fromJson(Constant.CAR_JSON, CarResponse.class);
mList.addAll(carResponse.getOrderData());
storeAdapter = new StoreAdapter(R.layout.item_store, mList, this);
rvStore.setLayoutManager(new LinearLayoutManager(this));
rvStore.setAdapter(storeAdapter);
//店铺点击
storeAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
CarResponse.OrderDataBean storeBean = mList.get(position);
if (view.getId() == R.id.iv_checked_store) {
storeBean.setChecked(!storeBean.isChecked());
storeAdapter.notifyDataSetChanged();
//传递选中店铺的id
if (storeBean.isChecked()) {
//全选商品
storeAdapter.controlGoods(storeBean.getShopId(), true);
//添加到列表中
if (!shopIdList.contains(storeBean.getShopId())) {
//如果列表中没有这个店铺Id且当前店铺为选中状态
shopIdList.add(storeBean.getShopId());
}
} else {
//清除全选商品
storeAdapter.controlGoods(storeBean.getShopId(), false);
//从列表中清除
if (shopIdList.contains(storeBean.getShopId())) {
shopIdList.remove((Integer) storeBean.getShopId());
}
}
//控制页面全选
controlAllChecked();
}
}
});
//有商品
isHaveGoods = true;
//下拉加载数据完成后,关闭下拉刷新动画
refresh.finishRefresh();
//隐藏布局
layEmpty.setVisibility(View.GONE);
}
/**
*
*/
private void controlAllChecked() {
if (shopIdList.size() == mList.size() && mList.size() != 0) {
//全选
ivCheckedAll.setImageDrawable(getDrawable(R.drawable.ic_checked));
isAllChecked = true;
} else {
//不全选
ivCheckedAll.setImageDrawable(getDrawable(R.drawable.ic_check));
isAllChecked = false;
}
//计算价格
calculationPrice();
}
/**
*
*
* @param shopId id
*/
@Override
public void checkedStore(int shopId, boolean state) {
for (CarResponse.OrderDataBean bean : mList) {
//遍历
if (shopId == bean.getShopId()) {
bean.setChecked(state);
storeAdapter.notifyDataSetChanged();
//记录选中店铺的shopid,添加到一个列表中。
if (!shopIdList.contains(bean.getShopId()) && state) {
//如果列表中没有这个店铺Id且当前店铺为选中状态
shopIdList.add(bean.getShopId());
} else {
if (shopIdList.contains(bean.getShopId())) {
//通过list.indexOf获取属性的在列表中的下标不过强转Integer更简洁
shopIdList.remove((Integer) bean.getShopId());
}
}
}
}
//控制页面全选
controlAllChecked();
}
/**
*
*/
@Override
public void calculationPrice() {
//每次计算之前先置零
totalPrice = 0.00;
totalCount = 0;
//循环购物车中的店铺列表
for (int i = 0; i < mList.size(); i++) {
CarResponse.OrderDataBean orderDataBean = mList.get(i);
//循环店铺中的商品列表
for (int j = 0; j < orderDataBean.getCartlist().size(); j++) {
CarResponse.OrderDataBean.CartlistBean cartlistBean = orderDataBean.getCartlist().get(j);
//当有选中商品时计算数量和价格
if (cartlistBean.isChecked()) {
totalCount++;
totalPrice += cartlistBean.getPrice() * cartlistBean.getCount();
}
}
}
tvTotal.setText("¥" + totalPrice);
tvSettlement.setText(totalCount == 0 ? "结算" : "结算(" + totalCount + ")");
}
/**
*
*
* @param v
*/
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.tv_edit://编辑
if (!isHaveGoods) {
showMsg("当前购物车空空如也~");
return;
}
if (isEdit) {
tvEdit.setText("编辑");
layEdit.setVisibility(View.GONE);
isEdit = false;
} else {
tvEdit.setText("完成");
layEdit.setVisibility(View.VISIBLE);
isEdit = true;
}
break;
case R.id.iv_checked_all://全选
if (!isHaveGoods) {
showMsg("当前购物车空空如也~");
return;
}
if (isAllChecked) {
//取消全选
isSelectAllStore(false);
} else {
//全选
isSelectAllStore(true);
}
break;
case R.id.tv_settlement://结算
if (!isHaveGoods) {
showMsg("当前购物车空空如也~");
return;
}
if (totalCount == 0) {
showMsg("请选择要结算的商品");
return;
}
//弹窗
dialog = new AlertDialog.Builder(this)
.setMessage("总计:" + totalCount + "种商品," + totalPrice + "元")
.setPositiveButton("确定", (dialog, which) -> deleteGoods())
.setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
.create();
dialog.show();
break;
case R.id.tv_delete_goods://删除
if (totalCount == 0) {
showMsg("请选择要删除的商品");
return;
}
//弹窗
dialog = new AlertDialog.Builder(this)
.setMessage("确定要删除所选商品吗?")
.setPositiveButton("确定", (dialog, which) -> deleteGoods())
.setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
.create();
dialog.show();
break;
case R.id.tv_collect_goods://收藏
if (totalCount == 0) {
showMsg("请选择要收藏的商品");
return;
}
showMsg("收藏成功!");
break;
case R.id.tv_share_goods://分享
if (totalCount == 0) {
showMsg("请选择要分享的商品");
return;
}
showMsg("分享成功!");
break;
default:
break;
}
}
/**
*
*/
private void deleteGoods() {
//店铺列表
List<CarResponse.OrderDataBean> storeList = new ArrayList<>();
for (int i = 0; i < mList.size(); i++) {
CarResponse.OrderDataBean store = mList.get(i);
if (store.isChecked()) {
//店铺如果选择则添加到此列表中
storeList.add(store);
}
//商品列表
List<CarResponse.OrderDataBean.CartlistBean> goodsList = new ArrayList<>();
List<CarResponse.OrderDataBean.CartlistBean> goods = store.getCartlist();
//循环店铺中的商品列表
for (int j = 0; j < goods.size(); j++) {
CarResponse.OrderDataBean.CartlistBean cartlistBean = goods.get(j);
//当有选中商品时添加到此列表中
if (cartlistBean.isChecked()) {
goodsList.add(cartlistBean);
}
}
//删除商品
goods.removeAll(goodsList);
}
//删除店铺
mList.removeAll(storeList);
shopIdList.clear();//删除了选中商品,清空已选择的标识
controlAllChecked();//控制去全选
//改变界面UI
tvEdit.setText("编辑");
layEdit.setVisibility(View.GONE);
isEdit = false;
//刷新数据
storeAdapter.notifyDataSetChanged();
if (mList.size() <= 0) {
//无商品
isHaveGoods = false;
//启用下拉刷新
refresh.setEnableRefresh(true);
//显示空布局
layEmpty.setVisibility(View.VISIBLE);
}
}
/**
*
*
* @param state
*/
private void isSelectAllStore(boolean state) {
//修改背景
ivCheckedAll.setImageDrawable(getDrawable(state ? R.drawable.ic_checked : R.drawable.ic_check));
for (CarResponse.OrderDataBean orderDataBean : mList) {
//商品是否选中
storeAdapter.controlGoods(orderDataBean.getShopId(), state);
//店铺是否选中
checkedStore(orderDataBean.getShopId(), state);
}
isAllChecked = state;
}
/**
* Toast
*
* @param msg
*/
private void showMsg(String msg) {
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
}
}

@ -0,0 +1,49 @@
package com.llw.cart.adapter;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.llw.cart.bean.CarResponse;
import com.llw.cart.R;
import java.util.List;
/**
*
*
* @author llw
*/
public class GoodsAdapter extends BaseQuickAdapter<CarResponse.OrderDataBean.CartlistBean, BaseViewHolder> {
public GoodsAdapter(int layoutResId, @Nullable List<CarResponse.OrderDataBean.CartlistBean> data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, CarResponse.OrderDataBean.CartlistBean item) {
helper.setText(R.id.tv_good_name, item.getProductName())
.setText(R.id.tv_good_color, item.getColor())
.setText(R.id.tv_good_size, item.getSize())
.setText(R.id.tv_goods_price, item.getPrice() + "")
.setText(R.id.tv_goods_num, item.getCount() + "");
ImageView goodImg = helper.getView(R.id.iv_goods);
Glide.with(mContext).load(item.getDefaultPic()).into(goodImg);
ImageView checkedGoods = helper.getView(R.id.iv_checked_goods);
//判断商品是否选中
if (item.isChecked()) {
checkedGoods.setImageDrawable(mContext.getDrawable(R.drawable.ic_checked));
} else {
checkedGoods.setImageDrawable(mContext.getDrawable(R.drawable.ic_check));
}
//添加点击事件
helper.addOnClickListener(R.id.iv_checked_goods)//选中商品
.addOnClickListener(R.id.tv_increase_goods_num)//增加商品
.addOnClickListener(R.id.tv_reduce_goods_num);//减少商品
}
}

@ -0,0 +1,155 @@
package com.llw.cart.adapter;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.llw.cart.MainActivity;
import com.llw.cart.bean.CarResponse;
import com.llw.cart.R;
import com.llw.cart.util.GoodsCallback;
import java.util.List;
/**
*
*
* @author llw
*/
public class StoreAdapter extends BaseQuickAdapter<CarResponse.OrderDataBean, BaseViewHolder> {
private RecyclerView rvGood;
//商品回调
private GoodsCallback goodsCallback;
//店铺对象
private List<CarResponse.OrderDataBean> storeBean;
public StoreAdapter(int layoutResId, @Nullable List<CarResponse.OrderDataBean> data, GoodsCallback goodsCallback) {
super(layoutResId, data);
this.goodsCallback = goodsCallback;
storeBean = data;//赋值
}
@Override
protected void convert(BaseViewHolder helper, final CarResponse.OrderDataBean item) {
rvGood = helper.getView(R.id.rv_goods);
helper.setText(R.id.tv_store_name, item.getShopName());
ImageView checkedStore = helper.getView(R.id.iv_checked_store);
if (item.isChecked()) {
checkedStore.setImageDrawable(mContext.getDrawable(R.drawable.ic_checked));
} else {
checkedStore.setImageDrawable(mContext.getDrawable(R.drawable.ic_check));
}
//点击事件
helper.addOnClickListener(R.id.iv_checked_store);//选中店铺
final GoodsAdapter goodsAdapter = new GoodsAdapter(R.layout.item_good, item.getCartlist());
rvGood.setLayoutManager(new LinearLayoutManager(mContext));
rvGood.setAdapter(goodsAdapter);
//商品item中的点击事件
goodsAdapter.setOnItemChildClickListener(new OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
CarResponse.OrderDataBean.CartlistBean goodsBean = item.getCartlist().get(position);
switch (view.getId()) {
case R.id.iv_checked_goods://选中商品
//如果已选中则取消选中,未选中则选中
goodsBean.setChecked(!goodsBean.isChecked());
//刷新适配器
goodsAdapter.notifyDataSetChanged();
//控制店铺是否选中
controlStore(item);
//商品控制价格
goodsCallback.calculationPrice();
break;
case R.id.tv_increase_goods_num://增加商品数量
updateGoodsNum(goodsBean, goodsAdapter,true);
break;
case R.id.tv_reduce_goods_num://减少商品数量
updateGoodsNum(goodsBean, goodsAdapter,false);
break;
default:
break;
}
}
});
}
/**
*
* @param goodsBean
* @param goodsAdapter
* @param state true false
*/
private void updateGoodsNum(CarResponse.OrderDataBean.CartlistBean goodsBean, GoodsAdapter goodsAdapter,boolean state) {
//其实商品应该还有一个库存值或者其他的限定值我这里写一个假的库存值为10
int inventory = 10;
int count = goodsBean.getCount();
if(state){
if (count >= inventory){
Toast.makeText(mContext,"商品数量不可超过库存值~",Toast.LENGTH_SHORT).show();
return;
}
count++;
}else {
if (count <= 1){
Toast.makeText(mContext,"已是最低商品数量~",Toast.LENGTH_SHORT).show();
return;
}
count--;
}
goodsBean.setCount(count);//设置商品数量
//刷新适配器
goodsAdapter.notifyDataSetChanged();
//计算商品价格
goodsCallback.calculationPrice();
}
/**
*
*/
private void controlStore(CarResponse.OrderDataBean item) {
int num = 0;
for (CarResponse.OrderDataBean.CartlistBean bean : item.getCartlist()) {
if (bean.isChecked()) {
++num;
}
}
if (num == item.getCartlist().size()) {
//全选中 传递需要选中的店铺的id过去
goodsCallback.checkedStore(item.getShopId(), true);
} else {
goodsCallback.checkedStore(item.getShopId(), false);
}
}
/**
*
*/
public void controlGoods(int shopId, boolean state) {
//根据店铺id选中该店铺下所有商品
for (CarResponse.OrderDataBean orderDataBean : storeBean) {
//店铺id等于传递过来的店铺id 则选中该店铺下所有商品
if (orderDataBean.getShopId() == shopId) {
for (CarResponse.OrderDataBean.CartlistBean cartlistBean : orderDataBean.getCartlist()) {
cartlistBean.setChecked(state);
//刷新
notifyDataSetChanged();
}
}
}
}
}

@ -0,0 +1,196 @@
package com.llw.cart.bean;
import java.util.List;
/**
*
* @author llw
*/
public class CarResponse {
/**
* code : 200
* orderData : [{"shopId":1,"shopName":"京东自营","cartlist":[{"id":1,"shopId":1,"shopName":"京东自营","defaultPic":"https://img30.360buyimg.com/popWareDetail/jfs/t3208/194/7616404169/244198/369625db/58b7d093N03520fb7.jpg","productId":1,"productName":"三只松鼠_零食大礼包","color":"黑色","size":"18L","price":20,"count":1},{"id":2,"shopId":1,"shopName":"京东自营","defaultPic":"https://img14.360buyimg.com/n0/jfs/t2971/15/167732091/93002/204c1016/574d9d9aNe4e6fa7a.jpg","productId":2,"productName":"小米心跳手环","color":"白色","size":"20XXL","price":148,"count":1}]},{"shopId":2,"shopName":"海澜之家","cartlist":[{"id":1,"shopId":2,"shopName":"海澜之家","defaultPic":"https://img30.360buyimg.com/popWaterMark/jfs/t4075/83/1343091204/132469/9034cb9c/5873496bN68020ba8.jpg","productId":1,"productName":"短袖T恤男 2017夏季新品","color":"蓝色","size":"30X","price":181,"count":1}]},{"shopId":3,"shopName":"OPPO官方旗舰店","cartlist":[{"id":1,"shopId":3,"shopName":"OPPO官方旗舰店","defaultPic":"https://img10.360buyimg.com/cms/jfs/t6064/272/2163314583/157700/442d6477/593c1c49N7c63a7d9.jpg","productId":1,"productName":"OPPO R11 全网通","color":"蓝色","size":"30X","price":1999,"count":1},{"id":2,"shopId":3,"shopName":"OPPO官方旗舰店","defaultPic":"https://img14.360buyimg.com/n0/jfs/t3142/194/4953241722/254855/1651c2b1/585b9021Nf653e48a.jpg","productId":1,"productName":"OPPO R9 全网通","color":"蓝色","size":"30X","price":999,"count":1}]}]
*/
private int code;
private List<OrderDataBean> orderData;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public List<OrderDataBean> getOrderData() {
return orderData;
}
public void setOrderData(List<OrderDataBean> orderData) {
this.orderData = orderData;
}
public static class OrderDataBean {
/**
* shopId : 1
* shopName :
* cartlist : [{"id":1,"shopId":1,"shopName":"京东自营","defaultPic":"https://img30.360buyimg.com/popWareDetail/jfs/t3208/194/7616404169/244198/369625db/58b7d093N03520fb7.jpg","productId":1,"productName":"三只松鼠_零食大礼包","color":"黑色","size":"18L","price":20,"count":1},{"id":2,"shopId":1,"shopName":"京东自营","defaultPic":"https://img14.360buyimg.com/n0/jfs/t2971/15/167732091/93002/204c1016/574d9d9aNe4e6fa7a.jpg","productId":2,"productName":"小米心跳手环","color":"白色","size":"20XXL","price":148,"count":1}]
*/
private int shopId;
private String shopName;
private List<CartlistBean> cartlist;
private boolean isChecked;//店铺是否选中
public int getShopId() {
return shopId;
}
public void setShopId(int shopId) {
this.shopId = shopId;
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
public List<CartlistBean> getCartlist() {
return cartlist;
}
public void setCartlist(List<CartlistBean> cartlist) {
this.cartlist = cartlist;
}
public boolean isChecked() {
return isChecked;
}
public void setChecked(boolean checked) {
isChecked = checked;
}
public static class CartlistBean {
/**
* id : 1
* shopId : 1
* shopName :
* defaultPic : https://img30.360buyimg.com/popWareDetail/jfs/t3208/194/7616404169/244198/369625db/58b7d093N03520fb7.jpg
* productId : 1
* productName : _
* color :
* size : 18L
* price : 20
* count : 1
*/
private int id;
private int shopId;
private String shopName;
private String defaultPic;
private int productId;
private String productName;
private String color;
private String size;
private int price;
private int count;
private boolean isChecked;//商品是否选中
public boolean isChecked() {
return isChecked;
}
public void setChecked(boolean checked) {
isChecked = checked;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getShopId() {
return shopId;
}
public void setShopId(int shopId) {
this.shopId = shopId;
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
public String getDefaultPic() {
return defaultPic;
}
public void setDefaultPic(String defaultPic) {
this.defaultPic = defaultPic;
}
public int getProductId() {
return productId;
}
public void setProductId(int productId) {
this.productId = productId;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
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;
}
}
}
}

@ -0,0 +1,95 @@
package com.llw.cart.util;
/**
*
* @author llw
*/
public class Constant {
public static final String CAR_JSON = "{ \"code\" : 200 ,\n" +
" \"orderData\" : [\n" +
" {\n" +
"\n" +
" \"shopId\": 1,\n" +
" \"shopName\":\"京东自营\",\n" +
" \"cartlist\": [\n" +
" {\n" +
" \"id\": 1,\n" +
" \"shopId\": 1,\n" +
" \"shopName\": \"京东自营\",\n" +
" \"defaultPic\": \"https://img30.360buyimg.com/popWareDetail/jfs/t3208/194/7616404169/244198/369625db/58b7d093N03520fb7.jpg\",\n" +
" \"productId\": 1,\n" +
" \"productName\": \"三只松鼠_零食大礼包\",\n" +
" \"color\": \"黑色\",\n" +
" \"size\": \"18L\",\n" +
" \"price\": 20,\n" +
" \"count\":1\n" +
" },\n" +
" {\n" +
" \"id\": 2,\n" +
" \"shopId\": 1,\n" +
" \"shopName\": \"京东自营\",\n" +
" \"defaultPic\": \"https://img14.360buyimg.com/n0/jfs/t2971/15/167732091/93002/204c1016/574d9d9aNe4e6fa7a.jpg\",\n" +
" \"productId\": 2,\n" +
" \"productName\": \"小米心跳手环\",\n" +
" \"color\": \"白色\",\n" +
" \"size\": \"20XXL\",\n" +
" \"price\": 148,\n" +
" \"count\": 1\n" +
" }\n" +
" ]\n" +
" }\n" +
" ,\n" +
" {\n" +
" \"shopId\": 2,\n" +
" \"shopName\":\"海澜之家\",\n" +
" \"cartlist\": [\n" +
" {\n" +
" \"id\": 1,\n" +
" \"shopId\": 2,\n" +
" \"shopName\": \"海澜之家\",\n" +
" \"defaultPic\": \"https://img30.360buyimg.com/popWaterMark/jfs/t4075/83/1343091204/132469/9034cb9c/5873496bN68020ba8.jpg\",\n" +
" \"productId\": 1,\n" +
" \"productName\": \"短袖T恤男 2017夏季新品\",\n" +
" \"color\": \"蓝色\",\n" +
" \"size\": \"30X\",\n" +
" \"price\": 181,\n" +
" \"count\":1\n" +
" }\n" +
" ]\n" +
" }\n" +
" ,\n" +
" {\n" +
" \"shopId\": 3,\n" +
" \"shopName\":\"OPPO官方旗舰店\",\n" +
" \"cartlist\": [\n" +
" {\n" +
" \"id\": 1,\n" +
" \"shopId\": 3,\n" +
" \"shopName\": \"OPPO官方旗舰店\",\n" +
" \"defaultPic\": \"https://img10.360buyimg.com/cms/jfs/t6064/272/2163314583/157700/442d6477/593c1c49N7c63a7d9.jpg\",\n" +
" \"productId\": 1,\n" +
" \"productName\": \"OPPO R11 全网通\",\n" +
" \"color\": \"蓝色\",\n" +
" \"size\": \"30X\",\n" +
" \"price\": 1999,\n" +
" \"count\":1\n" +
" },\n" +
" {\n" +
" \"id\": 2,\n" +
" \"shopId\": 3,\n" +
" \"shopName\": \"OPPO官方旗舰店\",\n" +
" \"defaultPic\": \"https://img14.360buyimg.com/n0/jfs/t3142/194/4953241722/254855/1651c2b1/585b9021Nf653e48a.jpg\",\n" +
" \"productId\": 1,\n" +
" \"productName\": \"OPPO R9 全网通\",\n" +
" \"color\": \"蓝色\",\n" +
" \"size\": \"30X\",\n" +
" \"price\": 999,\n" +
" \"count\":1\n" +
" }\n" +
" ]\n" +
" }\n" +
"\n" +
" ]\n" +
"}";
}

@ -0,0 +1,21 @@
package com.llw.cart.util;
/**
*
* @author llw
*/
public interface GoodsCallback {
/**
*
* @param shopId id
* @param state
*/
void checkedStore(int shopId,boolean state);
/**
*
*/
void calculationPrice();
}

@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:color="#000"
android:width="0.5dp"/>
</shape>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:color="#000"
android:width="0.5dp"/>
<corners android:topRightRadius="4dp"
android:bottomRightRadius="4dp" />
</shape>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:color="#000"
android:width="0.5dp"/>
<corners android:topLeftRadius="4dp"
android:bottomLeftRadius="4dp" />
</shape>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp"/>
<gradient
android:startColor="#FF5C13"
android:endColor="#FC7D0B"
android:angle="90" />
</shape>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFF"/>
<corners android:radius="8dp"/>
</shape>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M12,22.5c-5.79,0 -10.5,-4.71 -10.5,-10.5S6.21,1.5 12,1.5 22.5,6.21 22.5,12 17.79,22.5 12,22.5zM12,3c-4.963,0 -9,4.037 -9,9s4.037,9 9,9 9,-4.037 9,-9S16.963,3 12,3z"
android:fillColor="#a9b7b7"/>
</vector>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#eb4f38"
android:pathData="M12,1.546c-5.764,0 -10.454,4.69 -10.454,10.454 0,5.765 4.689,10.454 10.454,10.454S22.454,17.765 22.454,12C22.454,6.236 17.765,1.546 12,1.546zM17.044,10.276 L11.039,16.346c-0.001,0.001 -0.005,0.002 -0.006,0.005 -0.002,0.001 -0.002,0.005 -0.005,0.006 -0.048,0.046 -0.107,0.075 -0.163,0.107 -0.028,0.016 -0.05,0.04 -0.08,0.051 -0.09,0.036 -0.185,0.055 -0.28,0.055 -0.096,0 -0.193,-0.019 -0.284,-0.056 -0.03,-0.013 -0.054,-0.038 -0.082,-0.054 -0.056,-0.031 -0.113,-0.059 -0.161,-0.107 -0.001,-0.001 -0.002,-0.005 -0.004,-0.006 -0.001,-0.002 -0.005,-0.002 -0.006,-0.005l-2.954,-3.035c-0.289,-0.297 -0.282,-0.772 0.015,-1.061 0.297,-0.288 0.771,-0.283 1.061,0.015l2.42,2.487 5.467,-5.527c0.291,-0.295 0.767,-0.298 1.061,-0.006C17.333,9.506 17.335,9.981 17.044,10.276z" />
</vector>

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:tint="#616161"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@android:color/white"
android:pathData="M7,18c-1.1,0 -1.99,0.9 -1.99,2S5.9,22 7,22s2,-0.9 2,-2 -0.9,-2 -2,-2zM1,3c0,0.55 0.45,1 1,1h1l3.6,7.59 -1.35,2.44C4.52,15.37 5.48,17 7,17h11c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1L7,15l1.1,-2h7.45c0.75,0 1.41,-0.41 1.75,-1.03l3.58,-6.49c0.37,-0.66 -0.11,-1.48 -0.87,-1.48L5.21,4l-0.67,-1.43c-0.16,-0.35 -0.52,-0.57 -0.9,-0.57L2,2c-0.55,0 -1,0.45 -1,1zM17,18c-1.1,0 -1.99,0.9 -1.99,2s0.89,2 1.99,2 2,-0.9 2,-2 -0.9,-2 -2,-2z" />
</vector>

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context=".MainActivity">
<!--顶部-->
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#FFF">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="购物车"
android:textColor="#000"
android:textSize="18sp" />
<!--编辑-->
<TextView
android:id="@+id/tv_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginRight="12dp"
android:padding="@dimen/dp_4"
android:text="编辑"
android:textColor="#000"
android:textSize="16sp" />
</androidx.appcompat.widget.Toolbar>
<!--下拉刷新区域-->
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/lay_bottom"
android:layout_below="@+id/toolbar"
app:srlAccentColor="#000"
app:srlPrimaryColor="#00000000">
<!--刷新头部样式-->
<com.scwang.smartrefresh.header.StoreHouseHeader
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:shhText="SHOPPING CART" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!--列表-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_store"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="12dp" />
<!--购物车为空时显示-->
<LinearLayout
android:id="@+id/lay_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@drawable/ic_shopping_cart" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="空空如也~" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="下拉可以增加数据喔~" />
</LinearLayout>
</RelativeLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
<!--底部-->
<RelativeLayout
android:id="@+id/lay_bottom"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="#FFF"
android:paddingLeft="12dp">
<ImageView
android:id="@+id/iv_checked_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:src="@drawable/ic_check" />
<TextView
android:id="@+id/tv_checked_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/iv_checked_all"
android:text="全选"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/tv_total"
android:text="合计:"
android:textColor="#000"
android:textSize="18sp" />
<TextView
android:id="@+id/tv_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="8dp"
android:layout_toLeftOf="@+id/tv_settlement"
android:text="¥0"
android:textColor="#DF3B0D"
android:textSize="14sp" />
<!--结算-->
<TextView
android:id="@+id/tv_settlement"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="12dp"
android:background="@drawable/bg_settlement"
android:gravity="center"
android:text="结算"
android:textColor="#FFF"
android:textSize="16sp" />
<!--点击编辑时出现底部布局-->
<LinearLayout
android:id="@+id/lay_edit"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@+id/tv_checked_all"
android:background="#FFF"
android:gravity="center"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:id="@+id/tv_share_goods"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.3"
android:background="#f4c600"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="分享宝贝"
android:textColor="@android:color/white"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_collect_goods"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="1dp"
android:layout_weight="0.3"
android:background="#ea8010"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="移到收藏夹"
android:textColor="@android:color/white"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_delete_goods"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="1dp"
android:layout_weight="0.3"
android:background="#eb4f38"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center"
android:text="删除"
android:textColor="@android:color/white"
android:textSize="16sp" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<!--选中商品-->
<ImageView
android:id="@+id/iv_checked_goods"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="12dp"
android:src="@drawable/ic_check" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="100dp">
<!--商品图片-->
<ImageView
android:id="@+id/iv_goods"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginRight="12dp"
android:scaleType="fitXY"
android:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/tv_good_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/iv_goods"
android:text="商品名"
android:textColor="#000"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_good_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_good_name"
android:layout_marginTop="4dp"
android:layout_toRightOf="@+id/iv_goods"
android:text="商品颜色"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_good_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_good_name"
android:layout_marginLeft="6dp"
android:layout_marginTop="4dp"
android:layout_toRightOf="@+id/tv_good_color"
android:text="商品尺寸"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_goods_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginBottom="4dp"
android:layout_toRightOf="@+id/iv_goods"
android:lines="1"
android:text="¥100000.00"
android:textColor="#DF550B"
android:textSize="20sp"
android:textStyle="bold" />
<!--改变商品数量-->
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="4dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_reduce_goods_num"
android:layout_width="24dp"
android:layout_height="24dp"
android:background="@drawable/bg_reduce_goods_num"
android:gravity="center"
android:text="—"
android:textColor="#000"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_goods_num"
android:layout_width="40dp"
android:layout_height="24dp"
android:layout_marginLeft="-0.5dp"
android:layout_marginRight="-0.5dp"
android:layout_toRightOf="@+id/tv_reduce_goods_num"
android:background="@drawable/bg_goods_num"
android:gravity="center"
android:text="1"
android:textColor="#000"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_increase_goods_num"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_toRightOf="@+id/tv_goods_num"
android:background="@drawable/bg_increase_goods_num"
android:gravity="center"
android:text="+"
android:textColor="#000"
android:textSize="16sp" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:background="@drawable/bg_white_8"
android:orientation="vertical"
android:padding="12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:gravity="center_vertical">
<!--选中店铺-->
<ImageView
android:id="@+id/iv_checked_store"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="12dp"
android:src="@drawable/ic_check" />
<TextView
android:id="@+id/tv_store_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="店铺名"
android:textColor="#000"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<!--店铺商品列表-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_goods"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#FFF</color>
<color name="colorPrimaryDark">#FFF</color>
<color name="colorAccent">#D81B60</color>
</resources>

@ -0,0 +1,3 @@
<resources>
<string name="app_name">ShoppingCart</string>
</resources>

@ -0,0 +1,11 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>

@ -0,0 +1,17 @@
package com.llw.cart;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

@ -0,0 +1,28 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

@ -0,0 +1,20 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

@ -0,0 +1,6 @@
#Mon Dec 07 09:36:35 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

@ -0,0 +1,172 @@
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

@ -0,0 +1,2 @@
include ':app'
rootProject.name='ShoppingCart'
Loading…
Cancel
Save