fullscreenmode and rect of a substack on mobile device ?
Brian Milby
brian at milby7.com
Wed Aug 29 16:09:34 EDT 2018
Aren't you calling this as a sub-stack? If so, could you capture the
screen rect before the switch and pass in the data or cache to the file
system and read it in?
On Wed, Aug 29, 2018 at 2:39 PM Sannyasin Brahmanathaswami via use-livecode
<use-livecode at lists.runrev.com> wrote:
> @Hugh
>
> quick update
>
> your code worked; but only after turning the phone (resize handler sent)
>
> but on preopenstack, preopencard, or opencard
>
> setupStackRect
>
>
> fails, because the screenRect is not registered yet (my guess, might be
> something else)
>
> https://quality.livecode.com/show_bug.cgi?id=21538
>
>
> As a result browser is out a place.
>
> Fortunately the user can hit the hardware button to go back. So not
> having my footer is "not big deal." Android users are using to doing that.
>
> So I'm going to release Google Play, can't wait any longer.
>
> But if anyone else expects the screenrect to work on
>
> preopenstack, preopencard, or opencard
>
> if you having trouble.. that's the reason
>
> BR
>
>
>
> on Android the device does not appear to "know it rect)
>
> On 8/24/18 4:20 AM, Sannyasin Brahmanathaswami via use-livecode wrote:
> > I caught typo.
> >
> > I get it to work on iOS but not an Android, so I have a ticket to
> support and that.
> >
> > in an app, there is a lot change from on stack another, I frequently
> have add time from Android to keep up (never on iOS)
> >
> > This is so straight forward, I have to assume there is bug (just a
> quess) in the browser widget "knowing" about the screenRect on Android.
> > I get the screenrect ( on a button the answer the screen rect).... but
> the browser widget does pay attention to this following
> >
> >
> >
> > on preopenstack
> >
> > if isMobile() then
> >
> > mobileSetAllowedOrientations "portrait,portrait upside
> down,landscape left,landscape"
> >
> > end if
> >
> > end preopenstack
> >
> > ----------------------
> >
> > # Geometry
> >
> > on preopencard
> >
> > if isMobile() then
> >
> > send "setUpStackRect" to me in 500 milliseconds
> >
> > end if
> >
> > end preopencard
> >
> > on setupStackRect pWidth,pHeight
> >
> > if pWidth="" and pHeight="" then
> >
> > put the screenRect into tRect
> >
> > set the rect of this stack to tRect
> >
> > set the topLeft of this stack to item 1 to 2 of tRect
> >
> > else
> >
> > put the rect of this stack into tRect
> >
> > put pWidth into item 3 of tRect
> >
> > put pHeight into item 4 of tRect
> >
> > set the rect of this stack to tRect
> >
> > end if
> >
> > set bottom of group "footer" to item 4 of tRect
> >
> > set loc group "footer" to round((item 3 of tRect)/2),(item 4 of
> tRect)-25
> >
> > subtract 50 from item 4 of tRect
> >
> > set the rect of widget "body" to tRect
> >
> > set the topleft of widget "body" to item 1 to 2 of tRect
> >
> > end setupStackRect
> >
> > 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
> >
> > set loc widget "body" to ( round(pNewWidth/2),
> round(pNewHeight/2) )
> >
> > hide group "footer"
> >
> > else
> >
> > put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect
> >
> > set loc group "footer" to ( round(pNewWidth/2),pNewHeight-25)
> >
> > show group "footer"
> >
> > end if
> >
> > set the rect of widget "body" of me to tBrowserRect
> >
> > end resizeStack
> >
> >
> > On 8/23/18 10:17 PM, FlexibleLearning.com via use-livecode wrote:
> >
> > First, I think you have a typo where "/25" should be "-25"...
> >
> > Second, for safety, ensure integer values...
> > set loc group "footer" to round((item 2 of tRect)/2), (item 4 of
> tRect)-25
> >
> > Third, if still not working on preOpenstack, try...
> >
> > on preopenstack
> > if isMobile() then
> > mobileSetAllowedOrientations "portrait,portrait upside down,landscape
> > left,landscape right"
> > end if
> > hide this stack
> > end preopenstack
> >
> > on openStack
> > setupStackRect
> > show this stack
> > end openStack
> >
> > Hugh
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list