fullscreenmode and rect of a substack on mobile device ?

classic Classic list List threaded Threaded
91 messages Options
12345
Reply | Threaded
Open this post in threaded view
|

fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
Hello,

I’ve a stack for phone and a substack for tablet (with iPad ratio, 1024*768).
i use the fullscreenmode to « show all »

On android tablet, the ratio height/width is sometimes very different from iPad.
I tried to change the height of the substack before open it but with no luck :

// in the openstack handler of the mainstack
put item 3 of the screenrect into theight

put item 4 of the screenrect into twidth

put theight/twidth into tratio

set the height of stack "substackTablet" to round(1024*tratio)

mobileSetAllowedOrientations("portrait")

open stack "substackTablet"

set the fullscreenmode of stack  "substackTablet" to "showall"

set the height of  grp "grpbackground"  of stack  "substackTablet" to round(1000*tratio)


=> as result, the top of the stack and the bottom of the stack aren’t the top and the bottom of the screen. If i want my background group cover all the screen i need to set this top to -200 for example.

How get the « real » rect of the stack ?

Thanks
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
you could try using either the working or effective adjectives before the
screenRect

working ScreenRect

effective screenRect

to see if you get better results?

from the dictionary

/Adding the working adjective to either form returns the virtual
co-ordinates of each screen's working-area. The working-area of a screen is
defined to be the area not covered by OS furniture (such as the task bar on
Windows, and the Dock and Menubar on Mac OS X).

Adding the effective adjective to either form returns the area of the screen
the application has to itself. In particular, if the keyboard is activated,
it take into account if the keyboard is taking up space on the screen.
(Android and iOS only)

Note: The co-ordinates returned by the screenRect family of functions can be
anywhere in the virtual desktop /





-----
Andy Piddock


My software never has bugs. It just develops random features.

TinyIDE  a Free alternative minimalist IDE Plugin for LiveCode


Script editor Themer for LC http://2108.co.uk 

PointandSee is a FREE simple but full featured under cursor colour picker / finder.
http://www.pointandsee.co.uk  - made with LiveCode
--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
In reply to this post by Stephen MacLean via use-livecode
I have a similar issue with a stack that

a) contains a browser that wants to fill the entire screen (of any device)
b) a tool bar on the bottom, the background ( 50 px wide) which to set to 2000 wide
c) a 4 widget that appear on bottom on top to background.

It should work on portrait and landscape

That's it, not a complicated screen to layout, responsive... or so we thought....

Going around and around with this on support, I was using "show all"
set at 414x736 (iPhone); and with Jacque's help to optimize my code

This left pillar boxes left and right (show the stack/card color) on my Android.

Using all the "new methods"

mobileSetFullScreenRectForOrientations "portrait,portrait upside down","0,0,414,736"

etc

We were unable to gain programmatic control to use screenrect to fit the device.

My Guess/I am wrong, HQ could let us know:

seems the  fullscreenmode[what-Ever-It-Is] will, at an engine level will override any attempt to do the simple "responsive" handlers of

========

# snip the orientation changed handlers,

# but it all comes down to this:

        put the screenrect into tRect

        set rect to widget "browser" to \

                (item 1 of the tRect, item 2 of the tRect, item 3 of tRect, item 4 of tRect-50)

========

Support said

use fullscreenmode "exactFit"

Jacque predicted it would fail, all kinds of distortion. I used tried it, worked on the Pixel. (ratio of the widget at bottom barely noticeable) I happily deployed to my "nightly" branch

When I finally dug out an iPad to test--oh horror, Jacque was right -- the widget and the bottom were all stretched out!

So, I was stuck, went on another project, but I too would like to

 Ludovic THEBAULT  wrote:

How get the « real » rect of the stack ?

is seems, if you want to do "responsive" design, that it will need to be done *without* using fullscreenmode, and do it by handling the screenrect yourself.  Which defeats the purpose of fullScreenMode  "help" for the developer.

 @Andy  I will try the effective Screenrect to see what we get.

BR



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
For your browser example, you probably want to use noScale. You just need to be sure you capture the rect at the right time. You don’t know the new rect until after the orientation changed handler ends. I’ll see if I can locate that stack example again that you put up. Unfortunately I can only test on iOS right now.

One good thing I discovered is that the content inside the browser widget is always native resolution (at least I thought so). So the only part of the screen that would have distortion would be the elements outside the widget if you used exactFit. It sounds like that was not the case for you though.

I agree... the fullScreenModes are most useful when you want the elements of the application to scale with the device size.

Thanks,
Brian
On Aug 18, 2018, 11:37 AM -0500, Sannyasin Brahmanathaswami via use-livecode <[hidden email]>, wrote:

> I have a similar issue with a stack that
>
> a) contains a browser that wants to fill the entire screen (of any device)
> b) a tool bar on the bottom, the background ( 50 px wide) which to set to 2000 wide
> c) a 4 widget that appear on bottom on top to background.
>
> It should work on portrait and landscape
>
> That's it, not a complicated screen to layout, responsive... or so we thought....
>
> Going around and around with this on support, I was using "show all"
> set at 414x736 (iPhone); and with Jacque's help to optimize my code
>
> This left pillar boxes left and right (show the stack/card color) on my Android.
>
> Using all the "new methods"
>
> mobileSetFullScreenRectForOrientations "portrait,portrait upside down","0,0,414,736"
>
> etc
>
> We were unable to gain programmatic control to use screenrect to fit the device.
>
> My Guess/I am wrong, HQ could let us know:
>
> seems the fullscreenmode[what-Ever-It-Is] will, at an engine level will override any attempt to do the simple "responsive" handlers of
>
> ========
>
> # snip the orientation changed handlers,
>
> # but it all comes down to this:
>
> put the screenrect into tRect
>
> set rect to widget "browser" to \
>
> (item 1 of the tRect, item 2 of the tRect, item 3 of tRect, item 4 of tRect-50)
>
> ========
>
> Support said
>
> use fullscreenmode "exactFit"
>
> Jacque predicted it would fail, all kinds of distortion. I used tried it, worked on the Pixel. (ratio of the widget at bottom barely noticeable) I happily deployed to my "nightly" branch
>
> When I finally dug out an iPad to test--oh horror, Jacque was right -- the widget and the bottom were all stretched out!
>
> So, I was stuck, went on another project, but I too would like to
>
> Ludovic THEBAULT wrote:
>
> How get the « real » rect of the stack ?
>
> is seems, if you want to do "responsive" design, that it will need to be done *without* using fullscreenmode, and do it by handling the screenrect yourself. Which defeats the purpose of fullScreenMode "help" for the developer.
>
> @Andy I will try the effective Screenrect to see what we get.
>
> BR
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
In reply to this post by Stephen MacLean via use-livecode
Ludovic THEBAULT wrote:

 > I’ve a stack for phone and a substack for tablet (with iPad ratio,
 > 1024*768). i use the fullscreenmode to « show all »
 >
 > On android tablet, the ratio height/width is sometimes very different
 > from iPad.
 > I tried to change the height of the substack before open it but with
no luck :
 >
 > // in the openstack handler of the mainstack
 > put item 3 of the screenrect into theight
 > put item 4 of the screenrect into twidth
 > put theight/twidth into tratio
 > set the height of stack "substackTablet" to round(1024*tratio)
 > mobileSetAllowedOrientations("portrait")
 > open stack "substackTablet"
 > set the fullscreenmode of stack  "substackTablet" to "showall"
 > set the height of  grp "grpbackground"  of stack  "substackTablet" to
round(1000*tratio)
 >
 >
 > => as result, the top of the stack and the bottom of the stack aren’t
 > the top and the bottom of the screen. If i want my background group
 > cover all the screen i need to set this top to -200 for example.
 >
 > How get the « real » rect of the stack ?

Without fullScreenMode it's as simple as:

     get the rect of this stack

FullScreenMode makes handling dynamic layout details complex.

It's well suited for certain types of games or multimedia presentations,
such as Monument Valley.

In those types of layouts everything is stretched to fit, without
needing dynamic placement of individual controls.

But consider the apps on your phone.  The ones I use the most are
gMmail, Firefox, YouTube, Twitter, Instagram, LinkedIn, Skype,
SimpleNote, Play Music, Nextcloud, Hangouts, Telegram, Maps, Calculator,
Ingres, and a few others.

Every one of them uses dynamic positioning of the sort we've been doing
in LiveCode for decades by responding to the resizeStack message.

I don't know what you're working on so I can't have an opinion of
whether fullScreenMode is a good fit.

But in practice I so rarely see other apps use that sort of scaling that
I don't think about fullScreenMode much at all.

Now that we've had several years since the LC team did a great job of
delivering resolution independence, handling layouts in mobile is a
breeze compared to the complex workarounds needed before.

With LC's logical pixels, have total control over our layouts to make
optimal use of every precious pixel on small screens, all with no more
work than we've already become accustomed to after years of scripting
for resizable windows.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
In reply to this post by Stephen MacLean via use-livecode
Here is the card script that I just tested on iOS.  It will rotate a two
object card between portrait/landscape on my phone with no issues.  It
handles either orientation as the initial orientation.

local sOrientation, sLongSide, sShortSide

on preOpenCard
   local tScreenRect

   if the environment is "mobile" then
      set the fullscreenmode of this stack to "noScale"
   end if

   -- get the dimensions of the current screen
   put the screenRect into tScreenRect

   -- figure out long/short sides
   if item 3 of tScreenRect > item 4 of tScreenRect then
      put item 3 of tScreenRect into sLongSide
      put item 4 of tScreenRect into sShortSide
   else
      put item 4 of tScreenRect into sLongSide
      put item 3 of tScreenRect into sShortSide
   end if

   put word 1 of mobileDeviceOrientation() into sOrientation
   if sOrientation is not in "portrait,landscape" then
      put "portrait" into sOrientation
   end if
   resizeStack
end preOpenCard


on orientationChanged
   local tNewOrientation

   put word 1 of mobileDeviceOrientation() into tNewOrientation
   if tNewOrientation is in "portrait,landscape" then
      put tNewOrientation into sOrientation
      resizeStack
   end if
end orientationChanged


on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
   local tStackRect, tBrowserRect, tNavbarRect

   if sOrientation is "landscape" then
      put 0, 0, sLongSide, sShortSide into tStackRect
   else
      put 0, 0, sShortSide, sLongSide into tStackRect
   end if

   put tStackRect into tBrowserRect
   put item 4 of tStackRect - 50 into item 4 of tBrowserRect
   put tStackRect into tNavbarRect
   put item 4 of tBrowserRect into item 2 of tNavbarRect

   lock screen
   set the rect of this stack to tStackRect
   set the rect of widget "Browser" of me to tBrowserRect
   set the rect of widget "Navigation Bar" of me to tNavbarRect
   unlock screen
end resizeStack


On Sat, Aug 18, 2018 at 12:22 PM, Brian Milby <[hidden email]> wrote:

> For your browser example, you probably want to use noScale. You just need
> to be sure you capture the rect at the right time. You don’t know the new
> rect until after the orientation changed handler ends. I’ll see if I can
> locate that stack example again that you put up. Unfortunately I can only
> test on iOS right now.
>
> One good thing I discovered is that the content inside the browser widget
> is always native resolution (at least I thought so). So the only part of
> the screen that would have distortion would be the elements outside the
> widget if you used exactFit. It sounds like that was not the case for you
> though.
>
> I agree... the fullScreenModes are most useful when you want the elements
> of the application to scale with the device size.
>
> Thanks,
> Brian
> On Aug 18, 2018, 11:37 AM -0500, Sannyasin Brahmanathaswami via
> use-livecode <[hidden email]>, wrote:
>
> I have a similar issue with a stack that
>
> a) contains a browser that wants to fill the entire screen (of any device)
> b) a tool bar on the bottom, the background ( 50 px wide) which to set to
> 2000 wide
> c) a 4 widget that appear on bottom on top to background.
>
> It should work on portrait and landscape
>
> That's it, not a complicated screen to layout, responsive... or so we
> thought....
>
> Going around and around with this on support, I was using "show all"
> set at 414x736 (iPhone); and with Jacque's help to optimize my code
>
> This left pillar boxes left and right (show the stack/card color) on my
> Android.
>
> Using all the "new methods"
>
> mobileSetFullScreenRectForOrientations "portrait,portrait upside
> down","0,0,414,736"
>
> etc
>
> We were unable to gain programmatic control to use screenrect to fit the
> device.
>
> My Guess/I am wrong, HQ could let us know:
>
> seems the fullscreenmode[what-Ever-It-Is] will, at an engine level will
> override any attempt to do the simple "responsive" handlers of
>
> ========
>
> # snip the orientation changed handlers,
>
> # but it all comes down to this:
>
> put the screenrect into tRect
>
> set rect to widget "browser" to \
>
> (item 1 of the tRect, item 2 of the tRect, item 3 of tRect, item 4 of
> tRect-50)
>
> ========
>
> Support said
>
> use fullscreenmode "exactFit"
>
> Jacque predicted it would fail, all kinds of distortion. I used tried it,
> worked on the Pixel. (ratio of the widget at bottom barely noticeable) I
> happily deployed to my "nightly" branch
>
> When I finally dug out an iPad to test--oh horror, Jacque was right -- the
> widget and the bottom were all stretched out!
>
> So, I was stuck, went on another project, but I too would like to
>
> Ludovic THEBAULT wrote:
>
> How get the « real » rect of the stack ?
>
> is seems, if you want to do "responsive" design, that it will need to be
> done *without* using fullscreenmode, and do it by handling the screenrect
> yourself. Which defeats the purpose of fullScreenMode "help" for the
> developer.
>
> @Andy I will try the effective Screenrect to see what we get.
>
> BR
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
In reply to this post by Stephen MacLean via use-livecode
Actually, the rect of the stack remains constant in fullscreenmode, you
don't need to account for the engine resizing. All placement calculations
can be done normally. That's one of the beauties of it.

Handling dynamic placement is no different than without fullscreenmode,
except that you don't need to worry about ratios, resolution, or any of that.

--
Jacqueline Landman Gay | [hidden email]
HyperActive Software | http://www.hyperactivesw.com
On August 18, 2018 1:48:09 PM Richard Gaskin via use-livecode
<[hidden email]> wrote:
>
> Without fullScreenMode it's as simple as:
>
>     get the rect of this stack
>
> FullScreenMode makes handling dynamic layout details complex.




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
On 8/18/18 7:52 PM, J. Landman Gay via use-livecode wrote:
> Actually, the rect of the stack remains constant in fullscreenmode, you
> don't need to account for the engine resizing. All placement
> calculations can be done normally. That's one of the beauties of it.

I didn't express this exactly right -- it remains constant in that the
rect of the stack represents the current on-screen rect rather than the
size it was created at.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
In reply to this post by Stephen MacLean via use-livecode
@Sannyasin

Something just clicked... if fullscreenmode is not empty, then resizestack
messages are not generated.  Which is part of why the new commands were
created.  For what you want with the browser, your handlers should be very
simple.  Here's what I came up with to put the browser widget and a nav bar
on a card.  I didn't need to mess with orientation changed messages at all
since the relative positions of everything is static.  Here's my very
simplified card script:

on preOpenCard
   if the environment is "mobile" then
      set the fullscreenmode of this stack to empty
   end if
   resizeStack the width of this stack, the height of this stack
end preOpenCard

on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
   local tBrowserRect, tNavbarRect

   put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect
   put 0, pNewHeight - 50, pNewWidth, pNewHeight into tNavbarRect

   lock screen
   set the rect of widget "Browser" of me to tBrowserRect
   set the rect of widget "Navigation Bar" of me to tNavbarRect
   unlock screen
end resizeStack

I tested it out on my iPhone and it seemed to work well.  (The preOpenCard
resizeStack is needed or else the card will be displayed in whatever size
it was originally developed in at the top left of the screen.)

Thanks,
Brian
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
In reply to this post by Stephen MacLean via use-livecode
On 8/18/18 8:46 AM, Richard Gaskin via use-livecode wrote:
> With LC's logical pixels, have total control over our layouts to make
> optimal use of every precious pixel on small screens, all with no more
> work than we've already become accustomed to after years of scripting
> for resizable windows.

Aloha, Richard,

How you are keeping well, the father-in-law health business, keeping 24
hour vigil (we know about that!) et. al.

re Geometry: You keep telling us this again and again, but you never
provide an example. I would be great if you to put example stack of say,
a card with 20 controls, where you make the UI responsive for any device
rect,   I beginning to think the "fullScreenMode [whatEver]" may not be
the best fit for my needs. But would not no where to being-- "I need to
see the code!" I am one who "builds on tradition" and we like to have
have to re-invent the wheel.

Brahmanathaswami


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
If you just want the controls to have the same relative position/size, then the GM can handle this. If you want to change metrics based on portrait/landscape then you either need to add PM or write a custom resize handler that takes orientation into account. My code above should work for the first case (does not use GM). I’ll add something later this afternoon that takes orientation into account.

Thanks,
Brian
On Aug 19, 2018, 9:19 AM -0500, Sannyasin Brahmanathaswami via use-livecode <[hidden email]>, wrote:

> On 8/18/18 8:46 AM, Richard Gaskin via use-livecode wrote:
> > With LC's logical pixels, have total control over our layouts to make
> > optimal use of every precious pixel on small screens, all with no more
> > work than we've already become accustomed to after years of scripting
> > for resizable windows.
>
> Aloha, Richard,
>
> How you are keeping well, the father-in-law health business, keeping 24
> hour vigil (we know about that!) et. al.
>
> re Geometry: You keep telling us this again and again, but you never
> provide an example. I would be great if you to put example stack of say,
> a card with 20 controls, where you make the UI responsive for any device
> rect, I beginning to think the "fullScreenMode [whatEver]" may not be
> the best fit for my needs. But would not no where to being-- "I need to
> see the code!" I am one who "builds on tradition" and we like to have
> have to re-invent the wheel.
>
> Brahmanathaswami
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
In reply to this post by Stephen MacLean via use-livecode
@Brian Milby

Something just clicked... if fullscreenmode is not empty, then resizestack
messages are not generated.

You are right!  No "fillscreenmode" and 14 line of code works on iPhone.

But on not my Pixel.


----------------------

# Geometry

on preOpenCard

    resizeStack the width of this stack, the height of this stack

end preOpenCard

on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight

   # check it is landscape, turn off the navigation Bar

    if tNewWidth > pNewHeight then

        put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect

        hide group "footer"

    else

        put 0, 0, pNewWidth, pNewHeight into tBrowserRect

        show group "footer"

end if

set the rect of widget "body" of me to tBrowserRect

end resizeStack


I will issue a bug report.


BR

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
You probably still want to set the rect for the footer to be sure it lands
where you want it on different size devices.  That could be done in the
preOpenCard handler (just put it where it needs to be for portrait)

on preOpenCard
   local tWidth, tHeight, tFooterRect
   put the width of this stack into tWidth
   put the height of this stack into tHeight
   if tWidth > tHeight then
      put 0,tWidth-50,tHeight,tWidth into tFooterRect
   else
      put 0,tHeight-50,tWidth,tHeight into tFooterRect
   end if
   set the rect of widget "footer" of me to tFooterRect
   resizeStack tWidth, tHeight
end preOpenCard

If the Pixel does receive the orientationChanged messages, then you could
use my first example.  That code does actually work on the iPhone, it is
just not necessary to manage it by hand like that.

On Sun, Aug 19, 2018 at 2:40 PM, Sannyasin Brahmanathaswami via
use-livecode <[hidden email]> wrote:

> @Brian Milby
>
> Something just clicked... if fullscreenmode is not empty, then resizestack
> messages are not generated.
>
> You are right!  No "fillscreenmode" and 14 line of code works on iPhone.
>
> But on not my Pixel.
>
>
> ----------------------
>
> # Geometry
>
> on preOpenCard
>
>     resizeStack the width of this stack, the height of this stack
>
> end preOpenCard
>
> on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
>
>    # check it is landscape, turn off the navigation Bar
>
>     if tNewWidth > pNewHeight then
>
>         put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect
>
>         hide group "footer"
>
>     else
>
>         put 0, 0, pNewWidth, pNewHeight into tBrowserRect
>
>         show group "footer"
>
> end if
>
> set the rect of widget "body" of me to tBrowserRect
>
> end resizeStack
>
>
> I will issue a bug report.
>
>
> BR
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
Android does receive orientationChanged messages. I've been tinkering
with Swami's test stack, and dynamic positioning (no fullscreenMode)
works fine with some effort.

The footer isn't a widget, it's a group containing half a dozen
controls, so they all need to be individually managed. You were right
that they weren't in the correct position on Android.

Swami's real project has thousands of controls over many hundreds of
unique cards. I'd hate to be the one to write all the positioning
scripts for that. But for a single instance where he's having issues,
turning off fullscreenMode for just that card is a feasible solution.

On 8/19/18 4:05 PM, Brian Milby via use-livecode wrote:

> You probably still want to set the rect for the footer to be sure it lands
> where you want it on different size devices.  That could be done in the
> preOpenCard handler (just put it where it needs to be for portrait)
>
> on preOpenCard
>     local tWidth, tHeight, tFooterRect
>     put the width of this stack into tWidth
>     put the height of this stack into tHeight
>     if tWidth > tHeight then
>        put 0,tWidth-50,tHeight,tWidth into tFooterRect
>     else
>        put 0,tHeight-50,tWidth,tHeight into tFooterRect
>     end if
>     set the rect of widget "footer" of me to tFooterRect
>     resizeStack tWidth, tHeight
> end preOpenCard
>
> If the Pixel does receive the orientationChanged messages, then you could
> use my first example.  That code does actually work on the iPhone, it is
> just not necessary to manage it by hand like that.
>
> On Sun, Aug 19, 2018 at 2:40 PM, Sannyasin Brahmanathaswami via
> use-livecode <[hidden email]> wrote:
>
>> @Brian Milby


--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
I did figure out that within preOpenCard, the reported stack rect is still
the dimensions of the saved stack file (at least on iOS).  There is also
the detail that when you hide a group, it sets all of the objects to hidden
which has to be undone in a loop.  I've worked out moving the group and the
background grc, still looking at the math for the widget buttons.  This
would probably be a good place for the Navigation Bar with the option to
select none of the icons (PR submitted, still pending).

On Sun, Aug 19, 2018 at 5:31 PM, J. Landman Gay via use-livecode <
[hidden email]> wrote:

> Android does receive orientationChanged messages. I've been tinkering with
> Swami's test stack, and dynamic positioning (no fullscreenMode) works fine
> with some effort.
>
> The footer isn't a widget, it's a group containing half a dozen controls,
> so they all need to be individually managed. You were right that they
> weren't in the correct position on Android.
>
> Swami's real project has thousands of controls over many hundreds of
> unique cards. I'd hate to be the one to write all the positioning scripts
> for that. But for a single instance where he's having issues, turning off
> fullscreenMode for just that card is a feasible solution.
>
> On 8/19/18 4:05 PM, Brian Milby via use-livecode wrote:
>
>> You probably still want to set the rect for the footer to be sure it lands
>> where you want it on different size devices.  That could be done in the
>> preOpenCard handler (just put it where it needs to be for portrait)
>>
>> on preOpenCard
>>     local tWidth, tHeight, tFooterRect
>>     put the width of this stack into tWidth
>>     put the height of this stack into tHeight
>>     if tWidth > tHeight then
>>        put 0,tWidth-50,tHeight,tWidth into tFooterRect
>>     else
>>        put 0,tHeight-50,tWidth,tHeight into tFooterRect
>>     end if
>>     set the rect of widget "footer" of me to tFooterRect
>>     resizeStack tWidth, tHeight
>> end preOpenCard
>>
>> If the Pixel does receive the orientationChanged messages, then you could
>> use my first example.  That code does actually work on the iPhone, it is
>> just not necessary to manage it by hand like that.
>>
>> On Sun, Aug 19, 2018 at 2:40 PM, Sannyasin Brahmanathaswami via
>> use-livecode <[hidden email]> wrote:
>>
>> @Brian Milby
>>>
>>
>
> --
> Jacqueline Landman Gay         |     [hidden email]
> HyperActive Software           |     http://www.hyperactivesw.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
In reply to this post by Stephen MacLean via use-livecode
Jacque wrote:
 > Android does receive orientationChanged messages. I've been tinkering
 > with Swami's test stack, and dynamic positioning (no fullscreenMode)
 > works fine with some effort.

Is there a benefit to responding to orientationChanged instead of
resizeStack?

As long as both messages are sent it may not matter, but that's the
thing I'm unclear on: what does orientationChanged tell us on a mobile
device that resizeStack doesn't?  When is one sent without the other
sent immediately after?


Brian wrote:
 > I did figure out that within preOpenCard, the reported stack rect is
 > still the dimensions of the saved stack file (at least on iOS).

That makes sense in a way, in that preOpenCard is sent before rendering
and on mobile devices the stack is automatically resized, seemingly at
the start of the rendering queue.

Still, it seems unintuitive.  Is there a reason preOpenCard couldn't be
sent after the stack is resized but before the rendering of the content
region occurs?

FWIW I find resizeStack works well there too, apparently sent within the
order of things where preOpenCard is expected here, after the stack is
resized but before the user sees the rendering result.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode


> On 20 Aug 2018, at 10:53 am, Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> As long as both messages are sent it may not matter, but that's the thing I'm unclear on: what does orientationChanged tell us on a mobile device that resizeStack doesn't?  When is one sent without the other sent immediately after?

When you have a fullscreenMode set then the stack doesn’t resize unless you either explicitly set the rect or (since 8.1.10) use mobileSetFullScreenRectForOrientations to specify a different rect for the orientation you are moving to. If the stack does not resize then it does not get sent a resizeStack message. Also the stack is sent orientationChanged regardless of the state of allowed orientations so if it’s not an allowed orientation then there may be no change and therefore no resizeStack.

Cheers

Monte
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
In reply to this post by Stephen MacLean via use-livecode
@Brian and all > glad this opened an important discussion..

and thank to the attempt to make it work @Brian footer control were too far down on that card(android)

Many of cards in the SivaSiva app, would need major geometry refactoring (month(s) of work) without fullScreenMode...so I am not considering give that up. Any appreciation the on going discussion .

But a browsers are integral to app, with HTML5 "presentions" coming and slideshow.

I wanted "responsive to any screen size on all devices"  for a simple browser stack with has a "body" (browser widget) and 5 controls on the bottom -- group "footer" why? we want cover the whole screen, with "pillar boxes"  and the CSS will do the "real" positioning.

in the surface is appear that one does not need:

 FullScreenMode / mobileSetFullScreenRectForOrientations
orientationChanged

"Intuitively" resize stack is all that is required.
And, "intuitively" a group should place all controls relative to itself.

And it does on iOS

see:

go  stack url "http://wiki.hindu.org/uploads/BrowserLandscapeTest_r8.livecode"<http://wiki.hindu.org/uploads/BrowserLandscapeTest_r8.livecode>

without line 14, it works iOS


on preOpenCard

if isMobile() then

    mobileSetAllowedOrientations "portrait,portrait upside down,landscape left,landscape right"

end if

end preOpenCard

on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight

# check it is landscape, turn off the navigation Bar

    if pNewWidth > pNewHeight then -- landscape

        put 0, 0, pNewWidth, pNewHeight into tBrowserRect

        hide group "footer"

    else

        put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect

  #line14       # set loc group "footer" to (pNewWidth/2,pNewHeight-25)

        show group "footer"

    end if

    set the rect of widget "body" of me to tBrowserRect

end resizeStack

function isMobile

    return environment() = "mobile"

end isMobile

But the group "footer" was no appearing on Android.

Jacque had her finger on it with this comment.

Jacque (off list)

"I see. That looks like a redraw problem. The resizeStack handler is working but the redraw fails. I did notice the icons were missing but didn't try to figure out why. A quick test says the footer is visible in portrait and false in landscape, but it isn't being drawn to screen for some reason. I think that's the bug to report."

My "gut" told me "we just have to make footer redraw"

This "gut" said: give the loc and it will redraw


on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight

# check it is landscape, turn off the navigation Bar

    if pNewWidth > pNewHeight then -- landscape

        put 0, 0, pNewWidth, pNewHeight into tBrowserRect

        hide group "footer"

    else

        put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect

        set loc group "footer" to (pNewWidth/2,pNewHeight-25)

        show group "footer"

    end if

    set the rect of widget "body" of me to tBrowserRect

end resizeStack

and Bingo! It work on iOS and Android! (if someone could try in an android tablet I would appreciate), so it works, and I have a bug to report.

But responsive screen in 19 lines of code! The child controls-the widget in the footer can stay where to are, in portrait, regardless on screen size/ration, there is no reason to "work it that hard"

Brahmanathaswami






On 8/19/18 1:21 PM, Brian Milby via use-livecode wrote:

I did figure out that within preOpenCard, the reported stack rect is still
the dimensions of the saved stack file (at least on iOS).  There is also
the detail that when you hide a group, it sets all of the objects to hidden
which has to be undone in a loop.  I've worked out moving the group and the
background grc, still looking at the math for the widget buttons.  This
would probably be a good place for the Navigation Bar with the option to
select none of the icons (PR submitted, still pending).

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
In reply to this post by Stephen MacLean via use-livecode
On Android, hiding and showing a group works as expected, I don't need to
loop through the controls to show them. At first I thought they weren't
being drawn, but in fact the whole group was below the bottom of the stack.
--
Jacqueline Landman Gay | [hidden email]
HyperActive Software | http://www.hyperactivesw.com
On August 19, 2018 6:23:00 PM Brian Milby via use-livecode
<[hidden email]> wrote:

> I did figure out that within preOpenCard, the reported stack rect is still
> the dimensions of the saved stack file (at least on iOS).  There is also
> the detail that when you hide a group, it sets all of the objects to hidden
> which has to be undone in a loop.  I've worked out moving the group and the
> background grc, still looking at the math for the widget buttons.  This
> would probably be a good place for the Navigation Bar with the option to
> select none of the icons (PR submitted, still pending).
>
> On Sun, Aug 19, 2018 at 5:31 PM, J. Landman Gay via use-livecode <
> [hidden email]> wrote:
>
>> Android does receive orientationChanged messages. I've been tinkering with
>> Swami's test stack, and dynamic positioning (no fullscreenMode) works fine
>> with some effort.
>>
>> The footer isn't a widget, it's a group containing half a dozen controls,
>> so they all need to be individually managed. You were right that they
>> weren't in the correct position on Android.
>>
>> Swami's real project has thousands of controls over many hundreds of
>> unique cards. I'd hate to be the one to write all the positioning scripts
>> for that. But for a single instance where he's having issues, turning off
>> fullscreenMode for just that card is a feasible solution.
>>
>> On 8/19/18 4:05 PM, Brian Milby via use-livecode wrote:
>>
>>> You probably still want to set the rect for the footer to be sure it lands
>>> where you want it on different size devices.  That could be done in the
>>> preOpenCard handler (just put it where it needs to be for portrait)
>>>
>>> on preOpenCard
>>>     local tWidth, tHeight, tFooterRect
>>>     put the width of this stack into tWidth
>>>     put the height of this stack into tHeight
>>>     if tWidth > tHeight then
>>>        put 0,tWidth-50,tHeight,tWidth into tFooterRect
>>>     else
>>>        put 0,tHeight-50,tWidth,tHeight into tFooterRect
>>>     end if
>>>     set the rect of widget "footer" of me to tFooterRect
>>>     resizeStack tWidth, tHeight
>>> end preOpenCard
>>>
>>> If the Pixel does receive the orientationChanged messages, then you could
>>> use my first example.  That code does actually work on the iPhone, it is
>>> just not necessary to manage it by hand like that.
>>>
>>> On Sun, Aug 19, 2018 at 2:40 PM, Sannyasin Brahmanathaswami via
>>> use-livecode <[hidden email]> wrote:
>>>
>>> @Brian Milby
>>>>
>>>
>>
>> --
>> Jacqueline Landman Gay         |     [hidden email]
>> HyperActive Software           |     http://www.hyperactivesw.com
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: fullscreenmode and rect of a substack on mobile device ?

Stephen MacLean via use-livecode
In reply to this post by Stephen MacLean via use-livecode
Jacque wrote:

"I see. That looks like a redraw problem. The resizeStack handler
isworking but the redraw fails. I did notice the icons were missing but
didn't try to figure out why. A quick test says the footer is visible it
portrait and false in landscape, but it isn't being drawn to screen for
some reason. I think that's the bug to report."

not that we have a finger on it yet; could be the "visible/invisible"
issue that Brain mentioned. But here goes:
> https://quality.livecode.com/show_bug.cgi?id=21506



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12345