🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

WindowSizeClass

Window size classes are a set of opinionated viewport breakpoints to design, develop, and test responsive application layouts against.

Source set: Common
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

Source set: Common
override fun equals(other: Any?): Boolean

hashCode

Source set: Common
override fun hashCode(): Int

toString

Source set: Common
override fun toString(): String

Members

Companion

Source set: Common
public companion object

Functions

calculateFromSize

Source set: Common
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

Content updated: