diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 08c2c7b..d7d7c57 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -183,6 +183,16 @@
android:configChanges="orientation|screenSize|keyboardHidden"
android:exported="false"
android:screenOrientation="portrait" />
+
+
{
@Override
public void onTabSelect(int position) {
binding.vpContent.setCurrentItem(position);
- if (position == 0 || position == 4) {
+ if (position == 0 || position == 1) {
ImmersionBar.with(MainActivity.this).fitsSystemWindows(false).transparentStatusBar()
.statusBarDarkFont(false).init();
- } else if (position == 1) {
- ImmersionBar.with(MainActivity.this).fitsSystemWindows(false).transparentStatusBar()
- .statusBarDarkFont(true).init();
} else {
- ImmersionBar.with(MainActivity.this).fitsSystemWindows(true).statusBarColor(getStatusBarColor())
+ ImmersionBar.with(MainActivity.this).fitsSystemWindows(false).transparentStatusBar()
.statusBarDarkFont(true).init();
}
}
@@ -112,14 +109,11 @@ public class MainActivity extends BaseActivity {
@Override
public void onPageSelected(int position) {
binding.mainTab.setCurrentTab(position);
- if (position == 0 || position == 4) {
+ if (position == 0 || position == 1) {
ImmersionBar.with(MainActivity.this).fitsSystemWindows(false).transparentStatusBar()
.statusBarDarkFont(false).init();
- } else if (position == 1) {
- ImmersionBar.with(MainActivity.this).fitsSystemWindows(false).transparentStatusBar()
- .statusBarDarkFont(true).init();
} else {
- ImmersionBar.with(MainActivity.this).fitsSystemWindows(true).statusBarColor(getStatusBarColor())
+ ImmersionBar.with(MainActivity.this).fitsSystemWindows(false).transparentStatusBar()
.statusBarDarkFont(true).init();
}
}
diff --git a/app/src/main/java/com/tairui/industrial_operation/ui/mall/GoodsDetailActivity.java b/app/src/main/java/com/tairui/industrial_operation/ui/mall/GoodsDetailActivity.java
index 9f920c9..4afbf0a 100644
--- a/app/src/main/java/com/tairui/industrial_operation/ui/mall/GoodsDetailActivity.java
+++ b/app/src/main/java/com/tairui/industrial_operation/ui/mall/GoodsDetailActivity.java
@@ -6,6 +6,7 @@ import com.kongzue.dialogx.interfaces.OnBindView;
import com.tairui.industrial_operation.R;
import com.tairui.industrial_operation.base.BaseActivity;
import com.tairui.industrial_operation.databinding.ActivityGoodsDetailBinding;
+import com.tairui.industrial_operation.util.IntentUtil;
import com.tairui.industrial_operation.util.SingleClickListener;
import android.os.Bundle;
@@ -90,6 +91,24 @@ public class GoodsDetailActivity extends BaseActivity(
+ R.layout.layout_dialog_pingjia) {
+ @Override
+ public void onBind(BottomDialog dialog, View v) {
+ v.setOnClickListener(v1 -> dialog.dismiss());
+ }
+ }).setBackgroundColor(getResColor(R.color.white)).show();
+ }
+ });
+ binding.btnShopCart.setOnClickListener(new SingleClickListener() {
+ @Override
+ protected void onSingleClick(View v) {
+ IntentUtil.startActivity(mContext, ShopCartActivity.class);
+ }
+ });
}
@Override
diff --git a/app/src/main/java/com/tairui/industrial_operation/ui/mall/MallFragment.java b/app/src/main/java/com/tairui/industrial_operation/ui/mall/MallFragment.java
index 2a31f6a..3979fdf 100644
--- a/app/src/main/java/com/tairui/industrial_operation/ui/mall/MallFragment.java
+++ b/app/src/main/java/com/tairui/industrial_operation/ui/mall/MallFragment.java
@@ -14,6 +14,7 @@ import com.tairui.industrial_operation.ui.home.entity.HomeGoodsEntity;
import com.tairui.industrial_operation.ui.mall.adapter.MallAdapter;
import com.tairui.industrial_operation.util.ArrayUtil;
import com.tairui.industrial_operation.util.IntentUtil;
+import com.tairui.industrial_operation.util.SingleClickListener;
import com.tairui.industrial_operation.widget.RefreshRecyclerView;
import android.view.View;
@@ -58,6 +59,12 @@ public class MallFragment extends BaseFragment {
requestData(false);
}
});
+ binding.btnShopCart.setOnClickListener(new SingleClickListener() {
+ @Override
+ protected void onSingleClick(View v) {
+ IntentUtil.startActivity(mContext, ShopCartActivity.class);
+ }
+ });
adapter.setOnItemClickListener((baseQuickAdapter, view, i) -> {
// Bundle bundle = new Bundle();
// bundle.putSerializable("data", (Serializable) adapter.getItem(i));
diff --git a/app/src/main/java/com/tairui/industrial_operation/ui/mall/ShopCartActivity.java b/app/src/main/java/com/tairui/industrial_operation/ui/mall/ShopCartActivity.java
new file mode 100644
index 0000000..c370392
--- /dev/null
+++ b/app/src/main/java/com/tairui/industrial_operation/ui/mall/ShopCartActivity.java
@@ -0,0 +1,94 @@
+package com.tairui.industrial_operation.ui.mall;
+
+import java.util.List;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.gyf.immersionbar.ImmersionBar;
+import com.tairui.industrial_operation.R;
+import com.tairui.industrial_operation.base.BaseActivity;
+import com.tairui.industrial_operation.databinding.ActivityShopCartBinding;
+import com.tairui.industrial_operation.ui.mall.entity.ShopCartEntity;
+import com.tairui.industrial_operation.util.AppUtil;
+import com.tairui.industrial_operation.util.SingleClickListener;
+
+import android.os.Bundle;
+import android.view.View;
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+
+public class ShopCartActivity extends BaseActivity {
+
+ private ShopCartAdapter adapter;
+
+ @Override
+ protected Class getBindingClass() {
+ return ActivityShopCartBinding.class;
+ }
+
+ @Override
+ protected void initStatusBar() {
+ ImmersionBar.with(this).fitsSystemWindows(false).transparentStatusBar()
+ .statusBarDarkFont(true).init();
+ }
+
+ @Override
+ protected void onQueryArguments() {
+ }
+
+ @Override
+ protected void onBindListener() {
+ binding.btnBack.setOnClickListener(new SingleClickListener() {
+ @Override
+ protected void onSingleClick(View v) {
+ finish();
+ }
+ });
+ }
+
+ @Override
+ protected void onFindView(Bundle savedInstanceState) {
+ binding.refreshRecycler.setLayoutManager(new LinearLayoutManager(mContext));
+ adapter = new ShopCartAdapter();
+ binding.refreshRecycler.setAdapter(adapter);
+ binding.refreshRecycler.setEnableRefresh(false);
+ binding.refreshRecycler.setNoMoreData(true);
+ adapter.setOnItemClickListener((baseQuickAdapter, view, i) -> {
+ });
+ }
+
+ @Override
+ protected void onApplyData() {
+ requestData();
+ }
+
+ private void requestData() {
+ String dataStr = AppUtil.loadJsonFromRaw(mContext, R.raw.shop_cart);
+ Gson gson = new Gson();
+ List data = gson.fromJson(dataStr, new TypeToken>() {
+ }.getType());
+ adapter.setNewData(data);
+ setText(binding.title, "购物车(" + data.size() + ")");
+ binding.refreshRecycler.showContent();
+ }
+
+ private class ShopCartAdapter extends BaseQuickAdapter {
+
+ public ShopCartAdapter() {
+ super(R.layout.item_shop_cart);
+ }
+
+ @Override
+ protected void convert(@NonNull BaseViewHolder holder, ShopCartEntity entity) {
+ holder.setImageResource(R.id.image, AppUtil.getDrawableId(entity.getImgRes()));
+ holder.setText(R.id.name, entity.getName());
+ holder.setText(R.id.price, "¥" + entity.getPrice());
+ holder.setText(R.id.tvSku, "¥" + entity.getSku());
+ holder.setText(R.id.count, String.valueOf(entity.getCount()));
+ holder.setImageResource(R.id.checkbox, entity.isSelect() ? R.mipmap.ic_checkbox_checked : R.mipmap.ic_checkbox_uncheck);
+ holder.addOnClickListener(R.id.checkbox, R.id.btnMinus, R.id.btnPlus);
+ }
+ }
+}
diff --git a/app/src/main/java/com/tairui/industrial_operation/ui/mall/SubGoodsListActivity.java b/app/src/main/java/com/tairui/industrial_operation/ui/mall/SubGoodsListActivity.java
new file mode 100644
index 0000000..b6a296a
--- /dev/null
+++ b/app/src/main/java/com/tairui/industrial_operation/ui/mall/SubGoodsListActivity.java
@@ -0,0 +1,198 @@
+package com.tairui.industrial_operation.ui.mall;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.gyf.immersionbar.ImmersionBar;
+import com.tairui.industrial_operation.R;
+import com.tairui.industrial_operation.base.BaseActivity;
+import com.tairui.industrial_operation.databinding.ActivitySubGoodsListBinding;
+import com.tairui.industrial_operation.ui.mall.entity.SubGoodsEntity;
+import com.tairui.industrial_operation.util.AppUtil;
+import com.tairui.industrial_operation.util.IntentUtil;
+import com.tairui.industrial_operation.util.SingleClickListener;
+
+import android.graphics.Typeface;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+public class SubGoodsListActivity extends BaseActivity {
+
+ private TabAdapter tabAdapter;
+ private SubGoodsAdapter adapter;
+ private CategoryAdapter categoryAdapter;
+
+ private int selectTabIndex = 0;
+ private int selectCategoryIndex = 0;
+
+ @Override
+ protected Class getBindingClass() {
+ return ActivitySubGoodsListBinding.class;
+ }
+
+ @Override
+ protected void initStatusBar() {
+ ImmersionBar.with(this).fitsSystemWindows(false).transparentStatusBar().statusBarDarkFont(true).init();
+ }
+
+ @Override
+ protected void onQueryArguments() {
+ selectTabIndex = getIntent().getIntExtra("tab_index", 0);
+ }
+
+ @Override
+ protected void onFindView(Bundle savedInstanceState) {
+ binding.tabRecycler.setLayoutManager(new LinearLayoutManager(mContext, RecyclerView.HORIZONTAL, false));
+ tabAdapter = new TabAdapter();
+ binding.tabRecycler.setAdapter(tabAdapter);
+
+ binding.categoryList.setLayoutManager(new LinearLayoutManager(mContext));
+ categoryAdapter = new CategoryAdapter();
+ binding.categoryList.setAdapter(categoryAdapter);
+
+ binding.refreshRecycler.setLayoutManager(new LinearLayoutManager(mContext));
+ adapter = new SubGoodsAdapter();
+ binding.refreshRecycler.setAdapter(adapter);
+ binding.refreshRecycler.setEnableRefresh(false);
+ binding.refreshRecycler.setNoMoreData(true);
+ adapter.setOnItemClickListener((baseQuickAdapter, view, i) -> {
+ IntentUtil.startActivity(mContext, GoodsDetailActivity.class);
+ });
+ }
+
+ @Override
+ protected void onBindListener() {
+ binding.btnBack.setOnClickListener(new SingleClickListener() {
+ @Override
+ protected void onSingleClick(View v) {
+ finish();
+ }
+ });
+ binding.btnShopCart.setOnClickListener(new SingleClickListener() {
+ @Override
+ protected void onSingleClick(View v) {
+ IntentUtil.startActivity(mContext, ShopCartActivity.class);
+ }
+ });
+ tabAdapter.setOnItemClickListener((baseQuickAdapter, view, i) -> {
+ selectTabIndex = i;
+ selectTab(selectTabIndex);
+ });
+ categoryAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+ @Override
+ public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
+ selectCategoryIndex = i;
+ selectCateGory(selectCategoryIndex);
+ }
+ });
+ }
+
+ @Override
+ protected void onApplyData() {
+ requestData();
+ }
+
+ private void requestData() {
+ String dataStr = AppUtil.loadJsonFromRaw(mContext, R.raw.sub_goods);
+ Gson gson = new Gson();
+ List data = gson.fromJson(dataStr, new TypeToken>() {
+ }.getType());
+ tabAdapter.setNewData(data);
+ selectTab(selectTabIndex);
+ }
+
+ private void selectTab(int index) {
+ for (int i = 0; i < tabAdapter.getData().size(); i++) {
+ if (index == i) {
+ tabAdapter.getData().get(i).setSelect(true);
+ categoryAdapter.setNewData(tabAdapter.getData().get(i).getCategorys());
+ selectCateGory(0);
+ } else {
+ tabAdapter.getData().get(i).setSelect(false);
+ }
+ }
+ tabAdapter.notifyDataSetChanged();
+ }
+
+ private void selectCateGory(int index) {
+ selectCategoryIndex = index;
+ categoryAdapter.notifyDataSetChanged();
+ if (selectCategoryIndex == 0) {
+ adapter.setNewData(tabAdapter.getData().get(selectTabIndex).getGoods());
+ binding.refreshRecycler.showContent();
+ } else {
+ List filterGoods = new ArrayList<>();
+ String category = tabAdapter.getData().get(selectTabIndex).getCategorys().get(selectCategoryIndex);
+ for (SubGoodsEntity.GoodsEntity item : tabAdapter.getData().get(selectTabIndex).getGoods()) {
+ if (category.equals(item.getCategory())) {
+ filterGoods.add(item);
+ }
+ }
+ adapter.setNewData(filterGoods);
+ if (filterGoods.size() > 0) {
+ binding.refreshRecycler.showContent();
+ } else {
+ binding.refreshRecycler.showError();
+ }
+ }
+ }
+
+ private class TabAdapter extends BaseQuickAdapter {
+
+ public TabAdapter() {
+ super(R.layout.item_sub_goods_tab);
+ }
+
+ @Override
+ protected void convert(@NonNull BaseViewHolder holder, SubGoodsEntity entity) {
+ holder.setImageResource(R.id.img, AppUtil.getDrawableId(entity.getImgRes()));
+ holder.setText(R.id.title, entity.getName());
+ TextView tvTitle = holder.getView(R.id.title);
+ tvTitle.setTypeface(null, entity.isSelect() ? Typeface.BOLD : Typeface.NORMAL);
+ holder.setGone(R.id.titleBg, entity.isSelect() ? true : false);
+ }
+ }
+
+ private class CategoryAdapter extends BaseQuickAdapter {
+
+ public CategoryAdapter() {
+ super(R.layout.item_sub_goods_category);
+ }
+
+ @Override
+ protected void convert(@NonNull BaseViewHolder holder, String entity) {
+ holder.setText(R.id.name, entity);
+ holder.setTextColor(R.id.name,
+ getResColor(selectCategoryIndex == holder.getLayoutPosition() ? R.color.color_txt_green : R.color.color_txt_black));
+ holder.setBackgroundColor(R.id.name,
+ getResColor(selectCategoryIndex == holder.getLayoutPosition() ? R.color.white : R.color.color_f5f5f5));
+ TextView tvTitle = holder.getView(R.id.name);
+ tvTitle.setTypeface(null, selectCategoryIndex == holder.getLayoutPosition() ? Typeface.BOLD : Typeface.NORMAL);
+
+ }
+ }
+
+ private class SubGoodsAdapter extends BaseQuickAdapter {
+
+ public SubGoodsAdapter() {
+ super(R.layout.item_sub_goods);
+ }
+
+ @Override
+ protected void convert(@NonNull BaseViewHolder holder, SubGoodsEntity.GoodsEntity entity) {
+ holder.setImageResource(R.id.image, AppUtil.getDrawableId(entity.getImgRes()));
+ holder.setText(R.id.name, entity.getName());
+ holder.setText(R.id.price, "¥" + entity.getPrice());
+ holder.setText(R.id.tvSku, "¥" + entity.getSku());
+ holder.addOnClickListener(R.id.checkbox, R.id.btnMinus, R.id.btnPlus);
+ }
+ }
+}
diff --git a/app/src/main/java/com/tairui/industrial_operation/ui/mall/adapter/MallAdapter.java b/app/src/main/java/com/tairui/industrial_operation/ui/mall/adapter/MallAdapter.java
index 7a50a1c..56d690d 100644
--- a/app/src/main/java/com/tairui/industrial_operation/ui/mall/adapter/MallAdapter.java
+++ b/app/src/main/java/com/tairui/industrial_operation/ui/mall/adapter/MallAdapter.java
@@ -9,10 +9,12 @@ import com.tairui.industrial_operation.base.entity.BaseHolderEntity;
import com.tairui.industrial_operation.ui.home.adapter.HomeGoodsAdapter;
import com.tairui.industrial_operation.ui.home.entity.HomeGoodsEntity;
import com.tairui.industrial_operation.ui.mall.GoodsDetailActivity;
+import com.tairui.industrial_operation.ui.mall.SubGoodsListActivity;
import com.tairui.industrial_operation.util.DensityUtils;
import com.tairui.industrial_operation.util.IntentUtil;
import com.tairui.industrial_operation.widget.GridSpacingItemDecoration;
+import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@@ -48,6 +50,9 @@ public class MallAdapter extends BaseMultiItemQuickAdapter) entity.getData());
funcRecycler.setAdapter(funcAdapter);
funcAdapter.setOnItemClickListener((baseQuickAdapter, view, i) -> {
+ Bundle bundle = new Bundle();
+ bundle.putInt("tab_index", i);
+ IntentUtil.startActivity(mContext, SubGoodsListActivity.class, bundle);
});
break;
case TYPE_GOODS:
diff --git a/app/src/main/java/com/tairui/industrial_operation/ui/mall/entity/ShopCartEntity.java b/app/src/main/java/com/tairui/industrial_operation/ui/mall/entity/ShopCartEntity.java
new file mode 100644
index 0000000..676dd43
--- /dev/null
+++ b/app/src/main/java/com/tairui/industrial_operation/ui/mall/entity/ShopCartEntity.java
@@ -0,0 +1,66 @@
+package com.tairui.industrial_operation.ui.mall.entity;
+
+import java.io.Serializable;
+
+public class ShopCartEntity implements Serializable {
+
+ private String imgRes;
+
+ private String name;
+
+ private String price;
+
+ private String sku;
+
+ private int count = 1;
+
+ private boolean select = false;
+
+ public String getImgRes() {
+ return imgRes;
+ }
+
+ public void setImgRes(String imgRes) {
+ this.imgRes = imgRes;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPrice() {
+ return price;
+ }
+
+ public void setPrice(String price) {
+ this.price = price;
+ }
+
+ public String getSku() {
+ return sku;
+ }
+
+ public void setSku(String sku) {
+ this.sku = sku;
+ }
+
+ public int getCount() {
+ return count;
+ }
+
+ public void setCount(int count) {
+ this.count = count;
+ }
+
+ public boolean isSelect() {
+ return select;
+ }
+
+ public void setSelect(boolean select) {
+ this.select = select;
+ }
+}
diff --git a/app/src/main/java/com/tairui/industrial_operation/ui/mall/entity/SubGoodsEntity.java b/app/src/main/java/com/tairui/industrial_operation/ui/mall/entity/SubGoodsEntity.java
new file mode 100644
index 0000000..d931d52
--- /dev/null
+++ b/app/src/main/java/com/tairui/industrial_operation/ui/mall/entity/SubGoodsEntity.java
@@ -0,0 +1,112 @@
+package com.tairui.industrial_operation.ui.mall.entity;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+public class SubGoodsEntity {
+
+ @SerializedName("name")
+ private String name;
+ @SerializedName("imgRes")
+ private String imgRes;
+ @SerializedName("categorys")
+ private List categorys;
+ @SerializedName("goods")
+ private List goods;
+ @SerializedName("select")
+ private boolean select = false;
+
+ public boolean isSelect() {
+ return select;
+ }
+
+ public void setSelect(boolean select) {
+ this.select = select;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getImgRes() {
+ return imgRes;
+ }
+
+ public void setImgRes(String imgRes) {
+ this.imgRes = imgRes;
+ }
+
+ public List getCategorys() {
+ return categorys;
+ }
+
+ public void setCategorys(List categorys) {
+ this.categorys = categorys;
+ }
+
+ public List getGoods() {
+ return goods;
+ }
+
+ public void setGoods(List goods) {
+ this.goods = goods;
+ }
+
+ public static class GoodsEntity {
+ @SerializedName("name")
+ private String name;
+ @SerializedName("imgRes")
+ private String imgRes;
+ @SerializedName("price")
+ private String price;
+ @SerializedName("category")
+ private String category;
+ @SerializedName("sku")
+ private String sku;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getImgRes() {
+ return imgRes;
+ }
+
+ public void setImgRes(String imgRes) {
+ this.imgRes = imgRes;
+ }
+
+ public String getPrice() {
+ return price;
+ }
+
+ public void setPrice(String price) {
+ this.price = price;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getSku() {
+ return sku;
+ }
+
+ public void setSku(String sku) {
+ this.sku = sku;
+ }
+ }
+}
diff --git a/app/src/main/java/com/tairui/industrial_operation/ui/my/MyFragment.java b/app/src/main/java/com/tairui/industrial_operation/ui/my/MyFragment.java
index 5f0dc39..52e462b 100644
--- a/app/src/main/java/com/tairui/industrial_operation/ui/my/MyFragment.java
+++ b/app/src/main/java/com/tairui/industrial_operation/ui/my/MyFragment.java
@@ -1,24 +1,12 @@
package com.tairui.industrial_operation.ui.my;
import com.tairui.industrial_operation.base.BaseFragment;
-import com.tairui.industrial_operation.databinding.FragmentHomeBinding;
import com.tairui.industrial_operation.databinding.FragmentMyBinding;
-import android.os.Bundle;
-import android.view.View;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
public class MyFragment extends BaseFragment {
@Override
protected Class getBindingClass() {
return FragmentMyBinding.class;
}
-
- @Override
- public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
-
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/tairui/industrial_operation/widget/SquareWidthImageView.kt b/app/src/main/java/com/tairui/industrial_operation/widget/SquareWidthImageView.kt
new file mode 100644
index 0000000..1a07661
--- /dev/null
+++ b/app/src/main/java/com/tairui/industrial_operation/widget/SquareWidthImageView.kt
@@ -0,0 +1,19 @@
+package com.tairui.industrial_operation.widget
+
+import android.content.Context
+import android.util.AttributeSet
+import androidx.appcompat.widget.AppCompatImageView
+
+/**
+ * create by libo
+ * create on 2020/5/21
+ * description 高等于宽的imageview
+ */
+class SquareWidthImageView : AppCompatImageView {
+ constructor(context: Context?) : super(context!!) {}
+ constructor(context: Context?, attrs: AttributeSet?) : super(context!!, attrs) {}
+
+ override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
+ super.onMeasure(widthMeasureSpec, widthMeasureSpec) //设置高度始终等于宽度,即为正方形
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/tairui/industrial_operation/widget/ratingbar/MyRatingBar.java b/app/src/main/java/com/tairui/industrial_operation/widget/ratingbar/MyRatingBar.java
new file mode 100644
index 0000000..145b82c
--- /dev/null
+++ b/app/src/main/java/com/tairui/industrial_operation/widget/ratingbar/MyRatingBar.java
@@ -0,0 +1,165 @@
+package com.tairui.industrial_operation.widget.ratingbar;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.tairui.industrial_operation.R;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+
+public class MyRatingBar extends LinearLayout {
+ private RatingStatus mRatingStatus;
+ private Drawable mStarFullDrawable;
+ private Drawable mStarEmptyDrawable;
+ private Drawable mStarHalfDrawable;
+ private float mStarWidth;
+ private float mStarHeight;
+ private float mStarPadding;
+ private int mStarTotal;
+ private float mRating;
+ private OnRatingChangedListener mOnRatingChangedListener;
+ private List mBoundaryList = new ArrayList<>(5);
+
+ public MyRatingBar(Context context) {
+ this(context, null);
+ }
+
+ public MyRatingBar(Context context, AttributeSet attrs) {
+ this(context, attrs, -1);
+ }
+
+ public MyRatingBar(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ if (attrs == null) {
+ throw new RuntimeException("NiceRatingBar Error: You must use NiceRatingBar in layout file!");
+ }
+ init(attrs);
+ }
+
+ private void init(AttributeSet attrs) {
+ setOrientation(HORIZONTAL);
+
+ TypedArray mTypedArray = getContext().obtainStyledAttributes(attrs, R.styleable.MyRatingBar);
+ mRatingStatus =
+ RatingStatus.getStatus(mTypedArray.getInt(R.styleable.MyRatingBar_nrb_ratingStatus, RatingStatus.Disable.mStatus));
+ mStarFullDrawable = mTypedArray.getDrawable(R.styleable.MyRatingBar_nrb_starFullResource);
+ mStarEmptyDrawable = mTypedArray.getDrawable(R.styleable.MyRatingBar_nrb_starEmptyResource);
+ mStarHalfDrawable = mTypedArray.getDrawable(R.styleable.MyRatingBar_nrb_starHalfResource);
+ if (mStarFullDrawable == null || mStarEmptyDrawable == null) {
+ throw new IllegalArgumentException("NiceRatingBar Error: You must declare starFullResource and starEmptyResource!");
+ }
+ mStarWidth = mTypedArray.getDimension(R.styleable.MyRatingBar_nrb_starImageWidth, 24f);
+ mStarHeight = mTypedArray.getDimension(R.styleable.MyRatingBar_nrb_starImageHeight, 24f);
+ mStarPadding = mTypedArray.getDimension(R.styleable.MyRatingBar_nrb_starImagePadding, 4f);
+ mStarTotal = mTypedArray.getInt(R.styleable.MyRatingBar_nrb_starTotal, 5);
+ if (mStarTotal <= 0) {
+ throw new IllegalArgumentException("NiceRatingBar Error: starTotal must be positive!");
+ }
+ mRating = mTypedArray.getFloat(R.styleable.MyRatingBar_nrb_rating, 5f);
+ mTypedArray.recycle();
+
+ for (int i = 0; i < mStarTotal; i++) {
+ addView(createStarImageView(i == mStarTotal - 1));
+ }
+
+ setRating(mRating);
+ }
+
+ private ImageView createStarImageView(boolean isLast) {
+ ImageView imageView = new ImageView(getContext());
+ LayoutParams layoutParams = new LayoutParams(Math.round(mStarWidth), Math.round(mStarHeight));
+ layoutParams.setMargins(0, 0, isLast ? 0 : Math.round(mStarPadding), 0);
+ imageView.setLayoutParams(layoutParams);
+ return imageView;
+ }
+
+ public void setRating(float rating) {
+ if (rating > mStarTotal) {
+ rating = mStarTotal;
+ }
+ this.mRating = rating;
+ if (mOnRatingChangedListener != null) {
+ mOnRatingChangedListener.onRatingChanged(rating);
+ }
+
+ int partInteger = (int) Math.floor(rating);
+ float partDecimal = new BigDecimal(String.valueOf(rating))
+ .subtract(new BigDecimal(String.valueOf(partInteger)))
+ .floatValue();
+
+ for (int i = 0; i < partInteger; i++) {
+ ((ImageView) getChildAt(i)).setImageDrawable(mStarFullDrawable);
+ }
+
+ for (int i = partInteger; i < mStarTotal; i++) {
+ ((ImageView) getChildAt(i)).setImageDrawable(mStarEmptyDrawable);
+ }
+
+ if (partDecimal >= 0.25) {
+ if (partDecimal < 0.75 && mStarHalfDrawable != null) {
+ ((ImageView) getChildAt(partInteger)).setImageDrawable(mStarHalfDrawable);
+ } else if (partDecimal >= 0.75) {
+ ((ImageView) getChildAt(partInteger)).setImageDrawable(mStarFullDrawable);
+ }
+ }
+ }
+
+ private float calculateRating(float touchX) {
+ float result = 0;
+ for (int i = 0; i < mStarTotal - 1; i++) {
+ if (touchX >= mBoundaryList.get(i) && touchX <= mBoundaryList.get(i + 1)) {
+ if (mStarHalfDrawable != null && touchX < (mBoundaryList.get(i) + mBoundaryList.get(i + 1)) / 2) {
+ result = i + 0.5f;
+ } else {
+ result = i + 1;
+ }
+ break;
+ }
+ }
+ if (result == 0f && touchX >= mBoundaryList.get(mBoundaryList.size() - 1)) {
+ result = touchX < mBoundaryList.get(mBoundaryList.size() - 1) + mStarWidth / 2 ? mStarTotal - 0.5f : mStarTotal;
+ }
+ if (result == 0f) {
+ result = mStarHalfDrawable != null ? 0.5f : 1;
+ }
+ return result;
+ }
+
+ @SuppressLint("ClickableViewAccessibility")
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ if (mRatingStatus == RatingStatus.Enable && !mBoundaryList.isEmpty()) {
+ setRating(calculateRating(event.getX()));
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ return true;
+ }
+ }
+ return super.onTouchEvent(event);
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ super.onLayout(changed, l, t, r, b);
+ if (mBoundaryList.isEmpty()) {
+ for (int index = 0; index < mStarTotal; index++) {
+ mBoundaryList.add(index == 0 ? 0 : mBoundaryList.get(index - 1) + Math.round(mStarWidth) + Math.round(mStarPadding));
+ }
+ }
+ }
+
+ public void setOnRatingChangedListener(OnRatingChangedListener listener) {
+ this.mOnRatingChangedListener = listener;
+ }
+
+ public void setRatingStatus(RatingStatus status) {
+ this.mRatingStatus = status;
+ }
+}
diff --git a/app/src/main/java/com/tairui/industrial_operation/widget/ratingbar/OnRatingChangedListener.java b/app/src/main/java/com/tairui/industrial_operation/widget/ratingbar/OnRatingChangedListener.java
new file mode 100644
index 0000000..f9a0667
--- /dev/null
+++ b/app/src/main/java/com/tairui/industrial_operation/widget/ratingbar/OnRatingChangedListener.java
@@ -0,0 +1,5 @@
+package com.tairui.industrial_operation.widget.ratingbar;
+
+public interface OnRatingChangedListener {
+ void onRatingChanged(float rating);
+}
diff --git a/app/src/main/java/com/tairui/industrial_operation/widget/ratingbar/RatingStatus.java b/app/src/main/java/com/tairui/industrial_operation/widget/ratingbar/RatingStatus.java
new file mode 100644
index 0000000..b434917
--- /dev/null
+++ b/app/src/main/java/com/tairui/industrial_operation/widget/ratingbar/RatingStatus.java
@@ -0,0 +1,18 @@
+package com.tairui.industrial_operation.widget.ratingbar;
+
+public enum RatingStatus {
+
+ Disable(0),
+
+ Enable(1);
+
+ int mStatus;
+
+ RatingStatus(int statusValue) {
+ this.mStatus = statusValue;
+ }
+
+ public static RatingStatus getStatus(int status) {
+ return status == Disable.mStatus ? Disable : Enable;
+ }
+}
diff --git a/app/src/main/res/drawable/bg_container_green_border_raduis_30.xml b/app/src/main/res/drawable/bg_container_green_border_raduis_30.xml
new file mode 100644
index 0000000..f4fc7bf
--- /dev/null
+++ b/app/src/main/res/drawable/bg_container_green_border_raduis_30.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/bg_container_light_gray_raduis_2.xml b/app/src/main/res/drawable/bg_container_light_gray_raduis_2.xml
new file mode 100644
index 0000000..6bda153
--- /dev/null
+++ b/app/src/main/res/drawable/bg_container_light_gray_raduis_2.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/bg_container_light_green_raduis_2.xml b/app/src/main/res/drawable/bg_container_light_green_raduis_2.xml
new file mode 100644
index 0000000..bb230e8
--- /dev/null
+++ b/app/src/main/res/drawable/bg_container_light_green_raduis_2.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/bg_gradient_sub_goods.xml b/app/src/main/res/drawable/bg_gradient_sub_goods.xml
new file mode 100644
index 0000000..aba17cf
--- /dev/null
+++ b/app/src/main/res/drawable/bg_gradient_sub_goods.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_goods_detail.xml b/app/src/main/res/layout/activity_goods_detail.xml
index b98c8c9..1bd463f 100644
--- a/app/src/main/res/layout/activity_goods_detail.xml
+++ b/app/src/main/res/layout/activity_goods_detail.xml
@@ -69,6 +69,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_sub_goods_list.xml b/app/src/main/res/layout/activity_sub_goods_list.xml
new file mode 100644
index 0000000..57565aa
--- /dev/null
+++ b/app/src/main/res/layout/activity_sub_goods_list.xml
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_mall.xml b/app/src/main/res/layout/fragment_mall.xml
index 9fff87b..feace8f 100644
--- a/app/src/main/res/layout/fragment_mall.xml
+++ b/app/src/main/res/layout/fragment_mall.xml
@@ -46,9 +46,9 @@
android:background="@drawable/bg_container_white_raduis_30"
android:gravity="center_vertical"
android:orientation="horizontal"
+ app:layout_constraintRight_toLeftOf="@id/btnShopCart"
app:layout_constraintBottom_toBottomOf="@id/icLogo"
app:layout_constraintLeft_toRightOf="@id/icLogo"
- app:layout_constraintRight_toLeftOf="@id/btnMessage"
app:layout_constraintTop_toTopOf="@id/icLogo">
+ android:background="@mipmap/bg_my"
+ android:orientation="vertical"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_shop_cart.xml b/app/src/main/res/layout/item_shop_cart.xml
new file mode 100644
index 0000000..e1cce57
--- /dev/null
+++ b/app/src/main/res/layout/item_shop_cart.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_sub_goods.xml b/app/src/main/res/layout/item_sub_goods.xml
new file mode 100644
index 0000000..bacf7a9
--- /dev/null
+++ b/app/src/main/res/layout/item_sub_goods.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_sub_goods_category.xml b/app/src/main/res/layout/item_sub_goods_category.xml
new file mode 100644
index 0000000..302f0ce
--- /dev/null
+++ b/app/src/main/res/layout/item_sub_goods_category.xml
@@ -0,0 +1,13 @@
+
+
diff --git a/app/src/main/res/layout/item_sub_goods_tab.xml b/app/src/main/res/layout/item_sub_goods_tab.xml
new file mode 100644
index 0000000..76b2b07
--- /dev/null
+++ b/app/src/main/res/layout/item_sub_goods_tab.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/layout_dialog_pingjia.xml b/app/src/main/res/layout/layout_dialog_pingjia.xml
new file mode 100644
index 0000000..0019feb
--- /dev/null
+++ b/app/src/main/res/layout/layout_dialog_pingjia.xml
@@ -0,0 +1,348 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-xxhdpi/bg_my.png b/app/src/main/res/mipmap-xxhdpi/bg_my.png
new file mode 100644
index 0000000..1abd772
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/bg_my.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/bg_sub_goods_tab_title.png b/app/src/main/res/mipmap-xxhdpi/bg_sub_goods_tab_title.png
new file mode 100644
index 0000000..7ec1d9d
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/bg_sub_goods_tab_title.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_checkbox_checked.png b/app/src/main/res/mipmap-xxhdpi/ic_checkbox_checked.png
new file mode 100644
index 0000000..07d4464
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_checkbox_checked.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_checkbox_uncheck.png b/app/src/main/res/mipmap-xxhdpi/ic_checkbox_uncheck.png
new file mode 100644
index 0000000..84cfb4f
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_checkbox_uncheck.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_default_head.png b/app/src/main/res/mipmap-xxhdpi/ic_default_head.png
new file mode 100644
index 0000000..82119f4
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_default_head.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_identify.png b/app/src/main/res/mipmap-xxhdpi/ic_identify.png
new file mode 100644
index 0000000..e959d99
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_identify.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_minuse_round.png b/app/src/main/res/mipmap-xxhdpi/ic_minuse_round.png
new file mode 100644
index 0000000..3dcbf98
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_minuse_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_plus_round.png b/app/src/main/res/mipmap-xxhdpi/ic_plus_round.png
new file mode 100644
index 0000000..52042ce
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_plus_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_setting.png b/app/src/main/res/mipmap-xxhdpi/ic_setting.png
new file mode 100644
index 0000000..bac7611
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_setting.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_10.png b/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_10.png
new file mode 100644
index 0000000..61e7a09
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_10.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_11.png b/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_11.png
new file mode 100644
index 0000000..d1f8981
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_11.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_8.png b/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_8.png
new file mode 100644
index 0000000..27624ec
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_8.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_9.png b/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_9.png
new file mode 100644
index 0000000..b71c6a7
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_goods_detail_9.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_my_1.png b/app/src/main/res/mipmap-xxhdpi/pic_my_1.png
new file mode 100644
index 0000000..056b328
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_my_1.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_my_2.png b/app/src/main/res/mipmap-xxhdpi/pic_my_2.png
new file mode 100644
index 0000000..f0bdb34
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_my_2.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_my_3.png b/app/src/main/res/mipmap-xxhdpi/pic_my_3.png
new file mode 100644
index 0000000..caf58dd
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_my_3.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_my_product_3.png b/app/src/main/res/mipmap-xxhdpi/pic_my_product_3.png
new file mode 100644
index 0000000..a411ec5
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_my_product_3.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_1.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_1.png
new file mode 100644
index 0000000..36baac3
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_1.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_10.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_10.png
new file mode 100644
index 0000000..61c32d0
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_10.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_11.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_11.png
new file mode 100644
index 0000000..2bbf392
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_11.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_12.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_12.png
new file mode 100644
index 0000000..2c8a558
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_12.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_13.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_13.png
new file mode 100644
index 0000000..c738dfb
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_13.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_14.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_14.png
new file mode 100644
index 0000000..f529d3b
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_14.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_15.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_15.png
new file mode 100644
index 0000000..a4e6ecc
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_15.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_16.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_16.png
new file mode 100644
index 0000000..2ba4f89
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_16.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_2.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_2.png
new file mode 100644
index 0000000..b6b92eb
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_2.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_3.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_3.png
new file mode 100644
index 0000000..3ed2245
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_3.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_4.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_4.png
new file mode 100644
index 0000000..1e68e54
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_4.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_5.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_5.png
new file mode 100644
index 0000000..6a5b06c
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_5.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_6.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_6.png
new file mode 100644
index 0000000..09d3b3c
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_6.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_7.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_7.png
new file mode 100644
index 0000000..a4feca2
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_7.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_8.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_8.png
new file mode 100644
index 0000000..fc468fa
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_8.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_9.png b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_9.png
new file mode 100644
index 0000000..b8811b3
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/pic_sub_goods_9.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/rating_normal.png b/app/src/main/res/mipmap-xxhdpi/rating_normal.png
new file mode 100644
index 0000000..6557a4b
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/rating_normal.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/rating_select.png b/app/src/main/res/mipmap-xxhdpi/rating_select.png
new file mode 100644
index 0000000..0bda0cc
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/rating_select.png differ
diff --git a/app/src/main/res/raw/shop_cart.json b/app/src/main/res/raw/shop_cart.json
new file mode 100644
index 0000000..df084f9
--- /dev/null
+++ b/app/src/main/res/raw/shop_cart.json
@@ -0,0 +1,20 @@
+[
+ {
+ "name": "耿马普罗旺斯西红柿沙瓤番茄甄选番茄苗",
+ "imgRes": "pic_my_product_1",
+ "price": "4.50",
+ "sku": "【1000g*件】"
+ },
+ {
+ "name": "紫皮长茄子新鲜蔬菜细茄子长条茄子杭茄",
+ "imgRes": "pic_my_product_2",
+ "price": "4.50",
+ "sku": "【1000g*件】"
+ },
+ {
+ "name": "正宗黄心土豆黄皮大个粉心土豆红皮土豆",
+ "imgRes": "pic_my_product_3",
+ "price": "4.50",
+ "sku": "【1000g*件】"
+ }
+]
\ No newline at end of file
diff --git a/app/src/main/res/raw/sub_goods.json b/app/src/main/res/raw/sub_goods.json
new file mode 100644
index 0000000..c3573f8
--- /dev/null
+++ b/app/src/main/res/raw/sub_goods.json
@@ -0,0 +1,231 @@
+[
+ {
+ "name": "种子种苗",
+ "imgRes": "pic_sub_goods_1",
+ "categorys": [
+ "全部",
+ "蔬菜种子",
+ "中药材种子",
+ "水果种子"
+ ],
+ "goods": [
+ {
+ "name": "耿马普罗旺斯西红柿沙瓤番茄甄选番茄苗",
+ "imgRes": "pic_my_product_1",
+ "price": "4.50",
+ "category": "蔬菜种子",
+ "sku": "1000g*件"
+ },
+ {
+ "name": "紫皮长茄子新鲜蔬菜细茄子长条茄子杭茄",
+ "imgRes": "pic_my_product_2",
+ "price": "4.50",
+ "category": "蔬菜种子",
+ "sku": "1000g*件"
+ },
+ {
+ "name": "正宗黄心土豆黄皮大个粉心土豆红皮土豆",
+ "imgRes": "pic_my_product_3",
+ "price": "4.50",
+ "category": "蔬菜种子",
+ "sku": "1000g*件"
+ }
+ ]
+ },
+ {
+ "name": "化肥",
+ "imgRes": "pic_sub_goods_2",
+ "categorys": [
+ "全部",
+ "复合肥",
+ "氮肥",
+ "磷肥",
+ "钾肥"
+ ],
+ "goods": [
+ {
+ "name": "喷施宝叶面肥正品有机水溶肥料植物果树蔬菜玉...",
+ "imgRes": "pic_sub_goods_10",
+ "price": "72.50",
+ "category": "复合肥",
+ "sku": "1000ml*件"
+ }
+ ]
+ },
+ {
+ "name": "农药",
+ "imgRes": "pic_sub_goods_3",
+ "categorys": [
+ "全部",
+ "杀螨剂",
+ "除草剂",
+ "杀菌剂",
+ "杀虫剂"
+ ],
+ "goods": [
+ {
+ "name": "南通江山90%敌百虫白菜甘蓝花菜菜青虫十字花...",
+ "imgRes": "pic_sub_goods_11",
+ "price": "2.65",
+ "category": "杀虫剂",
+ "sku": "70g*件"
+ }
+ ]
+ },
+ {
+ "name": "泡沫",
+ "imgRes": "pic_sub_goods_4",
+ "categorys": [
+ "全部",
+ "EPS",
+ "EPE",
+ "EPP",
+ "可降解泡沫"
+ ],
+ "goods": [
+ {
+ "name": "epe 珍珠棉泡沫板材防震撞缓冲打包插花加厚垫...",
+ "imgRes": "pic_sub_goods_12",
+ "price": "9.50",
+ "category": "可降解泡沫",
+ "sku": "1m*2m*5mm"
+ }
+ ]
+ },
+ {
+ "name": "地膜",
+ "imgRes": "pic_sub_goods_5",
+ "categorys": [
+ "全部",
+ "聚乙烯",
+ "聚丙烯",
+ "聚氯乙烯",
+ "聚酯",
+ "聚酰胺",
+ "EVOH",
+ "PVDC"
+ ],
+ "goods": [
+ {
+ "name": "聚乙烯PE黑色地膜塑料薄膜除草保温加厚果树抗...",
+ "imgRes": "pic_sub_goods_13",
+ "price": "54.90",
+ "category": "聚乙烯",
+ "sku": "1mm*60cm*800m"
+ }
+ ]
+ },
+ {
+ "name": "包装箱",
+ "imgRes": "pic_sub_goods_6",
+ "categorys": [
+ "全部",
+ "瓦楞纸箱",
+ "塑料周转箱",
+ "木箱/木托盘",
+ "金属箱/筐",
+ "网袋/编织袋",
+ "大袋/吨袋"
+ ],
+ "goods": [
+ {
+ "name": "塑料筐长方形加厚大号蔬菜水果框子快递筐子周...",
+ "imgRes": "pic_sub_goods_14",
+ "price": "10.89",
+ "category": "塑料周转箱",
+ "sku": "380*300*90mm"
+ }
+ ]
+ },
+ {
+ "name": "蔬菜",
+ "imgRes": "pic_sub_goods_7",
+ "categorys": [
+ "全部",
+ "瓜类",
+ "茄果类",
+ "豆类",
+ "椒类",
+ "叶菜类",
+ "根茎类",
+ "花菜类",
+ "葱蒜类",
+ "其他类"
+ ],
+ "goods": [
+ {
+ "name": "耿马普罗旺斯西红柿沙瓤番茄甄选番茄苗",
+ "imgRes": "pic_my_product_1",
+ "price": "4.50",
+ "category": "茄果类",
+ "sku": "1000g*件"
+ },
+ {
+ "name": "紫皮长茄子新鲜蔬菜细茄子长条茄子杭茄",
+ "imgRes": "pic_my_product_2",
+ "price": "4.50",
+ "category": "茄果类",
+ "sku": "1000g*件"
+ },
+ {
+ "name": "正宗黄心土豆黄皮大个粉心土豆红皮土豆",
+ "imgRes": "pic_my_product_3",
+ "price": "4.50",
+ "category": "根茎类",
+ "sku": "1000g*件"
+ }
+ ]
+ },
+ {
+ "name": "中药材",
+ "imgRes": "pic_sub_goods_8",
+ "categorys": [
+ "全部",
+ "铁皮石斛",
+ "滇重楼",
+ "滇鸡血藤",
+ "滇黄精",
+ "滇龙胆草",
+ "白及",
+ "砂仁",
+ "草果",
+ "猴耳环",
+ "其他类"
+ ],
+ "goods": [
+ {
+ "name": "正宗新鲜霍山铁皮石斛原浆养胃调理肠胃粉...",
+ "imgRes": "pic_sub_goods_15",
+ "price": "128.00",
+ "category": "铁皮石斛",
+ "sku": "500g*盒"
+ }
+ ]
+ },
+ {
+ "name": "水果",
+ "imgRes": "pic_sub_goods_8",
+ "categorys": [
+ "全部",
+ "沃柑",
+ "香蕉",
+ "金丝凤梨",
+ "榴莲",
+ "脐橙",
+ "黄晶果",
+ "血橙/冰糖橙",
+ "草莓/百香果",
+ "杨梅",
+ "橘子"
+ ],
+ "goods": [
+ {
+ "name": "现摘海南金钻凤梨新鲜水果生鲜手撕菠萝当...",
+ "imgRes": "pic_sub_goods_16",
+ "price": "12.90",
+ "category": "金丝凤梨",
+ "sku": "3kg*件"
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index d29088a..6ddd988 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -56,4 +56,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+