DisplayCompat.ModeCompat

Added in 1.3.0

public final 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 methods

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 method is deprecated.

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

@Nullable 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 methods

getPhysicalHeight

Added in 1.3.0
public int getPhysicalHeight()

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

getPhysicalWidth

Added in 1.3.0
public int getPhysicalWidth()

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

isNative

Added in 1.3.0
Deprecated in 1.6.0
public boolean isNative()

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)
public @Nullable Display.Mode toMode()

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