fullscreenmode and rect of a substack on mobile device ?

Sannyasin Brahmanathaswami brahma at hindu.org
Fri Aug 24 10:19:51 EDT 2018


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




More information about the use-livecode mailing list