As of now, I am facing a challenge in displaying a spinner while an HTTP request is being executed. Every time I try to implement a spinner, it stops animating as soon as the call starts.
var spinnerArray = [];
for (var i = 0; i < 20; i++) {
spinnerArray.push('/images/preloaderGif/preloader'+ ("0" + i).slice(-2) + '.gif');
}
$.spinner.images = spinnerArray;
$.spinner.duration = "200";
$.spinner.repeatCount = "0";
spin();
function spin(){
$.spinner.start();
callHTTP() //Prewritten function
Ti.App.addEventListener('callEnd', function(e){
$.spinner.stop();
});
}
This issue causes the spinner to never actually show up on the screen. Removing the HTTP call or placing it within a timeout leads to the spinner spinning indefinitely or until the timeout finishes.
I am wondering if there is a way to keep the spinner animation running smoothly throughout the duration of the call?