Google is committed to advancing racial equity for Black communities. See how.

DisplayCompat

class DisplayCompat
kotlin.Any
   ↳ androidx.core.view.DisplayCompat

A class for retrieving the physical display size from a device. This is necessary because Display.Mode.getPhysicalDisplaySize might not report the real physical display size because most ATV devices don't report all available modes correctly. In this case there is no way to find out whether a device is capable to display 4k content. This class offers a workaround for this problem.

Summary

Nested classes

Compat class which provides an additional isNative() field.

Public methods
static Array<DisplayCompat.ModeCompat!>
getSupportedModes(@NonNull context: Context, @NonNull display: Display)

Gets the supported modes of the given display where at least one of the modes is flagged as isNative().

Public methods

getSupportedModes

@NonNull static fun getSupportedModes(
    @NonNull context: Context,
    @NonNull display: Display
): Array<DisplayCompat.ModeCompat!>

Gets the supported modes of the given display where at least one of the modes is flagged as isNative(). Note that a native mode might not wrap any Display.Mode object in case the display returns no mode with the physical display size.

Return
Array<DisplayCompat.ModeCompat!> an array of supported modes where at least one of the modes is native which contains the physical display size