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