B4A Library [B4X] [XUI] FlipSwitch

FlipSwitch v1.00

My first attempt to create a CustomView.
It support B4A and B4J.
I can't make test for B4i so I left it out.
If someone can add the support for B4i then please I kindly ask him/her to contact me to update this post with the new version.
I want to Thank @LucaMs for giving me the will to do it and the beginning idea.
It's simply yet another ON/OFF switch.

FlipSwitch.gif


It feature a flap that got animated to change the state of the switch.
The colors (green and red) are fixed as they are images.

Features:
- Set the Initial Value (green or red)
- Customizable flipping speed
- Customizable text, text size and text color on both sides
- Value can be read or changed by code
- Size can be changed by code (max width as been set to 140dip to maintain graphic acceptable, larger size will be reduced to 140dip automatically)
- Left, Top, Right, Bottom, Width and Height are exposed and can both be read or changed by code
- ValueChanged Event is raised at every flip

Normally everything it's expected to be set from the Designer.
Feel free to leave a comment.
Thank You All!

ChangeLog:
Version 1.00
- Initial Release
 

Attachments

  • FlipSwitch_Demo.zip
    15.3 KB · Views: 40
  • FlipSwitch.b4xlib
    49 KB · Views: 44
Top