#Region Project Attributes
#ApplicationLabel: CoverLoadingView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim t1, t2 As Timer
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private clv1, clv2 As CoverView
Dim bm1, bm2 As Bitmap
Dim cnt1, cnt2 As Int = 0
Private b1, b2 As Button
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("main")
t1.Initialize("t1", 100)
t2.Initialize("t2", 200)
bm1.Initialize(File.DirAssets,"cover.png")
bm2.Initialize(File.DirAssets,"cover2.png")
clv1.ShadowColor = 0x99000000
clv1.CoverViewBitmap = bm1
clv1.Progress = 0
clv2.ShadowColor = 0x99000000
clv2.CoverViewBitmap = bm2
clv2.Progress = 0
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
t1.Enabled = False
t2.Enabled = False
End Sub
Sub t1_tick
cnt1 = cnt1 + 1
If cnt1 < 101 Then
Log("clv1 progress = " & cnt1)
clv1.Progress = cnt1
Else
clv1.Progress = 101 'force finish
End If
End Sub
Sub t2_tick
cnt2 = cnt2 + 1
If cnt2 < 101 Then
Log("clv2 progress = " & cnt2)
clv2.Progress = cnt2
Else
clv2.Progress = 101 'force finish
End If
End Sub
Sub clv1_progress_completed
clv1.resetValues
t1.Enabled = False
Log("clv1 done")
End Sub
Sub clv1_progress_paused
Log("clv1 paused")
t1.Enabled = False
End Sub
Sub clv1_progress_resumed
Log("clv1 resumed")
t1.Enabled = True
End Sub
Sub clv2_progress_completed
clv2.resetValues
t2.Enabled = False
Log("clv2 done")
End Sub
Sub clv2_progress_paused
Log("clv2 paused")
t2.Enabled = False
End Sub
Sub clv2_progress_resumed
Log("clv2 resumed")
t2.Enabled = True
End Sub
Sub b1_Click
clv1.Progress = 0
t1.Enabled = True
End Sub
Sub b2_Click
clv2.Progress = 0
t2.Enabled = True
End Sub