Rotate dialog on the screen.

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Rotate dialog on the screen.

Postby DeveloperAmit » Thu Mar 05, 2009 3:53 pm

Hello all,

Can anyone tell me how to rotate a dialog on the screen without rotating the rest of the screen.
Actually my application is entirely for portrait mode but want to accept a username at somepoint in the app.
So need to rotate the EditView in the dialog for entering name from keyboard.
DeveloperAmit
Junior Developer
Junior Developer
 
Posts: 20
Joined: Wed Mar 04, 2009 1:26 pm

Top

Postby MrSnowflake » Thu Mar 05, 2009 5:57 pm

Uhm, what? When the user wants to input something, the screen automatically rotates, because he opens the keyboard, so your question is solved... :s
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby DeveloperAmit » Mon Mar 09, 2009 6:53 am

MrSnowflake wrote:Uhm, what? When the user wants to input something, the screen automatically rotates, because he opens the keyboard, so your question is solved... :s


What i mean to say is that: my app is restricted to portrait mode i.e. i have set the property to "portrait" for my activity in manifest file as:
android:screenOrientation="portrait"

Thus the screen doesn't rotate even if the keyboard is hidden or shown.
Then how can i make the dialog appear in landscape mode without rotating rest of the app.??
DeveloperAmit
Junior Developer
Junior Developer
 
Posts: 20
Joined: Wed Mar 04, 2009 1:26 pm

Postby MrSnowflake » Mon Mar 09, 2009 1:27 pm

Ow, now I get it, you only want to rotate the dialog, so the Activity remains in portrait, but the dialog rotates, so the user can see the dialog as het should be.

Well, you can't :). A work around is making a Transparent/translucent activity, which shows the input dialog, and which IS able to fully rotate. So your static Activity will startForResult() this DialogActivity, the user enters it's data and the DialogActivity closes, returning the data to the static Activity. That's why it should be Transparent (so the user see the static activity behind it), or translucent (might be better, as the user still see the original Activity, but as it's a bit blurred the user knows this is a special circumstance).

Oh btw: * This is not a code snippet, Moved *
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby DeveloperAmit » Mon Mar 09, 2009 3:00 pm

Thanks
I finally ended up with using another activity with the dialog & its working fine.
DeveloperAmit
Junior Developer
Junior Developer
 
Posts: 20
Joined: Wed Mar 04, 2009 1:26 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 16 guests