SizeFCompat

Added in 1.8.0

class SizeFCompat


Immutable class for describing width and height dimensions in some arbitrary unit. Width and height are finite values stored as a floating point representation.

This is a backward-compatible version of SizeF.

Summary

Public constructors

SizeFCompat(width: Float, height: Float)

Public functions

Boolean
equals(o: Any!)
Float

Get the height of the size (as an arbitrary unit).

Float

Get the width of the size (as an arbitrary unit).

Int
SizeF
@RequiresApi(value = 21)
toSizeF()

Converts this SizeFCompat into a SizeF.

java-static SizeFCompat
@RequiresApi(value = 21)
toSizeFCompat(size: SizeF)

Converts this SizeF into a SizeFCompat.

String

Extension functions

inline operator Float

Returns "width", the first component of this SizeFCompat.

inline operator Float

Returns "height", the second component of this SizeFCompat.

Public constructors

SizeFCompat

Added in 1.8.0
SizeFCompat(width: Float, height: Float)

Public functions

equals

fun equals(o: Any!): Boolean

getHeight

Added in 1.8.0
fun getHeight(): Float

Get the height of the size (as an arbitrary unit).

Returns
Float

height

getWidth

Added in 1.8.0
fun getWidth(): Float

Get the width of the size (as an arbitrary unit).

Returns
Float

width

hashCode

fun hashCode(): Int

toSizeF

Added in 1.8.0
@RequiresApi(value = 21)
fun toSizeF(): SizeF

Converts this SizeFCompat into a SizeF.

toSizeFCompat

Added in 1.8.0
@RequiresApi(value = 21)
java-static fun toSizeFCompat(size: SizeF): SizeFCompat

Converts this SizeF into a SizeFCompat.

toString

fun toString(): String

Extension functions

component1

inline operator fun SizeFCompat.component1(): Float

Returns "width", the first component of this SizeFCompat.

This method allows to use destructuring declarations when working with sizes, for example:

val (w, h) = mySize

component2

inline operator fun SizeFCompat.component2(): Float

Returns "height", the second component of this SizeFCompat.

This method allows to use destructuring declarations when working with sizes, for example:

val (w, h) = mySize