In Split-Screen, Your Orientation Flips

Many of you have no doubt discovered this already, but for those who have not: whether you get portrait or landscape resources is dependent upon the aspect ratio of the window, not the device, on Android 7.0. So, if the device is in portrait, and your activity is being shown in normal mode, you will have portrait resources. But, if the user then moves the device into split-screen mode, putting your activity into one pane, you will undergo a configuration change, and now use landscape resources, even though the device itself did not rotate. The same holds true for the inverse case (device in landscape, with entry into split-screen switching your activity from landscape to portrait resources).

This is not terribly shocking, though it was not something that I had considered when Android 7.0’s multi-window was announced. I only infrequently use -land resources (and never -port), preferring instead to tie orientation and screen size together (e.g., -w640dp). So, I was focusing on the smaller window size, not so much its orientation.

However, this is another example of where we need to take care to ensure that the switch from normal to split-screen mode (or back again) is a smooth one. Having a radically different UI in one orientation versus the other means that the user will see a radically different UI when she switches between normal and split-screen mode, which may not be a good idea. Worse, if and when the mythical freeform multi-window mode becomes available, the user may see a radical UI change just by a small window resize operation, one that happens to move the window between portrait and landscape aspect ratios.