Reputation: 109
I'm working on an app where two players will play on the same phone in front of each other and I rotate many things 180 degrees each turn. (few things should not rotate)
The players might use the keyboard to type some text when needed, so I need to also rotate the keyboard 180 degrees and put it in the upper side of the screen if it's the other player's turn.
How can I do that programmatically to the keyboard only?
I should also do the same when I start developing the iOS app!
Upvotes: 1
Views: 1378
Reputation: 76
Try:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
for rotating the screen by 180 degrees and when you want to switch back to the original view use setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
Upvotes: 2