The attached project wraps this Github project. The library files are in the /files folder of the attached B4A project. Copy them to your additional libraries folder. I have also added JavaObject.XML and JavaObject.JAR in the /files folder for in case you do not have the latest version. Copy these two files to your default B4A libraries folder.
Attached the B4A project as well as the java source code. The meter at top left will display the present battery level of your device while the meter at the bottom right has been set to a value of 95. You can adjust the color ranges to your liking.
Enjoy!
speedometerview
Author: Johan Schoeman
Version: 1
- SpeedometerView
Fields:- ba As BA
- BringToFront
- DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
- 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)
- addColoredRange (begin As Double, end As Double, color As Int)
- clearColoredRanges
- Background As Drawable
- Color As Int [write only]
- DefaultColor As Int
- Enabled As Boolean
- Height As Int
- LabelTextSize As Int
- Left As Int
- MajorTickStep As Double
- MaxSpeed As Double
- MinorTicks As Int
- Speed As Double
- Tag As Object
- Top As Int
- Visible As Boolean
- Width As Int