B4A Class [B4X] [XUI] [custom view] CircularProgressBar

Status
Not open for further replies.
This class is compatible with B4A, B4i and B4J.

CircularProgressBar.gif


CircularProgressBar_B4i.gif


CircularProgressBar_B4J.gif


A simple circular progress bar implemented as a custom view.

Usage:
Add the class to your project and add a custom view with the designer. Set its value with"

B4X:
CircularProgressBar1.Value = 100

The animation is smooth in release mode.

The interesting code is in AnimateValueTo. It implements the animation timeline. You can change the DrawValue implementation to create a completely different animation.


V2.00 is released. It is based on XUI library.
 

Attachments

  • CircularProgressBar.zip
    9.4 KB · Views: 3,807
Last edited:

Brandsum

Well-Known Member
Licensed User
There is a problem. When I set HorizontalAnchor and VerticalAnchor to both sides to place it in the center in designer window, I'm getting this error while loading the layout file.

B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Panel size is unknown. Layout may not be loaded correctly.
Error occurred on line: 39 (CircularProgressBar)
java.lang.IllegalArgumentException: width and height must be > 0
    at android.graphics.Bitmap.createBitmap(Bitmap.java:1033)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:1000)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:950)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:911)
    .....
 
Status
Not open for further replies.
Top