Public Sub Initialize (Callback As Object, EventName As String)
Prepare the instance before its other methods.
Original catalog note: Initializes the gauge with the callback and event name
ELEVATEUI · B4A · XUI
Display a measured value against a configured minimum and maximum, such as speed.
Progress & measurement
Display a measured value against a configured minimum and maximum, such as speed.
Animated conceptual demonstration, not an exact Android control screenshot.
During a long operation, connect this indicator to real progress updates rather than leaving a decorative percentage.
Before integrating, examine its methods, events and Designer options.
Tutorials are based on existing project examples or audited APIs. Check each example’s prerequisites; B4A compilation is not claimed.
B4A Activity, XUI and ElevateUI libraries. This example builds both controls in code. Adjust dimensions for smaller screens.
' Interactive speedometer: UIGauge + UIButton
Sub Process_Globals
End Sub
Sub Globals
Private gauge As UIGauge
Private changeSpeed As UIButton
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.Color = 0xFFF2F5FC
gauge.Initialize(Me, "Speed")
gauge.AddToParent(Activity, (Activity.Width - 180dip) / 2, _
25dip, 180dip, 180dip, "", " km/h", 0xFFFFFFFF, _
0xFFE7ECF4, 0xFF243653, 16, True, 25dip)
gauge.SetMinAndMax(0, 120)
gauge.CurrentValue = 84
changeSpeed.Initialize(Me, "changeSpeed")
changeSpeed.AddToParent(Activity, (Activity.Width - 190dip) / 2, _
224dip, 190dip, 44dip, 1, 14, "Change speed", _
Colors.White, 0xFF8B5CF6, 0xFF06B6D4, "TL_BR", 10)
End Sub
Private Sub changeSpeed_Click
Dim newSpeed As Int = Rnd(0, 121)
gauge.CurrentValue = newSpeed
Log("New speed: " & gauge.CurrentValue & " km/h")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause(UserClosed As Boolean)
End Sub
8 audited signatures
Public Sub Initialize (Callback As Object, EventName As String)
Prepare the instance before its other methods.
Original catalog note: Initializes the gauge with the callback and event name
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
Invoked automatically by the B4A Visual Designer; do not call manually.
Original catalog note: Creates the view in the designer
public Sub AddToParent(Parent As B4XView, l As Int, t As Int, w As Int, h As Int,Preffix As String,suffix As String,ColorCenter As Int,ColorBackground As Int,ColorTex As Int,SizeText As Float, IsFullCicle As Boolean,IndicatorHeight As Int)
Public API declaration; refer to the library behavior for usage details.
Original catalog note: Verified against supplied 2026-11-28 .b4xlib
Public Sub SetMinAndMax(NewMinValue As Float, NewMaxValue As Float)
Use SetMinAndMax for its named operation; follow its exact signature.
Original catalog note: Sets the minimum and maximum values for the gauge
Public Sub SetRanges(Ranges As List)
Use SetRanges for its named operation; follow its exact signature.
Original catalog note: Sets the ranges for the gauge
Public Sub CreateRange(LowValue As Float, HighValue As Float, Color As Int) As GaugeRange
Use CreateRange for its named operation; follow its exact signature.
Original catalog note: Creates a range for the gauge
Returns: GaugeRange
Public Sub setCurrentValue (v As Float)
Update current value at runtime when this setting changes.
Original catalog note: Sets the current value of the gauge
Public Sub getCurrentValue As Float
Read the current current value value for validation or UI synchronization.
Original catalog note: Gets the current value of the gauge
Returns: Float
#DesignerProperty: Key: MinValue, DisplayName: Min Value, FieldType: Float, DefaultValue: 0#DesignerProperty: Key: MaxValue, DisplayName: Max Value, FieldType: Float, DefaultValue: 100#DesignerProperty: Key: IndicatorLength, DisplayName: Indicator Length, FieldType: Int, DefaultValue: 20#DesignerProperty: Key: CenterColor, DisplayName: Center Color, FieldType: Color, DefaultValue: #FF2C3144#DesignerProperty: Key: BackgroundColor, DisplayName: Background Color, FieldType: Color, DefaultValue: 0xFFFFFFFF#DesignerProperty: Key: IndicatorColor, DisplayName: Indicator Color, FieldType: Color, DefaultValue: 0xFF000000#DesignerProperty: Key: PrefixText, DisplayName: Prefix Text, FieldType: String, DefaultValue:#DesignerProperty: Key: SuffixText, DisplayName: Suffix Text, FieldType: String, DefaultValue: °#DesignerProperty: Key: Duration, DisplayName: Duration From 0 To 100, FieldType: Int, DefaultValue: 3000, Description: Milliseconds#DesignerProperty: Key: GaugeType, DisplayName: Gauge Type, FieldType: String, DefaultValue: Half Circle, List:Half Circle|Full Circle#DesignerProperty: Key: TextColor, DisplayName: Color del Texto, FieldType: Color, DefaultValue: 0xFF000000#DesignerProperty: Key: TextSize, DisplayName: Tamaño del Texto, FieldType: Int, DefaultValue: 16No public callback events are declared in the catalog. You can still handle B4A events for controls inserted inside it.
Public mBase As B4XViewPublic Tag As Object