0

Imagine my app displays a house drawn in portrait mode:

|------|
|******|
|  _   |
| / \  |
| | |  |
| | |  |
|______|
|......|
--------

The stars above represent some menu of mine. The dots below represent android's software back, apps and home buttons line. What I'd like to have after rotation is:

_______________
|         *   |
| ---\    *   |
| ---/    *   |      
|         *   |
|............ |
---------------

and not

_______________
|  *******    |
|    -        |
|   / \       |
|   | |       |      
|   | |       |
|............ |
---------------

which kind of happens automatically.

So basically, I want my app to acknowledge the device rotation (and not block landscape or portrait mode), so the system's buttons may go to their respective positions, but I do not want my application's views to be rotated or rescaled or to have any animations on them.

How can I achieve that? Declaring my app to handle config changes prevents the activity from being restarted, however if I do nothing at onConfigurationChange the views get rescaled and redrawn anyway without me writing any code for it.

All in all, I like to know about configuration change, but prevent any (system) changes in my application visualization (I'd like to have set a custom animation myself).

George
  • 3,727
  • 9
  • 31
  • 47

1 Answers1

0

set in menifest:

  android:configChanges="orientation|screenSize"
Shivang Trivedi
  • 2,182
  • 1
  • 20
  • 26