# SizeFCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/util/SizeFCompat.java+class:androidx.core.util.SizeFCompat) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

*** ** * ** ***


```
class SizeFCompat
```

<br />

*** ** * ** ***

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 `https://developer.android.com/reference/android/util/SizeF.html`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat#SizeFCompat(float,float)(width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat#getHeight()()` Get the height of the size (as an arbitrary unit). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat#getWidth()()` Get the width of the size (as an arbitrary unit). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat#hashCode()()` |
| `https://developer.android.com/reference/android/util/SizeF.html` | `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat#toSizeF()()` Converts this `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat` into a `https://developer.android.com/reference/android/util/SizeF.html`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat` | `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat#toSizeFCompat(android.util.SizeF)(size: https://developer.android.com/reference/android/util/SizeF.html)` Converts this `https://developer.android.com/reference/android/util/SizeF.html` into a `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat#toString()()` |

| ### Extension functions |
|---|---|
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat.https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat#(androidx.core.util.SizeFCompat).component1()()` Returns "width", the first component of this `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat`. |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat.https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat#(androidx.core.util.SizeFCompat).component2()()` Returns "height", the second component of this `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat`. |

## Public constructors

### SizeFCompat

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

```
SizeFCompat(width: Float, height: Float)
```

## Public functions

### equals

```
fun equals(o: Any!): Boolean
```

### getHeight

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

```
fun getHeight(): Float
```

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | height |

### getWidth

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

```
fun getWidth(): Float
```

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | width |

### hashCode

```
fun hashCode(): Int
```

### toSizeF

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

```
fun toSizeF(): SizeF
```

Converts this `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat` into a `https://developer.android.com/reference/android/util/SizeF.html`.

### toSizeFCompat

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/core#1.8.0)

```
java-static fun toSizeFCompat(size: SizeF): SizeFCompat
```

Converts this `https://developer.android.com/reference/android/util/SizeF.html` into a `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat`.

### toString

```
fun toString(): String
```

## Extension functions

### SizeFCompat.component1

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/util/Size.kt+function:component1)

```
inline operator fun SizeFCompat.component1(): Float
```

Returns "width", the first component of this `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat`.

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

```kotlin
val (w, h) = mySize
```

### SizeFCompat.component2

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/util/Size.kt+function:component2)

```
inline operator fun SizeFCompat.component2(): Float
```

Returns "height", the second component of this `https://developer.android.com/reference/kotlin/androidx/core/util/SizeFCompat`.

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

```kotlin
val (w, h) = mySize
```