It is currently Fri Jun 23, 2017 6:53 am



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: GW-lib and control-type=gallery
Unread postPosted: Fri Apr 14, 2017 7:47 am 
Offline

Joined: Sat Mar 11, 2017 5:49 am
Posts: 31
Hi

In the Ftpclient i have written, I found something strange.
It uses the following code, which is also in the gw-demo.
Code:
galUpdate:
  gw_modify(galtx, "text", "Images " + int$ (cgalidx) + "-" +~
     int$(min(cgalidx+7, cgalmax)) + "/" + int$(cgalmax))
  array.copy gal$[ cgalidx, min(cgalidx+7, cgalmax) ], cgal$[]
  cgal$[min(cgalmax - cgalidx + 1, 8)] += ">BACK"
  call gw_amodify(galctl, "content", cgal$[])
return

The strange thing is when i execute this in the rfobasic editor, it works over and over without any problem, displaying the images.
When i compile it to an apk, it displays the image only the first time. The second time, displaying the same image it hangs on
call gw_amodify(galctl, "content", cgal$[])
The part of the code which is of interest of this gw_amodify is
Code:
ELSEIF key$="content" & ctyp$="gallery" % GALLERY
    e$=GW_ADD_GALLERY$(t$[])
    i=IS_IN("<script>", e$)
    JS("populate("+DQ$+ctl$+DQ$+","+DQ$+LEFT$(e$, i-1)+DQ$+")") % DOM part
    e$=LTRIM$(MID$(e$, i), "<script>")
    e$=RTRIM$(e$, "</script>")
         call log2File(datapath$, e$)
    JS(e$) % Script
    JS("$('#"+ctl$+"').data('lightGallery').destroy(true)") % kill lightGallery
    JS("$('#"+ctl$+"').lightGallery()") % and create new instance
    JS("$('#"+ctl$+"').justifiedGallery().on('jg.complete',function(e){RFO('jgComplete');})")
         call log2File(datapath$, "before do")
    DO: r$=GW_ACTION$(): call log2File(datapath$, r$) : PAUSE 1: UNTIL r$="jgComplete"
         call log2File(datapath$, "after do")

as you can see i put some debugging in it, and apparently the second time it never receives the "jgComplete"
so it stays in that loop forever. The "after do" msg is never received. The only thig it receives is an empty string.
Nevertheless, the first time it indeed gets the string "jgComplete".
Since it is javascrpt and i am not familiar with that, i do not know how it gets that "jgComplete" return-string.


regards
danny


Top
 Profile  
 
 Post subject: Re: GW-lib and control-type=gallery
Unread postPosted: Thu Apr 20, 2017 12:00 am 
Offline

Joined: Wed Feb 20, 2013 3:25 pm
Posts: 423
Location: Italy
Hi,

Did you remember to import all the needed resources into the APK (both at compile time and execution time)?

Luca


Top
 Profile  
 
 Post subject: Re: GW-lib and control-type=gallery
Unread postPosted: Thu Apr 20, 2017 12:28 pm 
Offline

Joined: Sat Mar 11, 2017 5:49 am
Posts: 31
Hi luca,

I believe that all needed resources are in the apk.
The program is working, but in some cases it hangs in the gw_amodify.
It hangs on displaying images downloaded from the ftp-server.

Regards
Danny


Top
 Profile  
 
 Post subject: Re: GW-lib and control-type=gallery
Unread postPosted: Thu Apr 20, 2017 6:49 pm 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5537
Location: Paris, France
A user recently contacted me to notify a crash of apps using the FTP.* commands built with the Android Compiler. Maybe that's that?
I created a dedicated GitHub issue.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: GW-lib and control-type=gallery
Unread postPosted: Fri Apr 21, 2017 1:24 am 
Offline

Joined: Sat Mar 11, 2017 5:49 am
Posts: 31
Hi nicolas

Thanks for the reply.
Not sure if the ftp is the problem.
The images are indeed coming from the ftp-server
But i display them after the download.
Apparently the gw_amodify is waiting on jgcomplete action/event
Regards
Danny


Top
 Profile  
 
 Post subject: Re: GW-lib and control-type=gallery
Unread postPosted: Fri Apr 21, 2017 1:38 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5537
Location: Paris, France
Hi Danny,
And do you see the grid of thumbnails being displayed?

BTW see https://github.com/miromannino/Justifie ... issues/186 maybe is linked to this?

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: GW-lib and control-type=gallery
Unread postPosted: Fri Apr 21, 2017 9:23 am 
Offline

Joined: Sat Mar 11, 2017 5:49 am
Posts: 31
Hi nicolas,

Indeed, the grid of thumbnails is being displayed.
The problem is that the "back" key on the screen(my screen)
does not respond because it is still inside the loop of the gw_amodify
which keeps looping until it receives "jgcomplete".
As a test i can try to test for my back key for jgcomplete,
just to see if you want ??

Regards
Danny


Top
 Profile  
 
 Post subject: Re: GW-lib and control-type=gallery
Unread postPosted: Fri Apr 21, 2017 10:35 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5537
Location: Paris, France
I was thinking to add a timeout anyway to this GW_AMODIFY of a gallery.
I wrote an app that uses it extensively and I was already stuck like you are, but in very small occurrence (one way to systematically reproduce I have found is to change the screen orientation during the gallery change).
You are using the last version of the GW lib, right?

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: GW-lib and control-type=gallery
Unread postPosted: Fri Apr 21, 2017 2:11 pm 
Offline

Joined: Sat Mar 11, 2017 5:49 am
Posts: 31
Hi nicolas

Yes i am using the latest version of your gw_lib
Version 4.6 to be correct

Regards
Danny


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred