public class WindowSizeClass private constructor(
public val widthSizeClass: WindowWidthSizeClass,
public val heightSizeClass: WindowHeightSizeClass,
)
Window size classes are a set of opinionated viewport breakpoints to design, develop, and test responsive application layouts against. For more details check Support different screen sizes documentation.
WindowSizeClass contains a WindowWidthSizeClass and WindowHeightSizeClass, representing the window size classes for this window's width and height respectively.
See calculateWindowSizeClass to calculate the WindowSizeClass for an Activity's current window
Functions
equals
override fun equals(other: Any?): Boolean
hashCode
override fun hashCode(): Int
toString
override fun toString(): String
Members
Companion
public companion object
Functions
calculateFromSize
public fun calculateFromSize(
size: DpSize,
supportedWidthSizeClasses: Set<WindowWidthSizeClass> =
WindowWidthSizeClass.DefaultSizeClasses,
supportedHeightSizeClasses: Set<WindowHeightSizeClass> =
WindowHeightSizeClass.DefaultSizeClasses,
): WindowSizeClass
Calculates the best matched WindowSizeClass for a given size according to the provided supportedWidthSizeClasses and supportedHeightSizeClasses.
Parameters
| size | of the window |
| supportedWidthSizeClasses | the set of width size classes that are supported |
| supportedHeightSizeClasses | the set of height size classes that are supported |
Return
WindowSizeClass corresponding to the given width and height