fullscreenmode and rect of a substack on mobile device ?
Sannyasin Brahmanathaswami
brahma at hindu.org
Tue Sep 4 11:38:40 EDT 2018
I woke up with a "dream" saying ..."hmmm maybe it just a timing issue;
stay away from "preopen[anything]
At least in my case, this worked out of box, super simple
9 line of code to get initial placement
12 line of code in my resize handler
!
So long as
a) the card is rendered
b) all other open and close stack operation are finished
c) and you stay away from preopenstack/preopencard
# disclaimer -- could have kept going to find the exact recipe in the
pre* handlers
# may be they would work
# But I have spent too much time to fiddle with it more.
*local*LocalArray, sScreenRect
*on*openCard
*# hide browser for now
*
* hide*widget"body"
* if* isMobile() *then*
* send*"setUpStackRect"tomein500milliseconds
* end* *if*
*end*openCard
*-------------*
*--# Geometry, initial placement
*
*on*setupStackRect
* put*mobileRectGet() intosScreenRect
# get to screenrect of the main backscript library
*# place footer*
* set*bottomof*group*"footer"toitem4ofsScreenRect
*
set*loc*group*"footer"toround((item3ofsScreenRect)/2),(item4ofsScreenRect)-25
* show**group*"footer"
*# place Browser*
* subtract*50fromitem4ofsScreenRect
* set*therectofwidget"body"tosScreenRect
* show*widget"body"
*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 intotBrowserRect
* set*locwidget"body"to( round(pNewWidth/2), round(pNewHeight/2) )
* hide**group*"footer"
* else*
* put*0, 0, pNewWidth, pNewHeight - 50intotBrowserRect
* set*loc*group*"footer"to( round(pNewWidth/2),pNewHeight-25)
* show**group*"footer"
* end* *if*
* set*therectofwidget"body"ofmetotBrowserRect
*end*resizeStack
BR
On 8/24/18 5:43 PM, J. Landman Gay via use-livecode wrote:
> It's more complicated than that. Using the iPad Air simulator and this
> preOpenCard handler:
>
> on preopenstack
> mobileSetAllowedOrientations("portrait")
> iphoneUseDeviceResolution true,true
> end preopenstack
>
> When I press the "Get the rect" button it reports the stack, card, and
> screenrect are all 0,0,640,960.
--
Svasti Astu, Be Well!
Brahmanathaswami
Get the SivaSiva app, it's free:
https://www.himalayanacademy.com/apps/sivasiva
More information about the use-livecode
mailing list