Sub Class_Globals
'Globals
Private mCallBack As Object 'ignore
Private mEventName As String 'ignore
Public Message As String
Public doBeep As Boolean = False
' Objects
Public mBase As B4XView
Private xui As XUI 'ignore
Public Tag As Object
Public Label As Label
Public APNG As APNGView
Private signal As Beeper
Private timer As Timer
End Sub
'## Function: Initialize Globals + Objects
'## Parameter: Callback (Root), Eventname (unique custom view name)
'## Return: -
'## Remarks: callback and eventname set automatically
'## Sub called after load of custom view automatically
'## Tested: 2023/12/2 Version: wip()
Public Sub Initialize (Callback As Object, EventName As String)
' Globals
mEventName = EventName
mCallBack = Callback
' Objects
Label.Initialize("label")
signal.Initialize(300,300)
timer.Initialize("tmr", 1000)
APNG.Initialize(mCallBack,"apng")
End Sub
#end region
'###############################################
#region Base
'## Function: Create View
'## Parameter: -
'## Return: -
'## Remarks: -
'## Tested: 2023/12/2 Version: wip()
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
mBase = Base
Tag = mBase.Tag
mBase.Tag = Me
' customize and add label
Label.Width = mBase.Width
Label.Height = mBase.Height
Label.Padding = Array As Int(5dip,5dip,5dip,5dip)
mBase.AddView(Label,0,0,Label.Width,Label.Height)
APNG.SetData(File.ReadBytes(File.DirAssets, "rolling.apng"))
APNG.mBase.Width = Label.Height - 10dip
APNG.mBase.Height = APNG.mbase.width
APNG.mbase.top = Label.Top
APNG.mBase.Left = 0
APNG.mBase.Visible=False
APNG.mBase.BringToFront
mBase.AddView(APNG.mBase,Label.Width/2 -10dip - APNG.mBase.Width/2,5dip,APNG.mBase.Width,APNG.mBase.Height)
End Sub