isNaturalPortrait

fun isNaturalPortrait(context: Context, rotationDegrees: Int): Boolean

Determines whether the current device is a natural portrait-oriented device

Using the current app's window to determine whether the device is a natural portrait-oriented device doesn't work in all scenarios, one example of this is multi-window mode. Taking a natural portrait-oriented device in multi-window mode, rotating it 90 degrees (so that it's in landscape), with the app open, and its window's width being smaller than its height. Using the app's width and height would determine that the device isn't naturally portrait-oriented, where in fact it is, which is why it is important to use the size of the device instead.

Return

Whether the device is naturally portrait-oriented.

Parameters

context

Current context. Can be an android.app.Application context or an android.app.Activity context.

rotationDegrees

The device's rotation in degrees from its natural orientation.