Add spinner to phonegap camera widget

0
Hi, the phonegap camera widget allows you to create a picture on your mobile device. Then when the picture is taken and confirmed, it does take a couple of seconds to go back to the mendix page where you activated the camera.  This happens when you have the autosave feature enabled. This means it takes some time to save the picture, and extra time is needed if you have a custom microflow on save . Anyways I think it would be nice to have a visual feedback that the system is busy.  Do you have suggestions on how to implement this feature?
asked
3 answers
0

Debug in the Chrome console to find the place where you'd like to start + stop the progress bar. Then use the following snippet to change the widget src:

var pid = mx.ui.showProgress(); // show progress dialog
mx.ui.hideProgress(pid); // hide it again
answered
0

There is actually a pullrequest pending on GitHub for this widget which provides this, and more. I also submitted a pull request, to make it open the camera immediately upon opening the page. Hopefully these get some attention in the near future.

answered
0

The spinners don't show any real progress. Would recommend to have a look at the onprogress option.

 

https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file-transfer/

var ft = new FileTransfer();
ft.onprogress = function(progressEvent) {
    if (progressEvent.lengthComputable) {
        loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
    } else {
        loadingStatus.increment();
    }
};
ft.upload(fileURL, uri, win, fail, options);
answered