app screen first appears upside down

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Joe Kot
Posts: 37
Joined: Wed Sep 14, 2011 2:49 pm

app screen first appears upside down

Post by Joe Kot » Sun Sep 01, 2013 3:12 am

My app screen first appears upside down until I rotate my tablet at least 45 degrees. Then it will correctly orientate right side up. Is there a way to have it orientate correctly (right side up) on launching without having to rotate the tablet. My code is below.
on preopencard
if environment() = "mobile" then
mobileSetAllowedOrientations("landscape left, "landscape right")
end if
end preopencard

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: app screen first appears upside down

Post by SparkOut » Sun Sep 01, 2013 10:16 am

I don't know, but you could try something like setting only a single allowed orientation, locking it on start up, then once the app is initialised, you could set the alternative allowed orientations again, and unlock to allow normal rotation with the alternative orientations to take effect.

?

Joe Kot
Posts: 37
Joined: Wed Sep 14, 2011 2:49 pm

Re: app screen first appears upside down

Post by Joe Kot » Sun Sep 01, 2013 3:36 pm

I tried your suggestion by inserting the following with no success. I hope I'm wrong but what I think is needed is a new command in livecode that checks the current tablet screen orientation (before app launch) and "sets" the livecode app to that screen orientation. As it is right now a landscape app has a 50/50 change of initially displaying upside down until the user tries rotating the tablet. I've check other apps on googleplay and they do not have this problem. If I'm wrong please let me/us know. Thanks - Joe

on preopenstack
if environment() = "mobile" then
mobileSetAllowedOrientations("landscape left")
mobileLockOrientation
end if
end preopenstack
then
on preopencard
mobileUnlockOrientation
mobileSetAllowedOrientations("landscape left, landscape right")
end if
end preopencard

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: app screen first appears upside down

Post by SparkOut » Sun Sep 01, 2013 9:27 pm

There is the mobileOrientation() function available. I said earlier I don't know, but I think you could use this if you called it early enough, and put the unlock late enough in the processing order. You don't need to allow the orientation to change until after the first card is shown so how about:

Code: Select all

on preOpenStack
   if the environment is "mobile" then
      put mobileOrientation() into tAllowedOrientation
      mobileSetAllowedOrientations tAllowedOrientation
      mobileLockOrientation
   end if
end preOpenStack
in the stack script and

Code: Select all

on openCard
   if the environment is "mobile" then
      mobileSetAllowedOrientations "landscape left,landscape right"
      mobileUnlockOrientation
   end if
end openCard
in the card script.
It seems to work OK in my very cursory testing here.

Joe Kot
Posts: 37
Joined: Wed Sep 14, 2011 2:49 pm

Re: app screen first appears upside down

Post by Joe Kot » Mon Sep 02, 2013 1:23 pm

Unfortunately the code provided does not work. Runrev support has confirmed the issue and I have submitted a bug report.
From runrev support:
Even though you have your mobileSetAllowedOrientations set to both landscape left
and right, tho command will only be triggered the next time an orientation change
has been applied. This explains why you have to rotate the device before the correct
orientation is applied.

juanjo
Posts: 35
Joined: Wed Jul 31, 2013 10:31 am

Re: app screen first appears upside down

Post by juanjo » Sun Sep 29, 2013 6:17 pm

Seems not solved yet…

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: app screen first appears upside down

Post by LCNeil » Mon Sep 30, 2013 12:50 pm

Hi Juanjo,

One of our dev team is still investigating this issue. We should hopefully have a resolution shortly.

You will be able to view the Quality Control report relating to it here -

http://quality.runrev.com/show_bug.cgi?id=11146

Once any development are made regarding the issue, they will be announced on this report.

Kind Regards,

Neil Roger

--
RunRev Support Team ~ http://www.runrev.com
--

juanjo
Posts: 35
Joined: Wed Jul 31, 2013 10:31 am

Re: app screen first appears upside down

Post by juanjo » Mon Sep 30, 2013 11:14 pm

Thanks Neil!

paul_gr
Posts: 319
Joined: Fri Dec 08, 2006 7:38 pm

Re: app screen first appears upside down

Post by paul_gr » Mon Mar 31, 2014 12:26 am

runrevneil wrote: One of our dev team is still investigating this issue. We should hopefully have a resolution shortly.
It's been 6 months -- "shortly" this isn't.

Paul

Post Reply