Search code examples
androidandroid-activitynumberpicker

how to set point one variants difference in NumberPicker in android as mention below ?


how to set point one variants difference in NumberPicker in android?

can any one help?


Solution

  • You can use this library for this purpose it was very handy to me. Particularly this sample will help to do it. This method should do it:

    setDecimalVisibility(View.VISIBLE)
    

    Common dialog:

    NumberPickerBuilder npb = new NumberPickerBuilder()
                                .setFragmentManager(getSupportFragmentManager())
                                .setStyleResId(R.style.BetterPickersDialogFragment_Light)
                                .setPlusMinusVisibility(View.INVISIBLE)
                                .setDecimalVisibility(View.VISIBLE)
                                .setReference(BUTTON_ONE_REFERENCE)
                                .setLabelText("LBS.");
                        if (mMin != null) {
                            npb.setMinNumber(mMin);
                        }
                        if (mMax != null) {
                            npb.setMaxNumber(mMax);
                        }
                        npb.show();