; MaterialSB Example - Toast ; This example demonstrates the toast notification system IncludeFile "MaterialSB.sbi" EnableExplicit Procedure ShowBasicToast() MaterialSB::Toast("Hello! This is a simple toast.") EndProcedure Procedure ShowRoundedToast() MaterialSB::Toast("This toast has rounded corners.", 4000, MaterialSB::#Toast_Rounded) EndProcedure Procedure ShowColoredToast() MaterialSB::Toast("Success! Operation completed.", 4000, MaterialSB::#Toast_Default, MaterialSB::#Color_Green) EndProcedure Procedure ShowLongToast() MaterialSB::Toast("This toast will stay visible for 8 seconds.", 8000) EndProcedure Procedure DismissAll() MaterialSB::ToastDismissAll() EndProcedure Procedure Main(Result) Protected t UseModule MaterialSB SetDarkTheme(#False) ; Navbar Navbar(#Navbar_Shadow1 | #Navbar_Container) NavbarAddLogo("Toasts") Row(#Grid_Container) Col(12) Append("

Toast Component

") Append("

Toasts provide brief messages about app processes at the bottom of the screen.

") Append("
Toast Examples
") Button("Basic Toast", @ShowBasicToast()) Button("Rounded Toast", @ShowRoundedToast(), #Button_Tonal) Button("Colored Toast", @ShowColoredToast(), #Button_Outlined) Button("Long Duration (8s)", @ShowLongToast(), #Button_Text) AddClass(Button("Dismiss All", @DismissAll()), #Color_Red) CloseCurrentParent() Col(12) Append("

") Append("
Toast Flags
") t = Table("Flag", #Table_Striped | #Table_Highlight) TableAddColumn("Description", t) TableAddItem("#Toast_Default" + Chr(10) + "Standard toast notification", t) TableAddItem("#Toast_Rounded" + Chr(10) + "Toast with rounded corners", t) Append("
") Append("
Usage
") Append(~"
Toast(Text.s, Duration = 4000, Flags = #Toast_Default, Color.s = \"\")
") Append("

The Duration parameter specifies how long the toast is displayed in milliseconds.

") CloseCurrentParent(2) AutoInit() UnuseModule MaterialSB EndProcedure MaterialSB::Download(@Main()) ; IDE Options = SpiderBasic 3.10 (Windows - x86) ; CursorPosition = 7 ; Folding = -- ; iOSAppOrientation = 0 ; AndroidAppCode = 0 ; AndroidAppOrientation = 0 ; EnableXP ; DPIAware ; CompileSourceDirectory