B4A Library CircleProgressMaster

The attached project wraps this Github project. Library files are in the /files folder of the attached B4A project. Copy them to your additional libraries folder.
The ArcProgress view (second from right) and the DonutProgress view indicate the actual battery level of my device. Have added some inline Java code to extract the battery level. It uses the JavaObject Library and I have therefore included JavaObject XML and JAR in the /files folder of the attached project (for in case someone don't have them or has an older version of it).
Also attaching the Java source code (src.zip)
Thanks teacher....;)

Edit: See update in post #6


pic2.png


CircleProgressMaster
Version:
1
  • ArcProgressMaster
    Fields:
    • ba As BA
    Methods:
    • 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)
    Properties:
    • ArcAngle As Float
    • Background As Drawable
    • BottomText As String
    • BottomTextSize As Float
    • Color As Int [write only]
    • Enabled As Boolean
    • FinishedStrokeColor As Int
    • Height As Int
    • Left As Int
    • Max As Int
    • Progress As Int
    • StrokeWidth As Float
    • SuffixText As String
    • SuffixTextPadding As Float
    • SuffixTextSize As Float
    • Tag As Object
    • TextColor As Int
    • TextSize As Float
    • Top As Int
    • UnfinishedStrokeColor As Int
    • Visible As Boolean
    • Width As Int
  • CircleProgressMaster
    Fields:
    • ba As BA
    Methods:
    • 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)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • FinishedColor As Int [write only]
    • Height As Int
    • Left As Int
    • Max As Int [write only]
    • PrefixText As String [write only]
    • Progress As Int [write only]
    • SuffixText As String [write only]
    • Tag As Object
    • TextColor As Int [write only]
    • TextSize As Float [write only]
    • Top As Int
    • UnfinishedColor As Int [write only]
    • Visible As Boolean
    • Width As Int
  • DonutProgressMaster
    Fields:
    • ba As BA
    Methods:
    • 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)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • FinishedStrokeColor As Int
    • FinishedStrokeWidth As Float
    • Height As Int
    • InnerBackgroundColor As Int
    • InnerBottomText As String
    • InnerBottomTextColor As Int
    • InnerBottomTextSize As Float
    • Left As Int
    • Max As Int
    • PrefixText As String
    • Progress As Int
    • SuffixText As String
    • Tag As Object
    • Text As String
    • TextColor As Int
    • TextSize As Float
    • Top As Int
    • UnfinishedStrokeColor As Int
    • UnfinishedStrokeWidth As Float
    • Visible As Boolean
    • Width As Int
 

Attachments

  • pic1.png
    pic1.png
    23.9 KB · Views: 488
  • CircleProgressMaster.zip
    30.2 KB · Views: 598
  • CircleProgressMasterV2.zip
    47.6 KB · Views: 869
  • src.zip
    15.6 KB · Views: 581
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
Hi @Johan Schoeman
How to be able to display floating value like 98.02 % ?
Thank you
The original project that I have wrapped uses and integer for the progress.

B4X:
    private int progress = 0;
 
Top