B4A Library ProgressWheel v0.22

Discussion in 'Additional libraries, classes and official updates' started by DonManfred, Jan 31, 2015.

  1. DonManfred

    DonManfred Expert Licensed User

    ProgressWheel
    Version:
    0.2
    • pgWheel
      Events:
      • onClick (value As Object)
      Methods:
      • AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
      • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
      • Initialize (EventName As String)
      • bringToFront
      • buildDrawingCache
      • buildDrawingCache2 (autoscale As Boolean)
      • clearAnimation
      • computeScroll
      • incrementProgress
        Increment the progress by 1 (of 360)
      • isSpinning As Boolean
      • spin
        Puts the view on spin mode
      • stopSpinning
        Turn off spin mode
      Properties:
      • BarColor As Int
      • BarLength As Int
      • BarWidth As Int
      • CircleColor As Int
      • CircleRadius As Int
      • Clickable As Boolean [write only]
      • ContourColor As Int
      • ContourSize As Float
      • DelayMillis As Int
      • Enabled As Boolean [write only]
      • FadingEdgeLength As Int [write only]
      • Focusable As Boolean [write only]
      • FocusableInTouchMode As Boolean [write only]
      • Id As Int [write only]
      • Left As Int
      • MinimumHeight As Int [write only]
      • MinimumWidth As Int [write only]
      • PaddingBottom As Int
      • PaddingLeft As Int
      • PaddingRight As Int
      • PaddingTop As Int
      • Progress As Int [write only]
        Set the progress to a specific value
      • RimColor As Int
      • RimShader As Shader [write only]
      • RimWidth As Int
      • SpinSpeed As Int
      • Tag As Object [write only]
      • Text As String [write only]
      • TextColor As Int
      • TextSize As Int
      • Top As Int

    Code:
    Sub Globals
        
    'These global variables will be redeclared each time the activity is created.
        'These variables can only be accessed from this module.
        Dim pg1, pg2 As pgWheel
    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")
        pg1.Initialize("pgw")
        pg1.AddToParent(
    Activity,10dip,10dip,40dip,40dip)
        pg1.CircleRadius = 
    80
        pg1.RimWidth = 
    10
        pg1.SpinSpeed = 
    4
        pg1.spin

        pg2.Initialize(
    "pgw")
        pg2.AddToParent(
    Activity,60dip,10dip,125dip,125dip)
        pg2.CircleRadius = 
    70
        pg2.RimWidth = 
    15
        pg2.SpinSpeed = 
    4
        pg2.BarColor = 
    Colors.Red
        pg2.ContourSize = 
    1
        pg2.RimColor = 
    Colors.Blue
        pg2.CircleColor = 
    Colors.Green
        pg2.Text = 
    "Hallo World"
        pg2.spin
    End Sub
    [​IMG]

     

    Attached Files:

    Last edited: Feb 1, 2015
  2. Douglas Farias

    Douglas Farias Expert Licensed User

    Works on old android versions? what minimal?
     
  3. DonManfred

    DonManfred Expert Licensed User

    Probably yes
    i dont know. Just try it :)
     
    Johan Schoeman and Peter Simpson like this.
  4. DonManfred

    DonManfred Expert Licensed User

    Updated ProgressWheel to v0.20

    - Added support for Designer.
     
    Peter Simpson and wineos like this.
  5. Peter Simpson

    Peter Simpson Expert Licensed User

    I'll have to use this library one day :) cheers...
     
  6. Michael Höpner

    Michael Höpner Member Licensed User

    Hi DonManfred
    my question: How can i make the wheel to diappear?
    There is no "sendtoback" or how can i >distroy< the wheel?
    When it will be able Please answer
     
  7. DonManfred

    DonManfred Expert Licensed User

    in v0.22 you can set the visibility.
    Lib is uploaded to Post #1

    example:
    Code:
    Sub btnhide_Click
        
    'Log(pg2.Visible)
        If pg2.Visible Then
            pg2.Visible = 
    False
        
    Else
            pg2.Visible = 
    True
        
    End If
    End Sub
     
    thedesolatesoul likes this.
  8. Michael Höpner

    Michael Höpner Member Licensed User

    Hello DonManfred
    Thank you for your promt reply.
     
    Peter Simpson likes this.
  9. bluedude

    bluedude Well-Known Member Licensed User

    Pretty!

    Could you make the inner circle like a clickable button that has a pressed effect? I want to use this as a round button that starts to spin when clicked and stops when the process is finished.

    Cheers.
     
  10. DonManfred

    DonManfred Expert Licensed User

    There is no inner or outer object. It is ONE object. I can make the hole button clickable though.
     
  11. bluedude

    bluedude Well-Known Member Licensed User

    Clickable would be cool but it would need to have pressed states etc. I just solved it by adding a normal button with big rounded corners (half size of width and height).

    Can you add height and width properties to the object so that I can resize my normal button precisely inside the progress wheel?

    The end result is pretty good. Did not test transparancy yet on a photo background.

    The middle white button is clickable and has borders etc. I will use the combined solution for scanning nearby objects (iBeacons etc.) When the button is clicked it will start spinning until all results are found.
     

    Attached Files:

  12. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    Hi,
    I need it for Subs long jobs
    I initialize like:

    ww.Initialize("ww")
    ww.AddToParent(Activity,50%y-25dip,50%x-25dip,50dip,50dip)
    ww.CircleRadius = 80
    ww.RimWidth = 10
    ww.SpinSpeed = 4
    ww.spin
    ww.Visible=False

    But when I want to use
    ww.visible=true
    in a sub I get a java error Null pointer exception

    whats wrong?

    Another problem is, when I am , by ex, refreshing a customlistview it stops spinnig and then it is of no use ata all.

    Thanks
     
  13. Taha

    Taha Member Licensed User

    What is computeScroll?
    onClick (value As Object) - what value is generated?
     
  14. sultan87

    sultan87 Active Member Licensed User

    hello,
    how to put the text on several lines ?
    best regards
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice