B4A Library PercentBarView

Enjoy this project from B4A https://github.com/aykuttasil/PercentBarView




PercentBarView
Author:
SMM
Version: 0.01
  • PercentBarView
    Events:
    • _click
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • 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)
    • addAlphaView (hostView As View)
    • showResult
    Properties:
    • AColor As Int [write only]
    • AValue As Int
    • AlphaViewValue As Float [write only]
    • AnimAlphaViewDuration As Long [write only]
    • AnimBarDuration As Long [write only]
    • BColor As Int [write only]
    • BValue As Int
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Parent As Object [read only]
    • SValue As Int [write only]
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
    • WidthBarA As Int [write only]
    • WidthBarB As Int [write only]


Sample :

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim perc As PercentBarView
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("Layout1")
    perc.Initialize("perc")
    Activity.AddView(perc,0,0,100%x,100%y)
    perc.addAlphaView(Activity)
    perc.AValue=30
    perc.BValue=90
    perc.BColor=Colors.Yellow
    perc.AColor=Colors.White
    perc.WidthBarA=20%x
    perc.WidthBarB=20%x
    perc.showResult
End Sub
Sub perc_click
    Log(perc.AValue)
    Log(perc.BValue)
   
End Sub
 

Attachments

  • PercentBarView.zip
    10 KB · Views: 193
Top