DisplayCompat.ModeCompat
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 |
Display.Mode? |
@RequiresApi(value = Build.VERSION_CODES.M)Returns the wrapped object Display.Mode, which may be null if no mode is available. |
Public functions
getPhysicalHeight
fun getPhysicalHeight(): Int
Returns the physical height of the given display when configured in this mode.
getPhysicalWidth
fun getPhysicalWidth(): Int
Returns the physical width of the given display when configured in this mode.
funisNative(): 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
@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.