DisplayCompat

Added in 1.3.0

class DisplayCompat


A class for retrieving accurate display modes for a display.

On many Android TV devices, Display.Mode may not report the accurate width and height because these devices do not have powerful enough graphics pipelines to run framework code at the same resolutions supported by their video pipelines. For these devices, there is no way for an app to determine, for example, whether or not the current display mode is 4k, or that the display supports switching to other 4k modes. This class offers a workaround for this problem.

Summary

Nested types

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

Public functions

java-static DisplayCompat.ModeCompat
getMode(context: Context, display: Display)

Gets the current display mode of the given display, where the size can be relied on to determine support for 4k on Android TV devices.

java-static Array<DisplayCompat.ModeCompat!>
getSupportedModes(context: Context, display: Display)

Gets the supported modes of the given display where any mode with the same size as the current mode can be relied on to determine support for 4k on Android TV devices.

Public functions

getMode

Added in 1.6.0
java-static fun getMode(context: Context, display: Display): DisplayCompat.ModeCompat

Gets the current display mode of the given display, where the size can be relied on to determine support for 4k on Android TV devices.

getSupportedModes

Added in 1.3.0
java-static fun getSupportedModes(context: Context, display: Display): Array<DisplayCompat.ModeCompat!>

Gets the supported modes of the given display where any mode with the same size as the current mode can be relied on to determine support for 4k on Android TV devices.