DisplayCompat.ModeCompat

Added in 1.3.0

class DisplayCompat.ModeCompat


Compat class which provides access to the underlying display mode, if there is one, and a more reliable display mode size.

Summary

Public functions

Int

Returns the physical height of the given display when configured in this mode.

Int

Returns the physical width of the given display when configured in this mode.

Boolean

This function is deprecated.

Use getMode to retrieve the resolution of the current display mode.

Display.Mode?
@RequiresApi(value = Build.VERSION_CODES.M)
toMode()

Returns the wrapped object Display.Mode, which may be null if no mode is available.

Public functions

getPhysicalHeight

Added in 1.3.0
fun getPhysicalHeight(): Int

Returns the physical height of the given display when configured in this mode.

getPhysicalWidth

Added in 1.3.0
fun getPhysicalWidth(): Int

Returns the physical width of the given display when configured in this mode.

isNative

Added in 1.3.0
Deprecated in 1.6.0
fun isNative(): Boolean

This field indicates whether a mode has the same resolution as the current display mode.

This field does *not* indicate the native resolution of the display.

Returns
Boolean

true if this mode is the same resolution as the current display mode.

toMode

Added in 1.3.0
@RequiresApi(value = Build.VERSION_CODES.M)
fun toMode(): Display.Mode?

Returns the wrapped object Display.Mode, which may be null if no mode is available.