Smooth Orientation Changes
Posted: Mon Aug 04, 2014 11:18 pm
Forum,
I have an Android App that I'm finishing and want to improve the user experience when they change the orientation of the device. Here is how I have it set up to adjust the stack when the screen orientation changes.
The problem is that as the device is moved the screen goes to the wrong size, so the screen looks small with wide dark areas on the sides. See attached images. This is quite annoying to the user.
As far as I can tell the device is telling the program to change orientation pre-maturely and it really as not changed the orientation yet, so the OrientationChanged code is working properly, but not getting the correct effect.
QUESTION
Does anyone have a suggestion on how to de-bounce the screen orientation change, so the orientation is only changed after the user had definitely changed the phone position?
I have an Android App that I'm finishing and want to improve the user experience when they change the orientation of the device. Here is how I have it set up to adjust the stack when the screen orientation changes.
Code: Select all
on preOpenStack
get initializeStackLibraries()
set the fullScreenMode of this stack to "letterbox"
end preOpenStack
on orientationChanged
if environment() is not "mobile" then exit orientationChanged
put mobileDeviceOrientation() into tOrientation
if tOrientation = "portrait" then
set the width of this stack to 480
set the height of this stack to 800
else if tOrientation = "landscape left" OR tOrientation = "landscape right" then
set the width of this stack to 800
set the height of this stack to 480
else if tOrientation = "portrait upside down" then
else if tOrientation = "face up" or tOrientation = "face down" then
else
answer info "Orientation = " & tOrientation
end if
end orientationChanged
As far as I can tell the device is telling the program to change orientation pre-maturely and it really as not changed the orientation yet, so the OrientationChanged code is working properly, but not getting the correct effect.
QUESTION
Does anyone have a suggestion on how to de-bounce the screen orientation change, so the orientation is only changed after the user had definitely changed the phone position?