B4A Library DilatingDotsProgressBar

It wraps this Github project. Posting the following:
1. B4A library files
2. B4A project (demonstration purposes)
3. The Java code

1.png


Sample code:

B4X:
#Region  Project Attributes
    #ApplicationLabel: DilatingDotsProgressBar
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: landscape
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim t As Timer

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private ddpb1 As DilatingDotsProgressBar
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("main")
    t.Initialize("t", 2000)
  
    ddpb1.DotColor = Colors.Blue
    ddpb1.GrowthSpeed = 300
    ddpb1.DotSpacing = 10
    ddpb1.DotScaleMultiplier = 1.9
    ddpb1.NumberOfDots = 10
    ddpb1.DotRadius = 6

End Sub

Sub Activity_Resume
  
    t.Enabled = True

End Sub

Sub Activity_Pause (UserClosed As Boolean)
  
    t.Enabled = False

End Sub

Sub t_tick

    ddpb1.DotColor = Colors.RGB(Rnd(150,256), Rnd(150, 256), Rnd(150, 256))
    ddpb1.GrowthSpeed = Rnd(100, 501)
    ddpb1.DotSpacing = Rnd(5,16)
    ddpb1.DotScaleMultiplier = 1.9
    ddpb1.NumberOfDots = Rnd(3, 16)
    ddpb1.DotRadius = Rnd(5, 11)  
  
End Sub

Library:

DilatingDotsProgressBar
Author:
Github: Zachary Reik; Wrapped by: Johan Schoeman
Version: 1
  • DilatingDotsProgressBar
    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]
    • DotColor As Int [write only]
    • DotRadius As Float [write only]
    • DotScaleMultiplier As Float [write only]
    • DotSpacing As Float [write only]
    • Enabled As Boolean
    • GrowthSpeed As Int [write only]
    • Height As Int
    • Left As Int
    • NumberOfDots As Int [write only]
    • Parent As Object [read only]
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
 

Attachments

  • DilatingDotsProgressBarLibFiles.zip
    9.9 KB · Views: 246
  • b4aDilatingDotsProgressBar.zip
    8 KB · Views: 244
  • JavaCode.zip
    6.2 KB · Views: 217
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
Top