# DisplayCompat.ModeCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/view/DisplayCompat.java+class:androidx.core.view.DisplayCompat.ModeCompat) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#1.3.0)

*** ** * ** ***


```
public final class DisplayCompat.ModeCompat
```

<br />

*** ** * ** ***

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` | `https://developer.android.com/reference/androidx/core/view/DisplayCompat.ModeCompat#getPhysicalHeight()()` Returns the physical height of the given display when configured in this mode. |
| `int` | `https://developer.android.com/reference/androidx/core/view/DisplayCompat.ModeCompat#getPhysicalWidth()()` Returns the physical width of the given display when configured in this mode. |
| `boolean` | `[isNative](https://developer.android.com/reference/androidx/core/view/DisplayCompat.ModeCompat#isNative())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/DisplayCompat#getMode(android.content.Context,android.view.Display)` to retrieve the resolution of the current display mode. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/Display.Mode.html` | `https://developer.android.com/reference/androidx/core/view/DisplayCompat.ModeCompat#toMode()()` Returns the wrapped object Display.Mode, which may be null if no mode is available. |

## Public methods

### getPhysicalHeight

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#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](https://developer.android.com/jetpack/androidx/releases/core#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](https://developer.android.com/jetpack/androidx/releases/core#1.3.0) Deprecated in [1.6.0](https://developer.android.com/jetpack/androidx/releases/core#1.6.0)

```
public boolean [isNative](https://developer.android.com/reference/androidx/core/view/DisplayCompat.ModeCompat#isNative())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/core/view/DisplayCompat#getMode(android.content.Context,android.view.Display)` to retrieve the resolution of the current display mode.

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](https://developer.android.com/jetpack/androidx/releases/core#1.3.0)

```
public @Nullable Display.Mode toMode()
```

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