Commit ce18b6f9 authored by 姜敏's avatar 姜敏

添加颜色

parent b034d783
//package com.xingdata.zzdpos.ui.marketing.ms.view;
//
//import android.view.View;
//import android.widget.AdapterView;
//
//import com.xingdata.zzdpos.C;
//import com.xingdata.zzdpos.R;
//import com.xingdata.zzdpos.api.ApiFactory;
//import com.xingdata.zzdpos.databinding.ViewGroupCateBinding;
//import com.xingdata.zzdpos.model.Category;
//import com.xingdata.zzdpos.model.Ms;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * 指定品类页面
// */
//public class GroupCateView extends BaseGroupView<ViewGroupCateBinding> {
//
// private int mClaPosition = 0, mGrpPosition = 0, mCatePosition = 0;
// private List<Category> mClas, mGrps, mCates;
// private AdapterView.OnItemSelectedListener mOnItemSelectedListener;
//
// private long cateId;
//
// public GroupCateView() {
// mOnItemSelectedListener = new AdapterView.OnItemSelectedListener() {
// @Override
// public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
// switch (adapterView.getId()) {
// case R.id.ns_type_1:
// mClaPosition = i;
// mGrpPosition = 0;
// mCatePosition = 0;
//
// mViewBinding.nsType3.setVisibility(View.GONE);
//
// loadGrp(mClas.get(i));
// cateId = mClas.get(i).getSpuCateId();
// break;
// case R.id.ns_type_2:
// mGrpPosition = i;
// mCatePosition = 0;
//
// if (mGrps.get(i).getSpuCateId() > 0) {
// loadCate(mGrps.get(i));
// cateId = mGrps.get(i).getSpuCateId();
// mViewBinding.nsType3.setVisibility(View.VISIBLE);
// } else {
// cateId = mClas.get(mClaPosition).getSpuCateId();
// mViewBinding.nsType3.setVisibility(View.GONE);
// }
//
// break;
// case R.id.ns_type_3:
// mCatePosition = i;
//
// if (mCates.get(i).getSpuCateId() < 0) {
// cateId = mGrps.get(mGrpPosition).getSpuCateId();
// } else {
// cateId = mCates.get(i).getSpuCateId();
// }
// break;
// }
// }
//
// @Override
// public void onNothingSelected(AdapterView<?> adapterView) {
// }
// };
// }
//
// @Override
// public int getLayoutId() {
// return R.layout.view_group_cate;
// }
//
//
// @Override
// public void initView() {
// super.initView();
// loadCla();
//
// mViewBinding.nsType1.setOnItemSelectedListener(mOnItemSelectedListener);
// mViewBinding.nsType2.setOnItemSelectedListener(mOnItemSelectedListener);
// mViewBinding.nsType3.setOnItemSelectedListener(mOnItemSelectedListener);
// }
//
// @Override
// protected void setViewByMs() {
// }
//
// @Override
// public boolean processMs(Ms ms) {
// ms.setMsTouchTag2((byte) C.MS_GROUP.CATE);
// ms.setSpuCateId((int) cateId);
// return true;
// }
//
//
// /**
// * 加载大类
// */
// private void loadCla() {
// ApiFactory.Shop.queryAll().subscribe(
// categories -> {
// mClas = categories;
// List<String> strClas = new ArrayList<>();
// for (int i = 0; i < categories.size(); i++) {
// if (mMs != null && mMs.getSpuCateId() != null && mMs.getSpuCateId() / 10000 == categories.get(i).getSpuCateId() / 10000)
// mClaPosition = i;
// strClas.add(categories.get(i).getSpuClaName());
// }
// mViewBinding.nsType1.attachDataSource(strClas);
// mViewBinding.nsType1.setSelectedIndex(mClaPosition);
//
// cateId = mClas.get(0).getSpuCateId();
//
// loadGrp(mClas.get(mClaPosition));
// },
// throwable -> {
// });
// }
//
// /**
// * 设置大类信息,加载中类
// *
// * @param cateCla 大类信息
// */
// private void loadGrp(Category cateCla) {
// ApiFactory.Shop.queryAll(cateCla).subscribe(
// categories -> {
// Category category = new Category();
// category.setSpuGrpName("全部");
// category.setSpuCateId(cateCla.getSpuCateId());
// categories.add(0, category);
//
// mGrps = categories;
// List<String> strGrps = new ArrayList<>();
// for (int j = 0; j < categories.size(); j++) {
// if (mMs != null && mMs.getSpuCateId() != null && mMs.getSpuCateId() / 100 == categories.get(j).getSpuCateId() / 100)
// mGrpPosition = j;
// strGrps.add(categories.get(j).getSpuGrpName());
// }
// mViewBinding.nsType2.attachDataSource(strGrps);
// mViewBinding.nsType2.setSelectedIndex(mGrpPosition);
//
// if (mGrpPosition != 0) {
// loadCate(mGrps.get(mGrpPosition));
// mViewBinding.nsType3.setVisibility(View.VISIBLE);
// }
// },
// throwable -> {
// });
//
// }
//
// /**
// * 设置中类信息,加载小类
// *
// * @param cateGrp 中类信息
// */
// private void loadCate(Category cateGrp) {
// ApiFactory.Shop.queryAll(cateGrp).subscribe(
// categories -> {
// Category category = new Category();
// category.setSpuCateName("全部");
// category.setSpuCateId(cateGrp.getSpuCateId());
// categories.add(0, category);
//
// mCates = categories;
// List<String> strCates = new ArrayList<>();
// for (int j = 0; j < categories.size(); j++) {
// if (mMs != null && mMs.getSpuCateId() != null && mMs.getSpuCateId().longValue() == categories.get(j).getSpuCateId())
// mCatePosition = j;
// strCates.add(categories.get(j).getSpuCateName());
// }
// mViewBinding.nsType3.attachDataSource(strCates);
// mViewBinding.nsType3.setSelectedIndex(mCatePosition);
// },
// throwable -> {
// });
// }
//
//}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment