Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim sweet As SweetAlertDialog
Dim t As Timer
Dim count As Int
Dim helper As ProgressHelper
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
count = 0
t.Initialize("Timer",200)
sweet.Initialize("Alert")
sweet.AlertType = sweet.TypeProgress
' Get Progresshelper object.
' With the ProgressHelper you can change the Properties
' of the ProgressWheel. Start, stop spinning and so on...
helper = sweet.ProgressHelper
End Sub
Sub Activity_Resume
sweet.showCancelButton(True).showContentText(True).withCancelText("Not yet").withConfirmText("Yo man").withContentText("Bla bla bla bla").withTitleText("DonManfred present").show
t.Enabled = True
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Alert_onCancel()
Log($"Alert_onCancel()"$)
sweet.AlertType = sweet.TypeError
'sweet.withContentText("BLA bla BLA bla BLA")
sweet.dismissWithAnimation
End Sub
Sub Alert_onConfirm()
Log($"Alert_onConfirm()"$)
sweet.dismissWithAnimation
End Sub
Sub Timer_Tick
count = count +1
If count < 100 Then
sweet.withContentText($"Downloadfinished... ${count}"$)
Else
sweet.withContentText($"Downloading finished!"$)
sweet.AlertType = sweet.TypeSuccess
t.Enabled = False
End If
End Sub