changing layout basd on acceoramator

Put your problem here if it does not fit any of the other categories.

changing layout basd on acceoramator

Postby euromaster » Tue Oct 14, 2008 11:25 pm

what i would like is my app to have an i phone effect so that when the phone is tilted so that it is horizontal the apps layout changes to a horizontal layout . iwas wondering how this would be possible
euromaster
Junior Developer
Junior Developer
 
Posts: 14
Joined: Mon Jun 16, 2008 10:37 pm

Top

Postby Bratag » Wed Oct 22, 2008 5:00 am

The code to do the change is simple - and I can provide it if needed. However to change the screen layout when the app is in the background as a service is not. The only way I could think to do it was to use the Surface.setOrientation method. This is however a protected method and using the FLINGER perms in the manifest results in it not granting those perms.

So Currently I dont think there is a way for you to do it. You can of course include the code in any app you are writing and simply call Activity.setRequestedOrientation to flip the screen of that app
Bratag
Freshman
Freshman
 
Posts: 5
Joined: Sat Oct 18, 2008 4:28 am

Postby MrSnowflake » Wed Oct 22, 2008 10:47 am

In the Manifest you can set the screen orientation to follow the gravity sensors. But that will only work for your own task. But I believe the G1 has a setting which allows you to select this behaviour to be system wide. The default setting of the G1 is switching when the keyboard opens, but this should be changable.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby Bratag » Wed Oct 22, 2008 1:57 pm

MrSnowflake wrote:In the Manifest you can set the screen orientation to follow the gravity sensors. But that will only work for your own task. But I believe the G1 has a setting which allows you to select this behaviour to be system wide. The default setting of the G1 is switching when the keyboard opens, but this should be changable.


If that is the case I would love to know how. I could only find out how to do it for the single task I was running.
Bratag
Freshman
Freshman
 
Posts: 5
Joined: Sat Oct 18, 2008 4:28 am

Postby MrSnowflake » Wed Oct 22, 2008 2:41 pm

I asked some guys who have a G1 and they say it's not possible to change this setting after all.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby Bratag » Wed Oct 22, 2008 2:44 pm

Ok thats what I thought. I had driven myself crazy looking through the API for a way to do it. Lets hope they rectify this soon.
Bratag
Freshman
Freshman
 
Posts: 5
Joined: Sat Oct 18, 2008 4:28 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 12 guests