Toggle

Introduction

Toggle will switch (toggle) between the Down and Up states each time the button is pressed and released: It behaves as a On / Off electric switch.
 

For examples, instal the 'Buttons' Tutorial app, available in your Dashboard.
Click here to install
Tutorial App 'Buttons'
 
 


Toggle Settings



  Configuration & Events settings from Buttons Tutorial App




Initial State: Button Up

The initial state is Button Up.

That means that when you push the Button once, it will:

-  Switch state from Button Up to Button Down
 -  
If you supplied a Selected Image the Selected image will show

 Fire the ON  Event


State Change: Button Down 

When you press the Button a second time, it will:

-  Go from Button Down back to Button up state

-  Unselected image will replace the Selected image

-  Fire the Button Up Event


And so on

The Toggle Button will continue between an On / Off state firing alternatively the Button Down and Button Up Event.

UI Behavior
Because this is a toggling button, and consistent with standard UI design principles, the state itself doesn't change until the touch is released while your finger is still inside the button.

If you were to press down and move off the button, releasing your finger should not cause the state to change.
This allows the user to cancel the selection if so desired.
If your finger is released inside the button, the state is then changed and the appropriate event for the state is then triggered.
Play/Pause button on an audio or video player is a typical use-case for a toggling button.
 

Note

Because this is a toggling button, and consistent with standard UI design principles, the state itself doesn't change until the touch is released while your finger is still *inside* the button.  If you were to press down and move off the button, releasing your finger *should not* cause the state to change. This allows the user to cancel the selection if so desired.



Limitations

Images:  It is recommended to use Image stored in

  • Media Folder 
  • Local File System (this is done using an On Device SQL DB and storing the data on device)

Useful

Many Blocks can be used to create a Button, check out how to create a Button for more.


Learn More

How to create a Button

What is an Event?
What is an Action?