# DimensionBuilders.BoundingBoxRatio

# DimensionBuilders.BoundingBoxRatio

Artifact:[androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/DimensionBuilders.java+class:androidx.wear.protolayout.DimensionBuilders.BoundingBoxRatio)  
Added in[1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.2.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/protolayout/DimensionBuilders.BoundingBoxRatio "View this page in Java")

<br />

```
@RequiresSchemaVersion(major = 1, minor = 400)
class DimensionBuilders.BoundingBoxRatio : DimensionBuilders.PivotDimension, DimensionBuilders.OffsetDimension
```

<br />

*** ** * ** ***

Provide a position representation proportional to the bounding box width/height.

## Summary

|                                                                                                                                                   ### Nested types                                                                                                                                                    |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[DimensionBuilders.BoundingBoxRatio.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.BoundingBoxRatio.Builder) Builder for[BoundingBoxRatio](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.BoundingBoxRatio). |

|                                                   ### Public functions                                                    |
|---------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TypeBuilders.FloatProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp) | [getRatio](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.BoundingBoxRatio#getRatio())`()` Gets the ratio proportional to the bounding box width/height. |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                         | [toString](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.BoundingBoxRatio#toString())`()`                                                               |

## Public functions

### getRatio

Added in[1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.2.0)  

```
fun getRatio(): TypeBuilders.FloatProp
```

Gets the ratio proportional to the bounding box width/height. Value 0 represents the location at the top / start of the bounding box, value 1 represents the location at the bottom / end of the bounding box, and value 0.5 represents the middle of the bounding box. Values outside \[0, 1\] are also valid. Dynamic value is supported.  

### toString

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