Reverse landscape orientation in Froyo

345 views
Skip to first unread message

Soumya

unread,
Mar 3, 2011, 12:42:19 AM3/3/11
to android-porting
Hi,

Generally if you launch an application in Android Froyo, then your
application can switch to 0, 90 and 270 orientation when you rotate
the device. Now I am making an application which when launched in the
last mode of orientation should remain in that orientation. For
example, if user launches my application in portrait mode then it
should remain in portrait mode even if the device is rotated.

For this I am using the setRequstedOrientation call, but when I am
launching the application in landscape(270) mode, it automatically
gets switched to landscape (90) mode. After some search I came to know
that landscape (270) is not supported by setRequestedOrientation call
in Android.

Can anyone tell me what can be done and whether there is any
workaround to obtain such requirement.

Thank you,
Soumya

Dianne Hackborn

unread,
Mar 3, 2011, 2:12:32 AM3/3/11
to soumyak...@gmail.com, android-porting
APIs for this were introduced in Gingerbread; there is no support for it in Froyo.




--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Chinmay S

unread,
Mar 3, 2011, 2:27:49 AM3/3/11
to soumyak...@gmail.com, android-porting
Hi,

Looks like the API was added in GB ( no support in FroYo :( )

Will putting ur app in 90 mode & flipping the graphics in you app work?

You might want to have a look at this.
http://groups.google.com/group/android-developers/browse_thread/thread/3ae9364ee6674c8f

regards
CVS

Soumya

unread,
Mar 3, 2011, 5:24:22 AM3/3/11
to android-porting

Thank you for the response.

By default the window gets rotated to 0, 90 and 270 in Froyo. Does
that mean that the setRequestedOrientation call to freeze the screen
from rotating in reverse landscape mode or right-landscape or 270
degree is not supported in Froyo.
> hack...@android.com

Soumya

unread,
Mar 3, 2011, 5:25:53 AM3/3/11
to android-porting

I think it will be ok, only if the touch also works along with the
flipped graphics. Can you please let me know how to flip the graphics?
I checked the link you mentioned but could not find the process in
which the objective could be achieved.

Thank you.

On Mar 3, 4:27 pm, Chinmay S <cvs...@gmail.com> wrote:
> Hi,
>
> Looks like the API was added in GB ( no support in FroYo :( )
>
> Will putting ur app in 90 mode & flipping the graphics in you app work?
>
> You might want to have a look at this.http://groups.google.com/group/android-developers/browse_thread/threa...
>
> regards
> CVS

Chinmay S

unread,
Mar 3, 2011, 11:31:11 AM3/3/11
to soumyak...@gmail.com, android-porting
Hi,

The link just contains confirmation that landscape(270) is NOT supported on Froyo.
http://groups.google.com/group/android-developers/browse_thread/thread/3ae9364ee6674c8f


By flipping the graphics, i meant the drawables or any rendering you have onscreen
can be designed in a flipped manner. So that even though the app is in landscape(90) mode
the elements appear proepr when held in landscape(270).

If the app has elements like "textbox", "Lists" etc. then
probably flipping will not be suitable in your case.

GoodLUCK!

Regards
CVS

Soumya

unread,
Mar 3, 2011, 11:20:39 PM3/3/11
to android-porting

Hi,

Is there any patch available using which we can support the reverse
landscape orientation is Froyo for framework. If so can someone point
out the link in GIT maybe.

Thank you,
Soumya

Dianne Hackborn

unread,
Mar 4, 2011, 12:35:06 AM3/4/11
to soumyak...@gmail.com, android-porting
The patch is Gingerbread.  Available, at your friendly neighborhood Android git repository. :)




--
Dianne Hackborn
Android framework engineer
hac...@android.com

twiggle

unread,
Oct 22, 2011, 3:01:49 PM10/22/11
to Soumya, android...@googlegroups.com
Soumya,
Did you ever figure out how to do the rotation? I tried both a
rotation andimation and flipping the canvas of the layout, but neither
worked as my views all included ui widgets with things like selectors
which were not displayed in the new orientation.
S
Reply all
Reply to author
Forward
0 new messages