B4A Library [B4X] [XUI] AnotherProgressBar

Discussion in 'Additional libraries, classes and official updates' started by Erel, Nov 1, 2018.

  1. Erel

    Erel Administrator Staff Member Licensed User

    [​IMG]

    A simple, cross platform, indeterminate progress bar.

    Depends on BitmapCreator v4.50+: https://www.b4x.com/android/forum/threads/b4x-xui2d-box2d-game-engine.95208/

    It uses the new BitmapCreator async drawing features.

    The relevant code is:
    Code:
    Private Sub BusyLoop
       
    Dim MyIndex As Int = BusyIndex
       
    Do While MyIndex = BusyIndex
           
    If Vertical Then
               BusyBrush.SrcOffsetY = BusyBrush.SrcOffsetY + 
    3
           
    Else
               BusyBrush.SrcOffsetX = BusyBrush.SrcOffsetX - 
    3
           
    End If
           
    Dim tasks As List
           tasks.Initialize
           tasks.Add(bc.AsyncDrawRect(bc.TargetRect, TransparentBrush, 
    True0))
           tasks.Add(bc.AsyncDrawRectRounded(bc.TargetRect, BusyBrush, 
    True015))
           bc.DrawBitmapCreatorsAsync(Me, 
    "BC", tasks)
           
    Wait For BC_BitmapReady (bmp As B4XBitmap)
           
    If xui.IsB4J Then bmp = bc.Bitmap
           bc.SetBitmapToImageView(bmp, mIV)
           Sleep(
    16)
       
    Loop
    End Sub
    A B4A project is attached. The custom view class is inside.

    Updates:

    v1.01 - Fixes an issue with the label visibility.
     

    Attached Files:

    Last edited: Nov 2, 2018
  2. asales

    asales Well-Known Member Licensed User

    If I start the AnotherProgressBar with visible = False in the designer, the text is not show, when the progress become visible.

    If I use "AnotherProgressBar1.Visible = False" in the code, after load the layout, works.

    Why this behavior?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Fixed in v1.01.
     
    peacemaker, asales and Johan Hormaza like this.
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