#Region Project Attributes
#ApplicationLabel: CarouselView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#AdditionalRes: ..\Resources
#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.
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 cv1 As CarouselView
Dim bm As Bitmap
Dim blist As List 'images to be passed to the library via this list
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")
blist.Initialize 'initialize an empty list
bm.Initialize(File.DirAssets, "image_1.jpg")
blist.Add(bm) 'add the image to the list
bm.Initialize(File.DirAssets, "image_2.jpg")
blist.Add(bm)
bm.Initialize(File.DirAssets, "image_3.jpg")
blist.Add(bm)
bm.Initialize(File.DirAssets, "image_4.jpg")
blist.Add(bm)
bm.Initialize(File.DirAssets, "image_5.jpg")
blist.Add(bm)
cv1.ImageBitmaps = blist 'pass the list with images to the library
cv1.Radius = 10 'the radius of the indicator circles
cv1.StrokeColor = Colors.Magenta 'the outline color of the circles
cv1.StrokeWidth = 5 'the width of the outline circles
cv1.FillColor = Colors.White 'the color to fill the circles with - active page/image
cv1.AutoPlay = True 'play automatically?
cv1.CurrentItem = 0 'set the indeks of where to initially start from: 0 to (number of image - 1)
cv1.DisableAutoPlayOnUserInteraction = True 'stop auto play if image is touched during autoplay
cv1.Orientation = cv1.ORIENTATION_HORIZONTAL 'can also be ORIENTATION_VERTICAL in which case it will be position to the left of the CarouselView
cv1.PageCount = blist.Size 'the number of pages/images to display
cv1.PageColor = Colors.Transparent 'the color in the centre of the indicator circles for "not active" pages
cv1.SlideInterval = 1000 'the slide interval in milli seconds
cv1.playCarousel 'kickstart the carousel into action
' there is also cv1.pauseCarousel that can be used to pause the carousel
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub