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 |
|
|---|---|
boolean |
|
float |
Get the height of the size (as an arbitrary unit). |
float |
getWidth()Get the width of the size (as an arbitrary unit). |
int |
hashCode() |
@NonNull SizeF |
@RequiresApi(value = 21)Converts this |
static @NonNull SizeFCompat |
@RequiresApi(value = 21)Converts this |
@NonNull String |
toString() |
Extension functions |
|
|---|---|
final float |
SizeKt.component1(@NonNull SizeFCompat receiver)Returns "width", the first component of this |
final float |
SizeKt.component2(@NonNull SizeFCompat receiver)Returns "height", the second component of this |
Public constructors
Public methods
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 |
toSizeF
@RequiresApi(value = 21)
public @NonNull SizeF toSizeF()
Converts this SizeFCompat into a SizeF.
toSizeFCompat
@RequiresApi(value = 21)
public static @NonNull SizeFCompat toSizeFCompat(@NonNull SizeF size)
Converts this SizeF into a SizeFCompat.
Extension functions
SizeKt.component1
public final float SizeKt.component1(@NonNull SizeFCompat receiver)
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
SizeKt.component2
public final float SizeKt.component2(@NonNull SizeFCompat receiver)
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