Elegant Number Button
A simple Android library to implement a number counter with increment and decrement buttons.
Screens
Download
Grab the latest version on gradle using
or on maven
Usage
For Working implementation of this library check ElegantNumberButtonSample App
-
Just include the view as you do with any android widget.
-
Implement it in your java code as anyother widget.
-
To get the number simply call
getNumber()
method on the button object. -
To get the number from the button as soon as the button is clicked add a
setOnClickListener
to the view. -
Or use a valueChangeListener to listen for changes in value.
Customization
backgroundColor
: Set button Background color
initialNumber
: Set initial number for the button.
finalNumber
: Set final number range for button.
textColor
: Modify the text color of the button.
textSize
: Change text size of the button.
backgroundDrawable
: Add drawable background for the button.
Methods
setNumber(Integer number)
: Update the number of the widget.
setRange(Integer startNumber, Integer finalNumber)
: Set the operational range for the widget
setOnValueChangeListener(OnValueChangedListener listener)
: listen for changes in the value
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
Changelog
Version 1.0.2
- Added ValueChangeListener to listen for changes in values
Version 1.0.1
- Added Range for the widget
- Changed attribute from initialText to initialNumber
Version 1.0
- Initial Release
Author
- Ashik Vetrivelu - vcashik@gmail.com