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

WindowWidthSizeClass.Companion

public static class WindowWidthSizeClass.Companion


Summary

Public methods

static final @NonNull Set<@NonNull WindowWidthSizeClass>

The set of all size classes.

static final @NonNull WindowWidthSizeClass

Represents the majority of phones in portrait.

static final @NonNull Set<@NonNull WindowWidthSizeClass>

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

static final @NonNull WindowWidthSizeClass

Represents the majority of tablets in landscape and large unfolded inner displays in landscape.

static final @NonNull WindowWidthSizeClass

Represents the majority of tablets in portrait and large unfolded inner displays in portrait.

Public methods

getAllSizeClasses

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

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 WindowWidthSizeClass getCompact()

Represents the majority of phones in portrait.

getDefaultSizeClasses

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

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 WindowWidthSizeClass getExpanded()

Represents the majority of tablets in landscape and large unfolded inner displays in landscape.

getMedium

public static final @NonNull WindowWidthSizeClass getMedium()

Represents the majority of tablets in portrait and large unfolded inner displays in portrait.