It is currently Tue Apr 25, 2017 7:32 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  [ 38 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: No scale exists with GW ?
Unread postPosted: Mon Nov 28, 2016 7:54 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
Hello Nicolas,

I admit I'm a little bit afraid of the answer :oops: :)

I've been fighting for a while about scaling GW's pages using always relative size for styles etc... but no result !!!

Attachment:
Screenshot_20161127-A3 vs TabS 8.png
Screenshot_20161127-A3 vs TabS 8.png [ 75.57 KiB | Viewed 281 times ]

You can see at left the principal page of my project on my A3 and at right on my TAB S 8...
I think I'll use my little "DataPass.apk" more on my Samsung A3 (720x1280) than on my Galaxy TAB S 8 (1600x2560) both in portrait.

I must find a solution :geek:

Maybe with your advices ?

Cheers

Gilles

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Tue Nov 29, 2016 2:09 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5485
Location: Paris, France
Hi Gilles,

This is called adaptive design, or responsive design, and it is a whole field in itself :ugeek:

There are responsive designers out there who are (well) paid for doing this job: design apps or web pages that fit both to a smartphone or a tablet (or even a computer screen).

We should have a look at what is possible to do on a jQuery / jQuery Mobile base to make it adaptive / responsive.
I haven't done any personal research so far...

At the minimum I hope I could be able to offer a GW command to tell you on what kind of device you are running your app: phone, or 7" tablet, or 10" tablet.
Based on that you can dynamically change the content of your GW page.
For example in smartphone view, on your screenshot, you need to replace "Gérer les catégories" (which is too long) to simply "Gérer" ; or "Ajouter une fiche" to "Ajout".

I'll investigate what can be done.

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Tue Nov 29, 2016 5:30 am 
Offline

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

I think that through the Screen.size command you can get information about the screen of the device your app is running on.
Then you can adapt your GW GUI accordingly.

Cheers,
Luca


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Tue Nov 29, 2016 1:30 pm 
Offline
User avatar

Joined: Sun Nov 23, 2014 8:15 am
Posts: 2185
Location: romania
mougino wrote:
Hi Gilles,

This is called adaptive design, or responsive design, and it is a whole field in itself :ugeek:

There are responsive designers out there who are (well) paid for doing this job: design apps or web pages that fit both to a smartphone or a tablet (or even a computer screen).

We should have a look at what is possible to do on a jQuery / jQuery Mobile base to make it adaptive / responsive.
I haven't done any personal research so far...

At the minimum I hope I could be able to offer a GW command to tell you on what kind of device you are running your app: phone, or 7" tablet, or 10" tablet.
Based on that you can dynamically change the content of your GW page.
For example in smartphone view, on your screenshot, you need to replace "Gérer les catégories" (which is too long) to simply "Gérer" ; or "Ajouter une fiche" to "Ajout".

I'll investigate what can be done.

Nicolas

they also need the user's screen resolution or density


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Wed Nov 30, 2016 3:35 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
mougino wrote:
For example in smartphone view, on your screenshot, you need to replace "Gérer les catégories" (which is too long) to simply "Gérer" ; or "Ajouter une fiche" to "Ajout".

I'll investigate what can be done.

Nicolas

I'm afraid it will not be enough because it is the dimension of bouttons themselves problematic...
About that I tried to size the police bigger into a button but it seems that the button size win :lol: :oops:
I managed to display the current time as text in the LBUTTONS of the title bar but on some device (ex: Galaxy Note II) it appears with small dots...

I really hope you'll find a tips (as usual ) Nicolas because I think that this aspect is very important also for your fabulous project GWAC :ugeek: :ugeek:

The first thing we do when we code with graphics is to scale... when a guy don't do we hasten to point out to him :twisted: ;) :D

Obviously Gikam : as Luca said we use first GR.SCREEN w,h but no mater <the user's screen resolution or density> because we give the scale size we want as result and we calculate the ratio... like that :
Code:
GR.OPEN 255,0,148,0,0,0   % 0=paysage
gr.screen w, h
scx = 1280   % my device : 2560 x 1600
scy =  800   % but 1280x800 is generally good on many devices...
sx = w/scx
sy = h/scy
gr.scale sx, sy

Some like Aat or Roy I think use this way in order to keep circle proportion for example :
Code:
gr.open 255,82,178,80,1,0
gr.screen w,h,density
scx =1280
scy =h/w*scx
sx =w/scx
sy =h/scy
gr.scale sx,sy

Cheers

Gilles

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Wed Nov 30, 2016 4:37 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5485
Location: Paris, France
Hi Gilles, I already answered but maybe I was not clear: there cannot be any "tip" that will magically make a jQuery-based app look beautiful on a phone and on a tablet at the same time.

You really must see that "professional" app developers spend a huge time and money on making their apps adaptive and responsive.
There is no framework or tool that does it all for you. In jQuery you need to tune your controls, going deep in the CSS/JavaScript to have something pretty.
If it's not possible, then you must be smart and find workarounds that will show an acceptable content on all device resolutions...

HTML has its pros and cons.
Pros is you make nice looking guis effortlessly.
Cons is it's not adaptive.

If the cons is not acceptable for your current app, there's always the solution to do it in GR mode and manage the exact resolution with gr.scale.

I could try to propose something like a scale factor (in the meta tag of the html header) but honestly this will not look pretty, this will at best display your tablet app zoomed out on your phone, the fonts and elements will be barely readable, the ratio will still not be the same (phone is longer in 16:9, tablets are more 4:3).
Do you want to give it a try nonetheless ?

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Wed Nov 30, 2016 4:46 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
If this does not require you too much work and it allows to test if it produces a graphic right middle then yes I want to give it a try Nicolas.

Cheers

Gilles

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Wed Nov 30, 2016 5:48 am 
Offline
User avatar

Joined: Tue Jan 03, 2012 9:31 am
Posts: 5485
Location: Paris, France
Thanks Gilles, I had a look but in fact I'm not even sure my attempts will work, I don't have a tablet to test on, and I don't want to be restrictive, I think the best is you play yourself with the page "viewport" and see if there's a magic setting that will work ;)

I found this nicely explained page (in French):
http://www.alsacreations.com/article/li ... obile.html

Based on that, you can do the following right after your page = GW_NEW_PAGE():
Code:
page = GW_NEW_PAGE()
LIST.REPLACE 1, ABS(page), REPLACE$(GW_PAGE$(page), "-scale=1", "-scale=0.5")

or any other REPLACE$...

The HTML line that is placed by GW in all new pages is the following, knowing that you can do several tries and replace several viewport properties:
Code:
<meta name='viewport' content='width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no'>


Tell us how it goes!

Nicolas

_________________
- Creator of the Android BASIC! Compiler


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Wed Nov 30, 2016 6:22 am 
Offline

Joined: Sat Mar 02, 2013 11:04 am
Posts: 814
Location: France
Thanks to you Nicolas
obviously i'll give a try to your solutions proposals :geek:

Another way for me would be to write 2 versions of my DataPass.apk : one for tablets and another for smartphone tipically 1280 x 720 (my A3)!
But I do not know if I will have the courage :oops: :mrgreen: :?

to be continued...

Gilles

_________________
"It is better to mobilize intelligence for stupid things, rather than mobilizing stupidity for intelligent things."
Galaxy TAB S 8.4, 2560x1600, Marshmallow 6.0.1
Galaxy Note II, 1280x720, JB4.1.2
Galaxy A3, 1280x720, Android 6.0.1


Top
 Profile  
 
 Post subject: Re: No scale exists with GW ?
Unread postPosted: Wed Nov 30, 2016 7:12 am 
Offline

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

Just out of curiosity I tried that on my Tablet for GW demo, but I don't see any change...

Maybe another possibility could be to try on a small screen:

Code:
page = GW_NEW_PAGE()
LIST.REPLACE 1, ABS(page), REPLACE$(GW_PAGE$(page), "initial-scale=1, minimum-scale=1, maximum-scale=1", "shrink-to-fit=yes")


/ Luca


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page 1, 2, 3, 4  Next


Who is online

Users browsing this forum: No registered users and 0 guests


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