- Marc James
- PowerServer Mobile (Obsolete)
- Friday, 15 November 2019 05:47 PM UTC
Hi, I am uploading an image to my server from a mobile, I would like to display a loading gif while it uploads the file, then hide the gif when it is done..
For some reason a gif worked on desktop/internet, but it did not animate when on my mobile phone (google pixel XL 3)
So instead I just thought i'd animate a loading bar moving up and then resetting itself on a timer, then when the upload is complete, the bar is hidden and then a popup comes up saying upload complete. (see code below where I call the timer just before I upload to the IIS server)
ls_directory = "regen/"
inv_file.of_logonfileserver( '000.148.152.100', 80, 'username=0;password=0' )
st_uploading.visible = true
hpb_uploading.visible = true
timer(0.5,w_mobile)
inv_file.of_appeonupload( is_photo1, ls_directory, true, ll_error )
timer(0,w_mobile)
st_uploading.visible = false
hpb_uploading.visible = false
inv_file.of_logofffileserver()
THE PROBLEM
What I found though was that the loading bar would appear along with its title, but the bar would only go up by 10, then just stop. So it seems the timer only triggers once, even thought it is supposed to go round every 0.5 seconds. Below is the simple code my timer does to increment by 10.
long ll_position = 0
hpb_uploading.position = ll_position
IF ll_position = 0 THEN
ll_position = 10
ELSEIF ll_position = 10 THEN
ll_position = 20
ELSEIF ll_position = 20 THEN
ll_position = 30
ELSEIF ll_position = 30 THEN
ll_position = 40
ELSEIF ll_position = 40 THEN
ll_position = 50
ELSEIF ll_position = 50 THEN
ll_position = 60
ELSEIF ll_position = 60 THEN
ll_position = 70
ELSEIF ll_position = 70 THEN
ll_position = 80
ELSEIF ll_position = 80 THEN
ll_position = 90
ELSEIF ll_position = 90 THEN
ll_position = 100
ELSEIF ll_position = 100 THEN
ll_position = 0
END IF
hpb_uploading.position = ll_position
And below is the screenshot of the app.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.