Dialog objects using the Alert, CreateYesNoDialog, CreateListDialog, CreateBottomSheetList and CreateDialog, CreateBottomSheet methods of the Support object:
All dialog objects support NoDim and NoCancel
sup.Alert( text, title, button text, options );
Example - Alert
app.LoadPlugin( "Support" );
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
sup = app.CreateSupport();
btn = app.CreateButton( "Show" );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
sup.Alert( "I am content text", "I am title", "Close" );
}
sup.CreateYesNoDialog( text, title, options );
Example - Yes No Dialog
app.LoadPlugin( "Support" );
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
sup = app.CreateSupport();
btn = app.CreateButton( "Show" );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
yn = sup.CreateYesNoDialog( "I am content text", "I am title" );
yn.SetOnTouch( yn_OnTouch );
yn.Show();
}
function yn_OnTouch( index )
{
app.ShowPopup( index );
}
sup.CreateListDialog( list, title, options );
Example - List Dialog
app.LoadPlugin( "Support" );
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
sup = app.CreateSupport();
btn = app.CreateButton( "Show" );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
yn = sup.CreateListDialog( "Item 1,Item 2,Item 3,Item 4,Item 5", "Items" );
yn.SetOnTouch( yn_OnTouch );
yn.Show();
}
function yn_OnTouch( itm )
{
app.ShowPopup( itm );
// yn.Dismiss();
}
sup.CreateBottomSheetList( list, title, options );
Example - Bottom Sheet List
app.LoadPlugin( "Support" );
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
lay.SetBackColor( "#FAFAFA" );
sup = app.CreateSupport();
btn = app.CreateButton( "Show" );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
yn = sup.CreateBottomSheetList( "Item 1,Item 2,Item 3,Item 4,Item 5", "Items" );
yn.SetOnTouch( yn_OnTouch );
yn.Show();
}
function yn_OnTouch( itm )
{
app.ShowPopup( itm );
// yn.Dismiss();
}
sup.CreateCustomDialog( width, height, options );
Example - Custom Dialog
app.LoadPlugin( "Support" );
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
sup = app.CreateSupport();
btn = app.CreateButton( "Show" );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
dlg = sup.CreateDialog();
layd = app.CreateLayout( "Linear","VCenter,FillXY" );
dlg.AddChild( layd );
lst = app.CreateList( "Item 1,Item 2,Item 3,Item 4,Item 5", null, null, "menu" );
lst.SetBackColor( "#EEEEEE" );
layd.AddChild( lst );
dlg.Show();
}
sup.CreateBottomSheet( width, height, options );
Example - Bottom Sheet
app.LoadPlugin( "Support" );
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
sup = app.CreateSupport();
btn = app.CreateButton( "Show" );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
bs = sup.CreateBottomSheet();
layb = app.CreateLayout( "Linear","VCenter,FillXY" );
bs.AddChild( layb );
lst = app.CreateList( "Item 1,Item 2,Item 3,Item 4,Item 5", null, null, "menu" );
lst.SetBackColor( "#EEEEEE" );
layb.AddChild( lst );
bs.Show();
}
All dialog objects support animations show animation types
dlgs.ShowAnim( animation );
dlgs.DismissAnim( animation );
Example - Show and Dismiss Animations
app.LoadPlugin( "Support" );
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
sup = app.CreateSupport();
anim = sup.AnimationManager();
btn = app.CreateButton( "Show" );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
yn = sup.CreateYesNoDialog( "I am content text", "I am title" );
yn.ShowAnim( anim.NewsPaper() );
yn.DismissAnim( anim.FadeOut() );
yn.Show();
}
function yn_OnTouch( index )
{
if( index == 1 ) app.ShowPopup( "No" );
else app.ShowPopup( "Yes" );
}
The following methods are available on the Dialog objects:
GetType()
Show()
ShowAnim( anim )
Dismiss()
DismissAnim( anim )
SetSize( width, height )
The following methods are available on the Yes/No Dialog objects:
SetButtonText( No, Yes );
SetTitleSize( size );
SetTitleColor( color );
SetTextSize( size );
SetTextColor( color );
SetCornerRadius( radius );
The following methods are available on the List Dialog objects:
SetCornerRadius( radius );
SetDividerColor( color );
SetDividerHeight( height );
SetItemPressColor( color );
SetItemTextColor( color );
SetTitleTextSize( size );
SetTitleTextColor( color );
The following methods are available on the Bottom Sheet List objects:
SetCornerRadius( radius );
SetDividerColor( color );
SetDividerHeight( height );
SetItemPressColor( color );
SetItemTextColor( color );
SetTitleTextSize( size );
SetTitleTextColor( color );
SetButtonTextSize( size );
SetButtonTextColor( color );
SetButtonText( text );
The following methods are available on the Bottom Sheet and Dialog objects:
AddChild( child );
FLYCODialog an Android Dialog Lib simplify customization. Support 2.2+. go github page