在做一个项目的时候需要选择商品的规格,在参考了一些相似功能的实现之后,自己结合项目需求自定义了一个弹窗。下面是实现该功能的截图 及 相关代码。


1、实现这个功能主要用了流式布局FlowTagLayout 来展示规格 

参照我的一篇文章 点击打开链接

2、弹窗布局 pop_categary_chose.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:fresco="http://schemas.android.com/apk/res-auto"android:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="vertical"><RelativeLayoutandroid:id="@+id/rl_relative"android:layout_width="match_parent"android:layout_height="wrap_content"android:background="@android:color/transparent"><LinearLayoutandroid:id="@+id/ll_product"android:layout_width="match_parent"android:layout_height="wrap_content"android:background="@color/white"android:orientation="vertical"android:layout_alignParentBottom="true"android:layout_alignParentStart="true"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="40dp"><TextViewandroid:id="@+id/tv_buy_price"android:layout_width="0dp"android:layout_weight="1"android:layout_height="match_parent"android:layout_marginLeft="120dp"android:text="¥0"android:layout_gravity="center_vertical"android:gravity="center_vertical"android:textColor="@color/gridview_text_red"android:textSize="@dimen/gridview_text_size" /><ImageViewandroid:id="@+id/iv_close"android:layout_width="20dp"android:layout_height="20dp"android:src="@mipmap/ic_clear"android:layout_margin="10dp"/></LinearLayout><TextViewandroid:id="@+id/tv_stock"android:layout_width="match_parent"android:layout_height="match_parent"android:gravity="bottom"android:layout_marginLeft="120dp"android:text="库存0件"android:textColor="@color/c_666666"android:textSize="@dimen/gridview_text_size"android:layout_weight="1"/><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginLeft="120dp"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_desc_tip"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="5dp"android:textColor="@color/c_666666"android:text="请选择规格"android:textSize="14dp"/><TextViewandroid:id="@+id/tv_chosed_desc"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="5dp"android:textColor="@color/c_666666"android:text=""android:textSize="14dp"/></LinearLayout><Viewandroid:id="@+id/line1"android:layout_width="match_parent"android:layout_height="0.5dp"android:layout_marginLeft="10dp"android:layout_marginRight="10dp"android:layout_marginTop="20dp"android:background="@color/line_bg"android:visibility="gone" /><ScrollViewandroid:layout_width="match_parent"android:layout_height="250dp"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="250dp"android:orientation="vertical"><LinearLayoutandroid:id="@+id/ll_size1"android:layout_width="match_parent"android:layout_height="0dp"android:layout_weight="1"android:orientation="vertical"android:paddingLeft="15dp"android:paddingRight="10dp"android:layout_marginTop="8dp"><!--动态加入备选项--><TextViewandroid:id="@+id/tv_size1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginLeft="15dp"android:text="颜色"android:layout_marginTop="20dp"android:textSize="@dimen/gridview_text_size"android:textColor="@color/c_666666"/><com.xj.hpqq.huopinquanqiu.widget.flowtaglayout.FlowTagLayoutandroid:id="@+id/fl_desc1"android:layout_width="match_parent"android:layout_height="wrap_content" /></LinearLayout><Viewandroid:id="@+id/line2"android:layout_width="match_parent"android:layout_height="0.5dp"android:layout_marginLeft="10dp"android:layout_marginRight="10dp"android:layout_marginTop="20dp"android:background="@color/line_bg"android:visibility="gone" /><LinearLayoutandroid:id="@+id/ll_size2"android:layout_width="match_parent"android:orientation="vertical"android:paddingLeft="15dp"android:paddingRight="10dp"android:layout_height="0dp"android:layout_weight="1"android:layout_marginTop="8dp"><TextViewandroid:id="@+id/tv_size2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginLeft="15dp"android:text="尺寸"android:layout_marginTop="20dp"android:textSize="@dimen/gridview_text_size"android:textColor="@color/c_666666"/><!--动态加入备选项--><com.xj.hpqq.huopinquanqiu.widget.flowtaglayout.FlowTagLayoutandroid:id="@+id/fl_desc2"android:layout_width="match_parent"android:layout_height="wrap_content" /></LinearLayout><Viewandroid:id="@+id/line3"android:layout_width="match_parent"android:layout_height="0.5dp"android:layout_marginLeft="10dp"android:layout_marginRight="10dp"android:layout_marginTop="20dp"android:background="@color/line_bg"android:visibility="visible" /><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:gravity="center_vertical"android:paddingTop="10dp"android:paddingBottom="10dp"><TextViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginLeft="15dp"android:text="购买数量"android:visibility="invisible"android:textSize="16dp"android:textColor="@color/c_4E4E4E"android:layout_weight="1"/><TextViewandroid:id="@+id/tv_reduce"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="—"android:background="@drawable/button_shape_left_ring_gray"android:paddingLeft="10dp"android:paddingRight="10dp"android:textSize="20dp" /><TextViewandroid:id="@+id/tv_number"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="1"android:textSize="20dp"android:textColor="@color/c_666666"android:layout_marginLeft="15dp"android:layout_marginRight="15dp"/><TextViewandroid:id="@+id/tv_add"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="+"android:background="@drawable/button_shape_right_ring_gray"android:paddingLeft="12dp"android:paddingRight="12dp"android:textSize="20dp"android:layout_marginRight="15dp"/></LinearLayout></LinearLayout></ScrollView><TextViewandroid:id="@+id/tv_ok"android:layout_width="match_parent"android:layout_height="40dp"android:background="@color/gridview_text_red"android:text="确定"android:gravity="center"android:textSize="@dimen/gridview_text_size"android:textColor="@color/white"/></LinearLayout><com.facebook.drawee.view.SimpleDraweeViewandroid:id="@+id/iv_product_icon"android:layout_width="90dp"android:layout_height="90dp"android:layout_alignTop="@+id/ll_product"android:layout_marginLeft="15dp"android:layout_marginTop="-20dp"android:visibility="visible"fresco:roundBottomLeft="true"fresco:roundBottomRight="true"fresco:roundTopLeft="true"fresco:roundTopRight="true"fresco:roundedCornerRadius="5dip"fresco:roundingBorderColor="@color/line_bg"fresco:roundingBorderWidth="1dip"fresco:actualImageScaleType="centerCrop"fresco:failureImage="@mipmap/ic_default"fresco:failureImageScaleType="centerCrop"/></RelativeLayout>
</LinearLayout>

3、新建dialog弹窗 设置布局 初始化各个控件

int goodsCount = 1;
int specId = 0;
private String desc1 = "", desc2 = "", defaultDesc = "";
private int realStock = 0;
private TagAdapter<TagBean> mSizeTagAdapter1, mSizeTagAdapter2;
private ArrayList<ArrayList<TagBean>> spceList = new ArrayList<>();//所有的二级规格列表的集合
private ArrayList<TagBean> listDesc1 = new ArrayList<>();//一级规格列表
private ArrayList<TagBean> listDesc2 = new ArrayList<>();//选中的一级规格对应的二级规格列表
private AlertDialog dialog;
List<String> data1 = new ArrayList<>();//第一规格名称private void showCatePopupWindow(View view) {dialog = new AlertDialog.Builder(this).create();//生成一个AlertDialog对象dialog.show();//调用AlertDialog的show()方法显示dialog.setCanceledOnTouchOutside(true);View contentView = null;// 一个自定义的布局,作为显示的内容contentView = LayoutInflater.from(this).inflate(R.layout.pop_categary_chose, null);final TextView tvDescTip = (TextView) contentView.findViewById(R.id.tv_desc_tip);final TextView tvPrice = (TextView) contentView.findViewById(R.id.tv_buy_price);ImageView ivClose = (ImageView) contentView.findViewById(R.id.iv_close);final TextView tvStock = (TextView) contentView.findViewById(R.id.tv_stock);final TextView tvChosedDesc = (TextView) contentView.findViewById(R.id.tv_chosed_desc);TextView tvSize1 = (TextView) contentView.findViewById(R.id.tv_size1);TextView tvSize2 = (TextView) contentView.findViewById(R.id.tv_size2);SimpleDraweeView ivProductImage = (SimpleDraweeView) contentView.findViewById(R.id.iv_product_icon);FlowTagLayout flowLayout1 = (FlowTagLayout) contentView.findViewById(R.id.fl_desc1);final FlowTagLayout flowLayout2 = (FlowTagLayout) contentView.findViewById(R.id.fl_desc2);TextView tvReduce = (TextView) contentView.findViewById(R.id.tv_reduce);final TextView tvNumber = (TextView) contentView.findViewById(R.id.tv_number);TextView tvAdd = (TextView) contentView.findViewById(R.id.tv_add);TextView tvOk = (TextView) contentView.findViewById(R.id.tv_ok);llSize1 = (LinearLayout) contentView.findViewById(R.id.ll_size1);llSize2 = (LinearLayout) contentView.findViewById(R.id.ll_size2);Window window = dialog.getWindow();//获取当前的Window对象,然后下面进行窗口属性的设置window.setContentView(contentView);//加载布局,view是填充自定义菜单布局xml 得到的window.setBackgroundDrawableResource(android.R.color.transparent);//这个很重要,将背景设为透明window.setGravity(Gravity.BOTTOM);//这个也很重要,将弹出菜单的位置设置为底部window.setWindowAnimations(R.style.dialog_style);//菜单进入和退出屏幕的动画,实现了上下滑动的动画效果window.setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);//设置菜单的尺寸data1.clear();listDesc1.clear();//一级规格列表listDesc2.clear();//选中的一级规格对应的二级规格列表desc1 = "";//选中的规格一desc2 = "";//选中的规格二spceList.clear();//所有的二级规格列表的集合if (shopGoodsInfoDetailBean.getProduct().getSpecTitle() != null) {llSize1.setVisibility(View.VISIBLE);tvSize1.setText(shopGoodsInfoDetailBean.getProduct().getSpecTitle());for (int i = 0; i < shopGoodsInfoDetailBean.getProduct().getSpecs().size(); i++) {if (!data1.contains(shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue())) {//根据自己的数据进行整理将所有的一级规格筛选出来放到列表中TagBean tagBean = new TagBean();tagBean.setDesc(shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue());if (shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getRealStock() == 0) {tagBean.setTag(1);  //bean类中有个标记  来判断当前规格的库存是否为0 如果为0 tag设为1  则不可点击无法选中 否则设为0 } else {tagBean.setTag(0);}listDesc1.add(tagBean);data1.add(shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue());}}} else {llSize1.setVisibility(View.GONE);}if (!TextUtils.isEmpty(shopGoodsInfoDetailBean.getProduct().getSpecTitle2()) && !shopGoodsInfoDetailBean.getProduct().getSpecTitle2().equals("")) {//判断第二规格是否有 然后才处理第二规格的数据 llSize2.setVisibility(View.VISIBLE);tvSize2.setText(shopGoodsInfoDetailBean.getProduct().getSpecTitle2());for (int j = 0; j < data1.size(); j++) {ArrayList<TagBean> list = new ArrayList<>();for (int k = 0; k < shopGoodsInfoDetailBean.getProduct().getSpecs().size(); k++) {if (data1.get(j).equals(shopGoodsInfoDetailBean.getProduct().getSpecs().get(k).getSpecValue())) {//根据一级规格分别筛选对应的二级规格TagBean tagBean = new TagBean();tagBean.setDesc(shopGoodsInfoDetailBean.getProduct().getSpecs().get(k).getSpecValue2());if (shopGoodsInfoDetailBean.getProduct().getSpecs().get(k).getRealStock() == 0) {tagBean.setTag(1);tagBean.setCheckTag(0);} else {tagBean.setTag(0);tagBean.setCheckTag(0);}list.add(tagBean);}}spceList.add(list);}} else {llSize2.setVisibility(View.GONE);}mSizeTagAdapter1 = new TagAdapter<TagBean>(OtherFragmentGoodsInfoAcitivty.this);//初始adapterflowLayout1.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_SINGLE);flowLayout1.setAdapter(mSizeTagAdapter1);mSizeTagAdapter1.onlyAddAll(listDesc1);if (llSize2.getVisibility() == View.VISIBLE) {listDesc2.addAll(spceList.get(0));mSizeTagAdapter2 = new TagAdapter<TagBean>(OtherFragmentGoodsInfoAcitivty.this);flowLayout2.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_SINGLE);flowLayout2.setAdapter(mSizeTagAdapter2);mSizeTagAdapter2.onlyAddAll(listDesc2);//这一句式添加数据 会自动set数据并刷新布局}//规格1flowLayout1.setOnTagSelectListener(new OnTagSelectListener() {//每种规格点击事件监听@Overridepublic void onItemSelect(FlowTagLayout parent, List<Integer> selectedList) {//ArrayList<TagBean> newList = spceList.get(selectedList.get(0));if (listDesc1.get(selectedList.get(0)).getTag() == 0) {for (int i = 0; i < listDesc1.size(); i++) {if (i == selectedList.get(0)) {listDesc1.get(i).setCheckTag(1);} else {listDesc1.get(i).setCheckTag(0);}}defaultDesc = desc2;if (tvDescTip.getText().toString().equals("请选择规格")) {tvDescTip.setText("已选规格:");}desc1 = listDesc1.get(selectedList.get(0)).getDesc();mSizeTagAdapter1.notifyDataSetChanged();if (llSize2.getVisibility() == View.VISIBLE) {listDesc2.clear();listDesc2.addAll(spceList.get(selectedList.get(0)));for (int i = 0; i < listDesc2.size(); i++) {if (listDesc2.get(i).getTag() != 1) {if (listDesc2.get(i).getDesc().equals(defaultDesc)) {listDesc2.get(i).setCheckTag(1);} else {listDesc2.get(i).setCheckTag(0);}}}mSizeTagAdapter2.onlyAddAll(listDesc2);if (!TextUtils.isEmpty(desc2)) {for (int i = 0; i < shopGoodsInfoDetailBean.getProduct().getSpecs().size(); i++) {if (shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue().equals(desc1) && shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue2().equals(desc2)) {tvStock.setText("库存" + shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getRealStock() + "件");stokes = shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getRealStock();if (isG) {tvPrice.setText("¥" + shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getGroupPrice());} else {tvPrice.setText("¥" + shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getPrice());}break;}}}} else {for (int i = 0; i < shopGoodsInfoDetailBean.getProduct().getSpecs().size(); i++) {if (desc1.equals(shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue())) {tvStock.setText("库存" + shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getRealStock() + "件");stokes = shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getRealStock();if (isG) {tvPrice.setText("¥" + shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getGroupPrice());} else {tvPrice.setText("¥" + shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getPrice());}}}}if (desc2 == "") {tvChosedDesc.setText(desc1);} else {tvChosedDesc.setText(desc1 + "," + desc2);}}}});//规格2flowLayout2.setOnTagSelectListener(new OnTagSelectListener() {@Overridepublic void onItemSelect(FlowTagLayout parent, List<Integer> selectedList) {if (listDesc2.get(selectedList.get(0)).getTag() == 0) {for (int i = 0; i < listDesc2.size(); i++) {if (i == selectedList.get(0)) {listDesc2.get(i).setCheckTag(1);} else {listDesc2.get(i).setCheckTag(0);}}mSizeTagAdapter2.notifyDataSetChanged();if (tvDescTip.getText().toString().equals("请选择规格")) {tvDescTip.setText("已选规格:");}if (selectedList != null && selectedList.size() > 0) {desc2 = listDesc2.get(selectedList.get(0)).getDesc();for (int i = 0; i < shopGoodsInfoDetailBean.getProduct().getSpecs().size(); i++) {if (shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue().equals(desc1) && shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue2().equals(desc2)) {tvStock.setText("库存" + shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getRealStock() + "件");stokes = shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getRealStock();if (isG) {tvPrice.setText("¥" + shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getGroupPrice());} else {tvPrice.setText("¥" + shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getPrice());}break;}}} else {desc2 = "";}tvChosedDesc.setText(desc1 + "," + desc2);}}});tvAdd.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {goodsCount++;tvNumber.setText(goodsCount + "");}});tvReduce.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {if (goodsCount > 1) {goodsCount--;tvNumber.setText(goodsCount + "");}}});tvNumber.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {}});tvOk.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {if (TextUtils.isEmpty(desc1)) {ToastUtil.showToast("请选择规格");} else {if (spceList.size() != 0) {if (TextUtils.isEmpty(desc2)) {ToastUtil.showToast("请选择规格");} else {for (int i = 0; i < shopGoodsInfoDetailBean.getProduct().getSpecs().size(); i++) {if (!desc2.equals("")) {if (shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue().equals(desc1) && shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue2().equals(desc2)) {specId = shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getId();}} else {if (shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue().equals(desc1)) {specId = shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getId();}}}if (stokes == 0) {ToastUtil.showToast("商品已售罄");} else {doRequestOrderInfo();dialog.dismiss();goodsCount = 1;}}} else {for (int i = 0; i < shopGoodsInfoDetailBean.getProduct().getSpecs().size(); i++) {if (shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getSpecValue().equals(desc1)) {specId = shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getId();}}doRequestOrderInfo();dialog.dismiss();goodsCount = 1;}}}});ivProductImage.setImageURI(Uri.parse(AppConstants.BASE_IMAGE_URL + shopGoodsInfoDetailBean.getProduct().getImgUrl()));double price = 0;int stock = 0;if (isG) {for (int i = 0; i < listDesc1.size(); i++) {if (listDesc1.get(i).getTag() == 0) {price = shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getGroupPrice();stock = shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getRealStock();break;}}} else {for (int i = 0; i < listDesc1.size(); i++) {if (listDesc1.get(i).getTag() == 0) {price = shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getPrice();stock = shopGoodsInfoDetailBean.getProduct().getSpecs().get(i).getRealStock();break;}}}tvPrice.setText("¥" + price);tvStock.setText("库存" + stock + "件");stokes = stock;SimpleDraweeView simpleDraweeView = (SimpleDraweeView) contentView.findViewById(R.id.iv_product_icon);ivClose.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {goodsCount = 1;dialog.dismiss();}});}

3.1  TagAdapter


import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;import com.xj.hpqq.huopinquanqiu.R;
import com.xj.hpqq.huopinquanqiu.bean.TagBean;
import com.xj.hpqq.huopinquanqiu.util.SpUtil;
import com.xj.hpqq.huopinquanqiu.widget.flowtaglayout.OnInitSelectedPosition;import java.util.ArrayList;
import java.util.List;/*** Created by HanHailong on 15/10/19.*/
public class TagAdapter<T> extends BaseAdapter implements OnInitSelectedPosition {private final Context mContext;private final List<T> mDataList;public TagAdapter(Context context) {this.mContext = context;mDataList = new ArrayList<T>();}@Overridepublic int getCount() {return mDataList.size();}@Overridepublic Object getItem(int position) {return mDataList.get(position);}@Overridepublic long getItemId(int position) {return position;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {View view = LayoutInflater.from(mContext).inflate(R.layout.tag_item, null);TextView textView = (TextView) view.findViewById(R.id.tv_tag);T t = mDataList.get(position);if (t instanceof TagBean) {textView.setText(((TagBean) t).getDesc());if(((TagBean) t).getTag()==1){//textView.setClickable(false);textView.setBackground(mContext.getResources().getDrawable(R.drawable.tag_nochecked_bg));textView.setTextColor(mContext.getResources().getColor(R.color.tag_textcolor1));}else {//textView.setClickable(true);if (((TagBean) t).getCheckTag() == 1) {//Log.w("=======",((TagBean) t).getDesc()+"");textView.setBackground(mContext.getResources().getDrawable(R.drawable.tag_checked_bg));textView.setTextColor(mContext.getResources().getColor(R.color.white));} else {//textView.setClickable(false);textView.setBackground(mContext.getResources().getDrawable(R.drawable.tag_unchecked_bg));textView.setTextColor(mContext.getResources().getColor(R.color.c_666666));}}}//        if(t instanceof String){
//            textView.setText((String)t);
//        }return view;}public void onlyAddAll(List<T> datas) {mDataList.clear();mDataList.addAll(datas);notifyDataSetChanged();}public void clearAndAddAll(List<T> datas) {mDataList.clear();onlyAddAll(datas);}@Overridepublic boolean isSelectedPosition(int position) {if (position % 2 == 0) {return true;}return false;}
}

3.2 flowtaglayout资源 点击打开链接

Android 购物选择颜色、尺码实现相关推荐

  1. Android 购物选择颜色(尺码)实现(一)

    好久都没写博客了,一直忙于公司的项目,这几天有时间所以写点东西,和大家相互学习一下!写的不好的话,还望见谅! 在公司做的项目一直是有关手机购物方面的,所以就会碰到购买东西时,需要选择商品的颜色.尺码. ...

  2. 仿天猫 购物车(Android studio 仿天猫 详情页面 添加购物车选择 颜色 尺寸demo)

    这是我第一次编写博客,有不好的地方请发邮件或留言告知. 注*请勿转载-转载需博主同意 1.首先就是设计页面了–先效果图 2.现在开始看代码,没有啥好说的 这是布局文件 MainActivity 里面的 ...

  3. android用sku算法仿淘宝选择颜色分类弹框。

    当规格超出边界会自动换行,点击规格会根据算法判断关联规格,无则灰显,全部选中后则变化图片.代码是kotlin和java混合. 效果如下,当一行显示不下所有规格时,会自动换行.用的夜神模拟器,分辨率有点 ...

  4. Android上一种用于选择颜色的控件(颜色选择器)

    目录 引言 核心代码 控件整体代码 demo 引言 最近在做一个项目时其中有一个需求–自定义灯光颜色.要求通过手机端控制灯光颜色,手机端预设五种颜色及用户可自定义颜色.在百度上搜索找到一个开源的色环控 ...

  5. 爱上Android之选择您的开发工具

    本文摘自人民邮电出版社异步社区<爱上Android> 京东地址:item.jd.com/12144527.ht- 试读地址:www.epubit.com.cn/book/detail- 第 ...

  6. android double比较大小吗,Android双向选择控件DoubleSeekBar使用详解

    本文实例为大家分享了Android双向选择控件DoubleSeekBar的使用方法,供大家参考,具体内容如下 先看效果图 1.DoubleSlideSeekBar public class Doubl ...

  7. android色温选择控件,ColorPicker

    软件简介 ColorPicker 一款标准的Android颜色选择器,使用HSV和透明度选择颜色. Gradle dependencies { implementation 'com.github.d ...

  8. Android 城市选择万能控件

    Android 城市选择万能控件 Android 城市选择万能控件,选择城市,选择汽车品牌等等,支持按照a-z.# 排序等的选择控件,废话不多说直接上效果图: (开的Android模拟器录得gif,有 ...

  9. 服装盘点机在服装行业颜色尺码仓库条码高效管理中的应用

    服装行业的商品管理的特点是需要管理颜色和尺码 具体逻辑就是: 什么商品,什么颜色,什么尺码,入库多少个? 什么商品,什么颜色,什么尺码,出库多少个? 什么商品,什么颜色,什么尺码,还有库存多少个? 如 ...

  10. java 选择 颜色的控件_JavaFX颜色选择器(ColorPicker)

    颜色选择器控件允许用户从可用的颜色范围中选择颜色,或通过指定RGB或HSB组合设置其他颜色.JavaFX ColorPicker控件具有颜色选择器,调色板和自定义颜色对话框窗口. 创建ColorPic ...

最新文章

  1. android 根目录缓存,Android系统中内部存储和外部存储(公有目录、私有目录、缓存目录)详解...
  2. Idiomatic Python手记一: average in FP way
  3. C语言中volatilekeyword的作用
  4. bzoj1095: [ZJOI2007]Hide 捉迷藏 动态点分治学习
  5. Elastic Nodes Example 翻译及学习整理
  6. python做自动化测试的优点_乐搏讲自动化测试-python语言特点及优缺点(5)
  7. python控制画笔尺寸,Python画笔的属性及用法详解
  8. numpy 随机数_数据分析numpy基础看着一篇就够了
  9. python自由职业可以做什么_我想成为自由职业者,但不知道做什么?
  10. ionic4 打包ios_学习Ionic 4并开始创建iOS / Android应用
  11. 云服务器一般选什么系统,云服务器一般选择什么系统好
  12. 【软件测试从入门到放弃】熟悉阶段:软件测试流程
  13. 字符、字符集和字符编码详解(一文扫清疑惑)
  14. gitlab 使用现有 nginx 服务器
  15. JAVA提取字符串信息中的数字(包括整数,小数)工具类
  16. 沟通CTBS助华盛集团实现财务集中管理
  17. Kali Linux 1.0 新手折腾笔记(2013.3.21更新)
  18. [NDK]-搭建ndk-build环境
  19. seo入门需掌握的基础知识
  20. About norms(范数)

热门文章

  1. docker stop 失败处理方法
  2. 南京商品住宅全装修新政:毛坯、装修价格分别备案
  3. 错误记录:FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecate
  4. 【软件介绍】IGV软件的安装和基本介绍
  5. Super Socks5cap使用教程
  6. 电子签名、私钥、公钥
  7. 没有投屏标志怎么投屏_没有【TV】小图标,手机怎么投屏电视
  8. Dell R640服务器centos系统增加万兆网卡设置
  9. 2014年三维地理信息系统 研究成果
  10. 图嵌入中节点如何映射到向量