class HeightSizeClass


A class to create buckets for the height of a window.

For details on window size classes, see https://developer.android.com/guide/topics/large-screens/support-different-screen-sizes.

Summary

Public companion 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 companion 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

open operator Boolean
equals(other: Any?)
open Int
open String

Public companion 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 companion 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.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String