Notifier: Show progress dialog

I'm developing an app that gets an image from the phone gallery, then rotates it and converts it to gray. This process takes around 10 seconds, so rather than leaving the user with a black screen during this time, I want to display a progress notice. The problem is that the notice is not being displayed. If I disable the "dismiss progress dialog" in the Image Manager, the notice appears only after the image has been displayed on the screen (and of course I have to terminate the app manually). I am running the app on Companion. The relevant code is shown:

1 Like

If you know it will take 10 seconds then use one clock component with 1000 mills as interval+ index method

When clock timer set this index to get index +1 and show this value in progress dialog

Thanks for your reply. The 10 seconds that I mentioned is just a rough approximation and the time is different for each image accessed. What confuses me is why the notification does not appear immediately after the image is picked since the notification call is the first thing in that procedure.

Try as follows:

In Image Picker AfterSelect
Start the progress dialog
Start a clock timer (set interval to 250ms or something small)

In Clock timer
Stop the timer
Place all your other blocks that are currently in ImagePicker After Select

You may need to play around with block placement to get the progress dialog to work correctly for you (you may even need to use a second clock timer...)

Thanks but this did not work. When ImagePicker executes, the entire screen goes black (as if the app were closed) until the image is displayed. Once the image is displayed, (if I had disabled Dismiss Progress Notifier) the notifier appears but of course this is of no use. I need the notifier to be on during the black screen period.

I tried adding an Image Picker: Before Picking block containing a Notifier: Show Progress Dialog. The notifier flashes on instantaneously and is then covered first by the Gallery display and then after picking, by a black screen until the image is finally displayed. It is as if the app is invisible in the background.

This is working as expected for me:

I have used a File component in order to set the new images to the ASD

Thank you for your time and suggestions. After extensive testing and experimentation, I have concluded that this is not a Notifier problem. When loading and processing an image from my Samsung J7 phone, the entire screen goes black completely covering the app user interface for about 10 seconds. During this time, even the notifier is not visible, which led me to incorrectly believe it to be a Notifier problem. I will try to find a more appropriate place to discuss this problem.

1 Like

Having the same problem here. It looks like the progress popup only appears when the full script has been executed. I think there should be a parameter in the ShowProgressDialog procedure that allows you to immediately show the dialog, and then, continue the execution. The script with the timer works, but it's way too complicated.

I mean, the entire purpose of the progress dialog is to inform the user that progress is being made in a large task, and if it can't even do that job properly... :man_shrugging: Kind of sad.

@backo

Show your relevant blocks, the order of things is important

This was basically my code. The "render" function needs about 5 seconds to run completely. What it does is set each pixel of a canvas to black (I know there's a more efficient way to do this, but I want to do something more later). First of all, I run the ShowProgressDialog function, but it doesn't appear—the render function is running now. When it's finished, the canvas is black and then the dialog appears for a fraction of a second and then is gone. But don't worry—I've already added the clock thing and it now works as it should. But still, it's a pity that we have to do this :frowning:

This will not work.

Your DismissProgressDialog block needs to be in a different event

See above for examples

You do not always have to use a clock timer, what is happening in render, you may be able to add it there?

This will not work.

Yeah, I know. The image shown is the code I had before I found this thread. I used the examples above and it works correctly now.

Your DismissProgressDialog block needs to be in a different event (...) what is happening in render, you may be able to add it there?

Then where do I place the DismissProgressDialog? If it needs to be in a different event, the only way I can think of is with a timer :dizzy_face:

Show your render procedure

Here it is. As I said earlier, I know I can just use Canvas1.BackgroundColor, but later I will use a formula for every pixel.

You will need to use a clock timer

Okay. Thanks for your help.