Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private bar1 As SegmentedBarView
Private s1,s2,s3,s4,s5 As Segment
Private value As Float
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")
value = 35
s1.Initialize(0,20,Colors.Blue)
s1.DescriptionText = "1"
s1.CustomText = "1st"
s2.Initialize(20,40,Colors.Cyan)
s2.DescriptionText = "2"
s3.Initialize(40,60,Colors.DarkGray)
s3.DescriptionText = "3"
s4.Initialize(60,80,Colors.Yellow)
s4.DescriptionText = "4"
s5.Initialize(80,100,Colors.Green)
s5.DescriptionText = "5"
s5.CustomText = "5th"
Dim segments As List
segments.Initialize
segments.Add(s1)
segments.Add(s2)
segments.Add(s3)
segments.Add(s4)
segments.Add(s5)
bar1.DescriptionTextColor = Colors.White
bar1.DescriptionTextSize = 80
bar1.DescriptionBoxHeight = 25dip
bar1.ShowDescriptionText = True
' The bars color when there are no segments.
bar1.EmptySegmentColor = Colors.Red
bar1.GapWidth = 1dip
bar1.SegmentTextColor = Colors.Black
bar1.SegmentTextSize = 60
' 0 = Rectangle
' 1 = Rounded
' 2 = Triangle
bar1.SideStyle = 1
' 0 One sided
' 1 Two sided
' But honestly; i dont know what the different is here :-)
bar1.SideTextStyle = 0
bar1.Segments = segments
bar1.BarHeight = 50dip
bar1.setValueSignSize(100dip,30dip)
bar1.ValueSignColor = Colors.Red
bar1.ValueTextColor = Colors.White
bar1.ValueTextSize = 80
bar1.setValueWithUnit(value,"%")
End Sub