Git Product home page Git Product logo

addsubnumberpicker's Introduction

AddSubNumberPicker

基本介绍

AddSubNumberPicker是一个左减右加的数字选择器,常用于购物车列表等情景。

功能

  • 数量加减        
  • 设置数量限制规则:
    • 不能为0 - 不能小于0
    • 不能大于最大数(自己设置)
    • 不能小于最小数(自己设置)        
  • 数量变化CallBack 当数量发生变化时,提供回调处理其他业务逻辑接口。

使用方法

gradle中添加compile project(':add_sub_number_picker_library')

在layout文件中添加com.ithaibo.library.AddSubNumberPicker,例如:

           android:id="@+id/picker"
           android:layout_width="200dp"
           android:layout_height="wrap_content"
           android:layout_centerInParent="true"
           android:layout_marginLeft="30dp"/>

设置类型、提示内容:

    picker.setTypeCountLimitAndToasLimittStr(AddSubNumberPicker.TYPE_UNSIGN_NUMBER, "不能小于0");
        //设置CountChangeListner:
                picker.setCountChangeListner(new AddSubNumberPicker.CountChangeListner() {
                    @Override
                    public void onCountChanged(int count) {
                        Log.d("MainActivity", "count changed, count = "+count);
                    }
                });

addsubnumberpicker's People

Contributors

ithaibo avatar

Stargazers

BaiShu avatar  avatar ChenFuduo avatar

Watchers

James Cloos avatar  avatar

Forkers

androidtheworld

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.