HeightSizeClass.Companion


object HeightSizeClass.Companion


Summary

Public functions

HeightSizeClass
compute(dpHeight: Int)

Returns a recommended HeightSizeClass for the height of a window given the height in DP.

HeightSizeClass.Companion.HeightSizeClassEnum

Returns a HeightSizeClassEnum given the HeightSizeClass.

Int

Returns a recommended height of a window in DP given the HeightSizeClass.

Public properties

HeightSizeClass

A bucket to represent a compact height.

HeightSizeClass

A bucket to represent an expanded height window.

HeightSizeClass

A bucket to represent a medium height.

Public functions

compute

fun compute(dpHeight: Int): HeightSizeClass

Returns a recommended HeightSizeClass for the height of a window given the height in DP.

Parameters
dpHeight: Int

the height of the window in DP

Returns
HeightSizeClass

A recommended size class for the height

Throws
kotlin.IllegalArgumentException

if the height is negative

getEnum

fun getEnum(sizeClass: HeightSizeClass): HeightSizeClass.Companion.HeightSizeClassEnum

Returns a HeightSizeClassEnum given the HeightSizeClass.

Parameters
sizeClass: HeightSizeClass

the size class

Returns
HeightSizeClass.Companion.HeightSizeClassEnum

the relevant HeightSizeClassEnum

getHeightDpInSizeClass

fun getHeightDpInSizeClass(sizeClass: HeightSizeClass): Int

Returns a recommended height of a window in DP given the HeightSizeClass.

Parameters
sizeClass: HeightSizeClass

the size class

Returns
Int

A recommended height in DP in this size class

Public properties

COMPACT

val COMPACTHeightSizeClass

A bucket to represent a compact height. One use-case is a phone that is in landscape.

EXPANDED

val EXPANDEDHeightSizeClass

A bucket to represent an expanded height window. One use-case is a tablet or a desktop app.

MEDIUM

val MEDIUMHeightSizeClass

A bucket to represent a medium height. One use-case is a phone in portrait or a tablet.