The YesNo dialog can be used to let the user confirm a specific action.
ynd = app.CreateYesNoDialog(
→ app object:
Its the equivalent to the js confirm function, but it is more customizable. (and doesn't crash when aborting
Example - Basic
ynd = app.CreateYesNoDialog( "Choose an answer" );
ynd.SetOnTouch( Ynd_OnTouch );
function Ynd_OnTouch( result )
app.Alert( result, "Result" );
The following methods are available on the YesNoDialog object:
hexadecimal: “#rrggbb”, “#aarrggbb”
colourName: “red”, “green”, ...
string: path to file or folder ( “/absolute/...” or “relative/...” )
string: comma “,” separated: “NoDim”, “NoFocus”, “TouchModal”
string: “px” or “sp” or “dip” or “dp” or “mm” or “pt”
Adjust the visual color effect of the control by setting the Hue (by angle in degrees in a color circle), the saturation, brightness and contrast of the control.
Hide the control and remove it from the screen.
Returns the control class name.
Hide the control but keep the layout space free.
Allows access to other functions defined on the object in Java via reflection.
Note: This function is a premium feature. Please consider subscribing to Premium to use this feature and support DroidScript in its further development.
Changes the background color of the control.
Changes the background to an image which can be repeated using the repeat option.
An image which is often used with that option is '/res/drawable/pattern_carbon' - try it out!
Changes the texts of the two Yes/No buttons.
Define a callback function which is called when the user touches one of the buttons, passing either “Yes” or “No” to the callback function
Change the size of the control in either screen relative values or in pixels if the px option was given.
Set the visibility of the control to “Show”.