SizeFCompat

public final 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(float width, float height)

Public methods

@Override boolean
float

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

float

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

@Override int
@RequiresApi(value = 21) @NonNull SizeF

Converts this SizeFCompat into a SizeF.

static @RequiresApi(value = 21) @NonNull SizeFCompat

Converts this SizeF into a SizeFCompat.

@NonNull @Override String

Extension functions

final float

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

final float

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

Public constructors

SizeFCompat

public SizeFCompat(float width, float height)

Public methods

equals

@Override
public boolean equals(Object o)

getHeight

public float getHeight()

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

Returns
float

height

getWidth

public float getWidth()

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

Returns
float

width

hashCode

@Override
public int hashCode()

toSizeF

@RequiresApi(value = 21)
public @NonNull