This is a wrapper for this github-project.
SegmentedBarView
Version: 1
If you want to donate for my work building the wrapper you can do it here:
SegmentedBarView
Version: 1
- Segment
Methods:- GetApplicationDrawable (DrawableName As String) As Drawable
Get a Drawable from the Application Resources.
Returns Null if the Drawable is not found. - Initialize (minvalue As Float, maxvalue As Float, color As Int)
- IsInitialized As Boolean
- Color As Int
- CustomText As String
- DescriptionText As String
- MaxValue As Float
- MinValue As Float
- GetApplicationDrawable (DrawableName As String) As Drawable
- SegmentedBarView
Fields:- ba As BA
- AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
- BringToFront
- DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
- GetApplicationDrawable (DrawableName As String) As Drawable
Get a Drawable from the Application Resources.
Returns Null if the Drawable is not found. - Initialize (EventName As String)
- Invalidate
- Invalidate2 (arg0 As Rect)
- Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- IsInitialized As Boolean
- RemoveView
- RequestFocus As Boolean
- SendToBack
- SetBackgroundImage (arg0 As Bitmap)
- SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
- SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
- SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
- setValueSignSize (width As Int, height As Int)
- setValueWithUnit (value As Float, unitHtml As String)
- Background As Drawable
- BarHeight As Int [write only]
- Color As Int [write only]
- DescriptionBoxHeight As Int [write only]
- DescriptionTextColor As Int [write only]
- DescriptionTextSize As Int [write only]
- EmptySegmentColor As Int [write only]
- Enabled As Boolean
- GapWidth As Int [write only]
- Height As Int
- Left As Int
- SegmentTextColor As Int [write only]
- SegmentTextSize As Int [write only]
- Segments As List [write only]
- ShowDescriptionText As Boolean [write only]
- ShowSegmentText As Boolean [write only]
- SideStyle As Int [write only]
- SideTextStyle As Int [write only]
- Tag As Object
- Top As Int
- Unit As String [write only]
- Value As Float [write only]
- ValueSegment As Integer
- ValueSignColor As Int [write only]
- ValueTextColor As Int [write only]
- ValueTextSize As Int [write only]
- Visible As Boolean
- Width As Int
B4X:
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
If you want to donate for my work building the wrapper you can do it here:
Attachments
Last edited: