#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
'Declaration of constants
'Declaration of variabels
Private mWindow As RSStandOutWindow
Private mConstants As RSStandOutConstants
Private mFlags As RSStandOutFlags
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
mWindow.Initialize("Window")
Main.StandOut.Show(mWindow.UniqueId)
End Sub
Sub Service_Destroy
End Sub
' ! --------------- ! - EVENTS - ! --------------- !
'Do NOT call the events below.
'The methods below are called from the library and returns info back to it.
Sub Window_Initialize (Id As Int, Window As RSStandOutWindow) As RSStandOutLayoutParams
Dim params As RSStandOutLayoutParams
params.Initialize4(Id, 400, 300, mConstants.AUTO_POSITION, mConstants.AUTO_POSITION, 100, 100)
Return params
End Sub
'Create a panel and add it to the frame.
Sub Window_CreateAndAttachView (Id As Int, Frame As RSFrameLayout) As Panel
Dim Content As Panel
Content.Initialize("Content")
Frame.AddView(Content, 400, 300)
Dim btn As Button
btn.Initialize("Button")
btn.Text = "Test"
Content.AddView(btn, 0dip, 0dip, Frame.Width, 48dip)
Return Content
End Sub
'Returns the name of the Window.
Sub Window_AppName As String
Return "RSStandOut Example"
End Sub
'Returns the icon of the window.
Sub Window_AppIcon As String
Return "icon"
End Sub
'Return a list of flags
Sub Window_Flags (Id As Int) As List
Dim flags As List
flags.Initialize
flags.Add(mFlags.FLAG_DECORATION_SYSTEM)
flags.Add(mFlags.FLAG_BODY_MOVE_ENABLE)
flags.Add(mFlags.FLAG_WINDOW_HIDE_ENABLE)
flags.Add(mFlags.FLAG_WINDOW_BRING_TO_FRONT_ON_TAP)
flags.Add(mFlags.FLAG_WINDOW_EDGE_LIMITS_ENABLE)
flags.Add(mFlags.FLAG_WINDOW_PINCH_RESIZE_ENABLE)
Return flags
End Sub
Sub Window_PersistentNotificationTitle(Id As Int) As String
Return "RSStandOut Example Running"
End Sub
Sub Window_PersistentNotificationMessage(Id As Int) As String
Return "Click to add a new RSStandOut example"
End Sub
Sub Window_PersistentNotificationIntent(Id As Int) As Intent
Return Main.StandOut.getShowIntent(mWindow.UniqueId)
End Sub
Sub Window_HiddenIcon As String
Return "icon"
End Sub
Sub Window_HiddenNotificationTitle(Id As Int) As String
Return "RSStandOut Example Hidden"
End Sub
Sub Window_HiddenNotificationMessage(Id As Int) As String
Return "Click to restore # " & Id
End Sub
Sub Window_HiddenNotificationIntent(Id As Int) As Intent
Return Main.StandOut.getShowIntent(Id)
End Sub
'Data = bundle (Use JavaObject)
Sub Window_ReceiveData (Id As Int, RequestCode As Int, Data As Object, FromId As Int)
Log("Data received from id: " & Id)
End Sub