{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

WindowHeightSizeClass.Companion

public static class WindowHeightSizeClass.Companion


Summary

Public methods

static final @NonNull Set<@NonNull WindowHeightSizeClass>

The set of all size classes.

static final @NonNull WindowHeightSizeClass

Represents the majority of phones in landscape

static final @NonNull Set<@NonNull WindowHeightSizeClass>

The default set of size classes that includes Compact, Medium, and Expanded size classes.

static final @NonNull WindowHeightSizeClass

Represents the majority of tablets in portrait

static final @NonNull WindowHeightSizeClass

Represents the majority of tablets in landscape and majority of phones in portrait

Public methods

getAllSizeClasses

public static final @NonNull Set<@NonNull WindowHeightSizeClassgetAllSizeClasses()

The set of all size classes. It's supposed to be expanded whenever a new size class is defined. By default WindowSizeClass.calculateFromSize will only return size classes in DefaultSizeClasses in order to avoid behavioral changes when new size classes are added. You can opt in to support all available size classes by doing:

WindowSizeClass.calculateFromSize(
size = size,
density = density,
supportedWidthSizeClasses = WindowWidthSizeClass.AllSizeClasses,
supportedHeightSizeClasses = WindowHeightSizeClass.AllSizeClasses
)

getCompact

public static final @NonNull WindowHeightSizeClass getCompact()

Represents the majority of phones in landscape

getDefaultSizeClasses

public static final @NonNull Set<@NonNull WindowHeightSizeClassgetDefaultSizeClasses()

The default set of size classes that includes Compact, Medium, and Expanded size classes. Should never expand to ensure behavioral consistency.

getExpanded

public static final @NonNull WindowHeightSizeClass getExpanded()

Represents the majority of tablets in portrait

getMedium

public static final @NonNull WindowHeightSizeClass getMedium()

Represents the majority of tablets in landscape and majority of phones in portrait