Behavior change on state listener, rename to OnStateChangeListener. So you can listen state change using method setOnStateChangeListener() with value SlidingButton.OnStateChangeListener.
Change state rename to slidingButton.changeState(active,animated)
Additional listener when button sliding. You can now listen it using method setOnSlidingListener() with value SlidingButton.OnSlidingListener. For example :
-
Java
slidingButton.setOnSlidingListener(new SlidingButton.OnSlidingListener{ @Override public void onChange(float progress){ // do what you wanna do } });
-
Kotlin
slidingButton.setOnSlidingListener { progress -> // do what you wanna do }
Additional features like text alpha when sliding the button, track indicator and corner radius (especially for API 21). You can set using attributes like the following :
-
app:sliding_enabledTextAlphaUse to alpha text when sliding, value of this attribute Boolean. Default value true
-
app:sliding_showTrackUse to show track indicator when sliding, value of this attribute Boolean. Default value false
-
app:sliding_trackBackgroundUse to set track indicator background.
-
app:sliding_trackBackgroundTintUse to set tint track indicator background.
-
app:sliding_trackExtendToUse to set track extended to
containerorbutton -
app:sliding_corner_radiusonly on API level 21 (Lollipop)
Add method to change status programmatically. So you can change status use method changeStatus(active,animated) as you needed
Linked to jcenter(), Now not need to add maven url to repositories build.gradle project level.
If you still using v1.0.0, should add maven url to repositories build.gradle project level
repositories {
...
maven { url 'https://dl.bintray.com/ss564/SlidingButton' }
...
}Slide button library for android, we hope this library is useful and easy to customize as you needed.
First launch as pre-release version
Note : Don't use this version, coz we have an missed configuration, so this version can't be used