Home

Awesome

NumberPicker

demo

Installation

Add the following dependency to your module's build.gradle:

compile 'biz.borealis.numberpicker:NumberPicker:1.0.1'

How to use it

<biz.borealis.numberpicker.NumberPicker
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
    

XML Attributes

<biz.borealis.numberpicker.NumberPicker
    ...
    xmlns:app="http://schemas.android.com/apk/res-auto"
    app:np_min_number="1"
    .../>
NameTypeDefault
np_min_numberinteger0
np_max_numberinteger100
np_text_size_selecteddimension48sp
np_text_sizedimension36sp
np_text_color_selectedcolor#d6000000
np_text_colorcolor#8a000000
np_fade_text_colorbooleantrue
np_animate_text_sizebooleantrue

Interface

    NumberPicker numberPicker = (NumberPicker) findViewById(R.id.np);
    numberPicker.setOnValueChangeListener(new OnValueChangeListener() {
        @Override
        public void onValueChanged(int newValue) {
        }
    });