Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Gallery As PhotoGallery
Dim fromWeb() As String, posSelected As Int
Dim gTrack As AnalyticsTracker
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")
'setup gallery
Gallery.Initialize("Gallery")
Activity.AddView(Gallery, 0, Main.PhHeight, 100%x, 90%y-Main.PhHeight)
'Gallery.ClearCache 'dibersihkan dulu memory
Gallery.CreateCache="Cacche New"
Gallery.TextSize = 16
Gallery.TextColor = Colors.Yellow
Gallery.ShowText = False
Gallery.ItemWidth = 300
Gallery.ItemHeight = 200
Gallery.Spacing = 50
'*************************************
Gallery.ScaleType = Gallery.ScaleType.Center_Crop
Gallery.SetNoEffect = False
Gallery.SetBorderColor=Colors.Yellow
Gallery.SetCornerRadius = 10
Gallery.SetBorderWidth = 2
Gallery.SetOval = False
'loop buat bikin array
Dim Kepala As String
Log(Main.Halaman)
For i=1 To Main.Halaman
If i<10 Then Kepala="00"
If i>=10 AND i<100 Then Kepala="0"
If i>100 Then Kepala=""
Gallery.AddImageFromWebAt(i-1, Main.LokasiURLIklan & Kepala & i & ".JPG")
Next
If posSelected > Gallery.Length Then
posSelected = Gallery.Length-1
End If
Gallery.Selection = posSelected
End Sub