# DimensionBuilders.ProportionalDimensionProp

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

*** ** * ** ***


```
class DimensionBuilders.ProportionalDimensionProp : DimensionBuilders.ImageDimension
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> Deprecated in Java

A type for a dimension that scales itself proportionally to another dimension such that the aspect ratio defined by the given width and height values is preserved.

Note that the width and height are unitless; only their ratio is relevant. This allows for specifying an element's size using common ratios (e.g. width=4, height=3), or to allow an element to be resized proportionally based on the size of an underlying asset (e.g. an 800x600 image being added to a smaller container and resized accordingly).

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.ProportionalDimensionProp.Builder : https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.ImageDimension.Builder` **This class is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[getAspectRatioHeight](https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.ProportionalDimensionProp#getAspectRatioHeight())()` **This function is deprecated.** Deprecated in Java |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `[getAspectRatioWidth](https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.ProportionalDimensionProp#getAspectRatioWidth())()` **This function is deprecated.** Deprecated in Java |

## Public functions

### getAspectRatioHeight

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

```
fun [getAspectRatioHeight](https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.ProportionalDimensionProp#getAspectRatioHeight())(): @IntRange(from = 0) Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Gets the height to be used when calculating the aspect ratio ratio to preserve. Intended for testing purposes only.

### getAspectRatioWidth

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

```
fun [getAspectRatioWidth](https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.ProportionalDimensionProp#getAspectRatioWidth())(): @IntRange(from = 0) Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Gets the width to be used when calculating the aspect ratio to preserve. Intended for testing purposes only.