Sub Process_Globals
Private PreviouslySelectedColor() As Object
Private xui As XUI
End Sub
Sub Globals
Dim dialog As B4XDialog
Dim ColorTemplate As B4XColorTemplate
End Sub
Sub Activity_Create(FirstTime As Boolean)
dialog.Initialize(Activity)
ColorTemplate.Initialize
If PreviouslySelectedColor.Length > 0 Then
ColorTemplate.SelectedHSVColor = PreviouslySelectedColor
End If
End Sub
Sub Activity_Click
Wait For (dialog.ShowTemplate(ColorTemplate, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Activity.Color = ColorTemplate.SelectedColor
PreviouslySelectedColor = ColorTemplate.SelectedHSVColor
End If
End Sub