B4A Library CircularSeekBar

Johan Schoeman

Expert
Licensed User
The attached project wraps this Github project. Library files (JAR & XML) are in the /files folder of the B4A project. Copy them to your additional libraries folder. Also posting the Java source code.

The left hand view demonstrates most of the properties. The right hand view is based on the default properties.

Thanks teacher...;)

pic1.png


CircularSeekBar
Version:
1
  • CircularSeekBar
    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
    • CircleColor As Int
      Gets the circle color.
    • CircleFillColor As Int
      Gets the circle fill color.
    • CircleProgressColor As Int
      Gets the circle progress color.
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Max As Int [write only]
      Set the max of the CircularSeekBar.
      If the new max is less than the current progress, then the progress will be set to zero.
      If the progress is changed as a result, then any listener will receive a onProgressChanged event.
    • PointerAlpha As Int
      Gets the pointer alpha value.
    • PointerAlphaOnTouch As Int
      Gets the pointer alpha value when touched.
    • PointerColor As Int
      Gets the pointer color.
    • PointerHaloColor As Int
      Gets the pointer halo color.
    • Progress As Int
      Get the progress of the CircularSeekBar.
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
 

Attachments

Taha

Member
Licensed User
If the progress is changed as a result, then any listener will receive a onProgressChanged event.
Couldn't get this event to work.

Without Changed or Touch events this control is useless IMHO.
 
Last edited:

Johan Schoeman

Expert
Licensed User
Couldn't get this event to work.

Without Changed or Touch events this control is useless IMHO.
Use the lib files attached and add the following code to the B4A project:

B4X:
Sub csb1_value_changed
  
    Log("csb1 value = " & csb1.Progress)
  
End Sub

Sub csb2_value_changed
  
    Log("csb2 value = " & csb2.Progress)
  
End Sub
Amend the initialize lines of code to:
B4X:
csb1.Initialize("csb1")
csb2.Initialize("csb2")


The xxxx_value_changed event will be raised regardless of the progress being set via B4A code or via touch.
 

Attachments

Top