B4A Library [Lib] CustomProgressDialog

This library will allow you to customize a Progress Dialog.

Requirements:

- B4A 3.x

How to install:

- Copy the CustomProgressDialog.jar and CustomProgressDialog.xml to your additional libraries directory.

How to use:

B4X:
'Initialize the library
Dim myProgressDialog As CustomProgressDialog

'Create your ProgressDialog
'Leaving the animation parameter blank will display the default spinner.
'Entering -1 on LEFT or TOP parameters will center the CustomProgressDialog
myProgressDialog.Initialize(Activity, 95%x, -1, -1, "", Colors.DarkGray, 0, "")  

'Display it
myProgressDialog.Show("Tap the BACK key to stop...", Colors.White)

B4X:
'Hide/Close the CustomProgressDialog
myProgressDialog.Hide

That's it!!

The included animations are: Spinner, Laser, Bounce, Domino and Holo.


You can also customize a ProgressDialog with a ProgressBar, look at the attached sample for more details.

NOTE: Updated to version 2.20, added a new animation named "Holo".
 

Attachments

  • CustomProgressDialog_Sample.zip
    13 KB · Views: 1,214
  • CustomProgressDialog_Lib_2.20.zip
    19.1 KB · Views: 1,296
Last edited:

merlin2049er

Well-Known Member
Licensed User
Longtime User
Great library. How do you keep it on top? I've got other things happening, and it ends in the background.

I guess I can call it multiple times...
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
Right, so let me look at this. I'll correct it.

Ok, works fine now. I put the listview in a panel too, and loaded the panel then displayed the progress circle...

Thanks!
 
Last edited:

BarryW

Active Member
Licensed User
Longtime User
This library will allow you to customize a Progress Dialog.

Requirements:

- B4A 3.x

How to install:

- Copy the CustomProgressDialog.jar and CustomProgressDialog.xml to your additional libraries directory.

How to use:

B4X:
'Initialize the library
Dim myProgressDialog As CustomProgressDialog

'Create your ProgressDialog
'Leaving the animation parameter blank will display the default spinner.
'Entering -1 on LEFT or TOP parameters will center the CustomProgressDialog
myProgressDialog.Initialize(Activity, 95%x, -1, -1, "", Colors.DarkGray, 0, "") 

'Display it
myProgressDialog.Show("Tap the BACK key to stop...", Colors.White)

B4X:
'Hide/Close the CustomProgressDialog
myProgressDialog.Hide

That's it!!

The included animations are: Spinner, Laser, Bounce, Domino and Holo.


You can also customize a ProgressDialog with a ProgressBar, look at the attached sample for more details.

NOTE: Updated to version 2.20, added a new animation named "Holo".

Is it possible to detect ur progressdialog if it is hide
 

NJDude

Expert
Licensed User
Longtime User
There's no event necessary, if you want to know if a view is hidden or not, just query the visibility.
B4X:
If myProgressDialog.Visible = False Then 

....

In the case of this particular lib you do it like this:
B4X:
If myProgressDialog.IsShow Then
...
That is in the sample attached to the first post, it seems you haven't seen it.
 
Last edited:

arnold steger

Member
Licensed User
Longtime User
Not show my the progressdialog
B4X:
    HtmlPoints=listtemp
    Dim Pointstart() As String =Regex.Split(",",HtmlPoints.Get(1))
    HtmlStart.Initialize(Pointstart(0),Pointstart(1))
    Dim Pointstop() As String =Regex.Split(",",HtmlPoints.Get(HtmlPoints.Size-1))
    HtmlStop.Initialize(Pointstop(0),Pointstop(1))
    myProgressDialog.Show(Value&".html wird generiert...", Colors.White)
    CallSubDelayed("Main",SubWriterHtml)
For write my html file need 12 second.
What are my problem?
Another test have maked.
When call "myProgressDialog.Show" before another calculation show my the dialog and turns, during "SubWriterHtml" freezes
 

aidymp

Well-Known Member
Licensed User
Longtime User
Just a quick point on this, about 3 weeks ago i did a major update to my app and added a lot of new features, as the app took longer to start, i decided to use this as it looks great, however for the past 3 weeks I have been trying to solve a random closing of the app, and occasional ANR. I virtually stripped everything back out of the app as I was getting desperate. my app showed this dialogue on launching, until it downloaded and unzipped some files. I noticed if it failed to download some files, the app closed! (the side effect was useful to me - if a little unusual) once completed I hide the dialogue. and it appears it causes lots of problems for me! I have removed it altogether and my app now works correctly?

Is there a known issue - or a way to totally disable it after using rather than just hiding it??

Thanks

Aidy
 

Clayton

Member
Licensed User
Longtime User
hello people, B4a is a strange behavior in an Activity.

example:
to click on a type EditText field the keyboard is open, and if the field is far below it is played to the top to be visible when you type.
it all automatic ... works perfectly ...

But if I have to display a CustomProgressDialog that does not work
how do I solve?

B4X:
myProgressDialog.Initialize(Activity, 95%x, -1, -1, "","" ,Colors.White, 0, "LASER",False) 
 myProgressDialog.Show("Consultando...", Colors.Black)' bla bla bla
 myProgressDialog.Hide
 

rbtcotton

Member
Licensed User
Longtime User
myProgressDialog example was working correctly, however I'm receiving a java.lang.NoSuchMethodError: No virtual method setText(Ljava/lang/Object. The error occurs in the example code and in a Test Application.

Any suggestions would be appreciate.
 

rbtcotton

Member
Licensed User
Longtime User
Yes, I am using v6.80 beta #1. Prior to updating to v6.80, one tablet would work correctly and a second tablet with the same app would error out. Only difference that I could determine was update versions on the android operating system. The tablets are the same brand and make and model...

I will wait for the next beta...

Thanks for all your efforts...
 

jpvniekerk

Active Member
Licensed User
Longtime User
I'm not seeing the spinner, all the other animations work fine, but not the spinner. Any idea why this can be?

I've also tested with the sample program, and it does the same.

I'm on a Galaxy Note 4 with Android 6.0.1.

I've checked the sample on a tablet with Android 5.0.2 and it works fine there.

Any ideas?
 
Last edited:
Top