# 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)

*** ** * ** ***


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

<br />

*** ** * ** ***

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

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/protolayout/DimensionBuilders.BoundingBoxRatio.Builder` Builder for `https://developer.android.com/reference/androidx/wear/protolayout/DimensionBuilders.BoundingBoxRatio`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/TypeBuilders.FloatProp` | `https://developer.android.com/reference/androidx/wear/protolayout/DimensionBuilders.BoundingBoxRatio#getRatio()()` Gets the ratio proportional to the bounding box width/height. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/protolayout/DimensionBuilders.BoundingBoxRatio#toString()()` |

## Public methods

### getRatio

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

```
public @NonNull TypeBuilders.FloatProp getRatio()
```

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

```
public @NonNull String toString()
```