Progress Button
Need easy way to refelect all the button states?
Progress Button is a android library for hanling different types state like active, finished, enabled, disabled and reset with a single line of code.
? Demo
? Features
- One line of code to change state
- Easy configurable
- Customizable
- Set vibration on click
- Disable views in active state
?️ Installation Steps
? Usage
In XMl you need to define the button with your parameters to acheive the desired the design
Notes -
- To use vibration on click please add the following permission in android manifest
Here is the sample code
Color Parameters
Explanation | Parameter Name | Type | Default Value |
---|---|---|---|
Set Default Color | default_color | color | #0052FE |
Set Disabled Color | disabled_color | color | #537CD3 |
Set Pressed Color | pressed_color | color | #0845D1 |
Set Finished Color | finished_color | color | #27AE60 |
Set Ripple Color | ripple_color | color | @android:color/transparent |
Set Text Color | btn_text_color | color | #FFFFFF |
Set Stroke Color | stroke_color | color | @android:color/transparent |
Text Parameters
Explanation | Parameter Name | Type | Default Value |
---|---|---|---|
Set Default Text | default_color | text | Button |
Set Finished Text | finish_text | text | Finish |
Set Text Size | btn_text_size | dimension | 14sp |
Vibration Parameters
Explanation | Parameter Name | Type | Default Value |
---|---|---|---|
Is Vibration enabled | is_vibrate | boolean | false |
Set Vibration time in (ms) | finish_text | integer | 30 |
Misc Button Parameters
Explanation | Parameter Name | Type | Default Value |
---|---|---|---|
Set Stroke Width | stroke_width | dimension | 0dp |
Set Corner Radius | corner_radius | dimension | 10dp |
Set Button Elevation | btn_elevation | dimension | 0dp |
Here is the code sample to understand on how to change the button state
? You are all set!