Android-SwitchIcon
Google launcher-style implementation of switch (enable/disable) icon.
Compatibility
This library is compatible from API 15 (Android 4.0.3).
Download
Add it in your root build.gradle at the end of repositories:
Add the dependency
Usage
SwitchIconView extends from AppCompatImageView so you can set icon with app:srcCompat
Set any icon (vector or image) to SwitchIconView and enjoy switchable icon in your app :)
Use app:si_tint_color
to set color to icon. Default color is black;
Use app:si_disabled_color
to set color when icon disabled. Default color is equals with app:si_tint_color
;
Use app:si_disabled_alpha
to set alpha when icon disabled. Default alpha is .5
;
Use app:si_no_dash
if you don't want to draw dash, when icon disabled;
Use app:si_animation_duration
if you want to change switching state animation duration;
Use app:si_enabled
to set initial icon state;
Fully customized implementation:
Public methods: