i like to look at other people source to learn new tricks.
just some preliminary thoughts after a quick glance:
1) it's surprisingly compact
2) you don't use comments at all: it's your usual style or you just cleared them before publishing?
3) you created ModernToggle with all the designer properties, but you actually did not use designer to create the main layout: what is the choice behind that?
4) you did not use B4XPages at all: that would have allowed a port to mobile platforms, even if that would require converting all java-specific code to B4XView attributes (i.e. "-fx-font-size: 15;-fx-font-weight: bold;-fx-text-fill: " for example)
I'm not criticizing your work, just tech curiosity