I have a one-page mobile site that I'm working on that brings up a loading widget that comes up between page navigation. On old android phones (I'm testing on a Galaxy S), painting the loading icon is deferred until much of the other processing is done. This of course largely defeats the purpose of the loading icon.
$("button").click(function() {
$(".cover").show();
$(window).scrollTop(0);
for(var i = 0; i < 1000; i++) {
console.log($(".body").css("width"));
}
setTimeout(function() {
$(".body").toggleClass("toggle");
$(".cover").hide();
}, 1000);
});
This sample code accurately demonstrates what is functionally happening on my site. There is a command to display the loading widget, then some relatively heavy processing (of course on the actual page, it's a variety of different things, but both this demo and my page behave the same way). When you press the button on the Galaxy S, there is a bunch of processing, then loading widget appears for the one second timeout.
Why doesn't it show the loading widget display first and how can I force it to?
Here is a jsbin with the demo so you can see it on a phone: JSBin