Orientation issues

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Orientation issues

Post by MaxV » Mon Feb 03, 2014 4:41 pm

Hi,
I have some question about orientation:
  • In standalone application setting I put "portait" as initial orientation, but I also allow all orientations (using mobileSetAllowedOrientations). However the orientation changes correctly only when I rotate the device, but if I open the app landscape it remains "portrait", it doesn't rotate until I start to shake the device :lol: . How can I open the app with the right orientation? Which message do I need to send?
  • Orientation sensor sensitivity is to high, if I incline a little back my device, orientation starts to flick. Is there a way to set a lower sensitivity?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Orientation issues

Post by Dixie » Mon Feb 03, 2014 5:01 pm

send a 'resizeStack' message in the openStack handler, assuming that you are using that in conjunction with the orientationChanged message..

besides 'portrait', 'portrait upside down', 'landscape left' and 'landscape right'... you can also handle 'unknown', 'face up' and 'face down' orientation messages. I have used the 'face up' and 'face down' orientations before when experiencing the problems you are seeing.

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Orientation issues

Post by MaxV » Mon Feb 03, 2014 5:30 pm

You solved my second question, I used orientationChanged but for screen orientation is better resizeStack, since orientationChanged uses all three axis (x,y, z), and it is a mess.

About my first question, what code should I write?

I wrote

Code: Select all

on OpenStack
   send resizestack to me
end OpenStack
without any result.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Orientation issues

Post by Dixie » Mon Feb 03, 2014 5:36 pm

something like...

Code: Select all

on orientationChanged
   resizeStack
end orientationChanged

on resizeStack
   /* update the screen to suit the change in orientation between 'portrait' & landscape' */
   if environment() = "mobile" then
      if "portrait" is among the words of  mobileDeviceOrientation() then 
         -- do whatever
      end if
      if "landscape" is among the words of  mobileDeviceOrientation() then 
         -- do whatever
      end if
   end if
end resizeStack
EDIT : if you want to send the resizestack then just issue the command 'resizeStack'.

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Orientation issues

Post by MaxV » Thu Feb 06, 2014 2:29 pm

Dixie wrote:EDIT : if you want to send the resizestack then just issue the command 'resizeStack'.
I still can't obtain the correct orientation on opening the app:
  • place may phone landscape
  • open the app on my phone
  • I get:
Image
It' perfectly resized, but it still continue to mantain the "initial orentation setting" untill I rotate the mobile phone.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

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

Re: Orientation issues

Post by LCNeil » Thu Feb 06, 2014 4:46 pm

Hi MaxV,

I believe what you are experiencing is a bug that we are aware of. More information on this can be found here-

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

Kind Regards,


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

Post Reply