WidthSizeClass.Companion


public static class WidthSizeClass.Companion


Summary

Nested types

Public methods

static final @NonNull WidthSizeClass
compute(int dpWidth)

Returns a recommended WidthSizeClass for the width of a window given the width in DP.

static final @NonNull WidthSizeClass.Companion.WidthSizeClassEnum

Returns a WidthSizeClassEnum given the WidthSizeClass.

static final int

Returns a recommended width of a window in DP given the WidthSizeClass.

Public methods

compute

public static final @NonNull WidthSizeClass compute(int dpWidth)

Returns a recommended WidthSizeClass for the width of a window given the width in DP.

Parameters
int dpWidth

the width of the window in DP

Returns
@NonNull WidthSizeClass

A recommended size class for the width

Throws
kotlin.IllegalArgumentException

if the width is negative

getEnum

public static final @NonNull WidthSizeClass.Companion.WidthSizeClassEnum getEnum(@NonNull WidthSizeClass sizeClass)

Returns a WidthSizeClassEnum given the WidthSizeClass.

Parameters
@NonNull WidthSizeClass sizeClass

the size class

Returns
@NonNull WidthSizeClass.Companion.WidthSizeClassEnum

the relevant WidthSizeClassEnum

getWidthDpInSizeClass

public static final int getWidthDpInSizeClass(@NonNull WidthSizeClass sizeClass)

Returns a recommended width of a window in DP given the WidthSizeClass.

Parameters
@NonNull WidthSizeClass sizeClass

the size class

Returns
int

A recommended width in DP in this size class