# PercentLayoutHelper.PercentLayoutInfo

Artifact: [androidx.percentlayout:percentlayout](https://developer.android.com/jetpack/androidx/releases/percentlayout) [View Source](https://cs.android.com/search?q=file:androidx/percentlayout/widget/PercentLayoutHelper.java+class:androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutInfo) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

*** ** * ** ***


```
public class PercentLayoutHelper.PercentLayoutInfo
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> use ConstraintLayout and Guidelines for layout support.

Container for information about percentage dimensions and margins. It acts as an extension for `LayoutParams`.

## Summary

| ### Public fields |
|---|---|
| `float` | `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#aspectRatio()` **This field is deprecated.** Deprecated in Java |
| `float` | `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#bottomMarginPercent()` **This field is deprecated.** Deprecated in Java |
| `float` | `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#endMarginPercent()` **This field is deprecated.** Deprecated in Java |
| `float` | `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#heightPercent()` **This field is deprecated.** Deprecated in Java |
| `float` | `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#leftMarginPercent()` **This field is deprecated.** Deprecated in Java |
| `float` | `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#rightMarginPercent()` **This field is deprecated.** Deprecated in Java |
| `float` | `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#startMarginPercent()` **This field is deprecated.** Deprecated in Java |
| `float` | `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#topMarginPercent()` **This field is deprecated.** Deprecated in Java |
| `float` | `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#widthPercent()` **This field is deprecated.** Deprecated in Java |

| ### Public constructors |
|---|
| `[PercentLayoutInfo](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#PercentLayoutInfo())()` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `void` | `[fillLayoutParams](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#fillLayoutParams(android.view.ViewGroup.LayoutParams,int,int))( https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html params, int widthHint, int heightHint )` **This method is deprecated.** Deprecated in Java |
| `void` | `[fillMarginLayoutParams](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#fillMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams,int,int))( https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html params, int widthHint, int heightHint )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#fillMarginLayoutParams(android.view.View,android.view.ViewGroup.MarginLayoutParams,int,int)` for proper RTL support. <br /> |
| `void` | `[fillMarginLayoutParams](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#fillMarginLayoutParams(android.view.View,android.view.ViewGroup.MarginLayoutParams,int,int))( https://developer.android.com/reference/android/view/View.html view, https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html params, int widthHint, int heightHint )` **This method is deprecated.** Deprecated in Java |
| `void` | `[restoreLayoutParams](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#restoreLayoutParams(android.view.ViewGroup.LayoutParams))(https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html params)` **This method is deprecated.** Deprecated in Java |
| `void` | `[restoreMarginLayoutParams](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#restoreMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams))(https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html params)` **This method is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/java/lang/String.html` | `[toString](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#toString())()` **This method is deprecated.** Deprecated in Java |

## Public fields

### aspectRatio

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public float aspectRatio
```

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

The decimal value of the percentage-based aspect ratio.

### bottomMarginPercent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public float bottomMarginPercent
```

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

The decimal value of the percentage-based bottom margin.

### endMarginPercent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public float endMarginPercent
```

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

The decimal value of the percentage-based end margin.

### heightPercent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public float heightPercent
```

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

The decimal value of the percentage-based height.

### leftMarginPercent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public float leftMarginPercent
```

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

The decimal value of the percentage-based left margin.

### rightMarginPercent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public float rightMarginPercent
```

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

The decimal value of the percentage-based right margin.

### startMarginPercent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public float startMarginPercent
```

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

The decimal value of the percentage-based start margin.

### topMarginPercent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public float topMarginPercent
```

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

The decimal value of the percentage-based top margin.

### widthPercent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public float widthPercent
```

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

The decimal value of the percentage-based width.

## Public constructors

### PercentLayoutInfo

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public [PercentLayoutInfo](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#PercentLayoutInfo())()
```

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

## Public methods

### fillLayoutParams

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public void [fillLayoutParams](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#fillLayoutParams(android.view.ViewGroup.LayoutParams,int,int))(
    ViewGroup.LayoutParams params,
    int widthHint,
    int heightHint
)
```

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

Fills the `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#width` and `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#height` fields of the passed `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html` object based on currently set percentage values.

### fillMarginLayoutParams

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public void [fillMarginLayoutParams](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#fillMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams,int,int))(
    ViewGroup.MarginLayoutParams params,
    int widthHint,
    int heightHint
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#fillMarginLayoutParams(android.view.View,android.view.ViewGroup.MarginLayoutParams,int,int)` for proper RTL support.

### fillMarginLayoutParams

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public void [fillMarginLayoutParams](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#fillMarginLayoutParams(android.view.View,android.view.ViewGroup.MarginLayoutParams,int,int))(
    View view,
    ViewGroup.MarginLayoutParams params,
    int widthHint,
    int heightHint
)
```

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

Fills the margin fields of the passed `https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html` object based on currently set percentage values and the current layout direction of the passed `https://developer.android.com/reference/android/view/View.html`.

### restoreLayoutParams

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public void [restoreLayoutParams](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#restoreLayoutParams(android.view.ViewGroup.LayoutParams))(ViewGroup.LayoutParams params)
```

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

Restores original dimensions after they were changed for percentage based values. You should call this method only if you previously called `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#fillLayoutParams(android.view.ViewGroup.LayoutParams,int,int)`.

### restoreMarginLayoutParams

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/percentlayout#1.0.0)

```
public void [restoreMarginLayoutParams](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#restoreMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams))(ViewGroup.MarginLayoutParams params)
```

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

Restores the original dimensions and margins after they were changed for percentage based values. You should call this method only if you previously called `https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#fillMarginLayoutParams(android.view.View,android.view.ViewGroup.MarginLayoutParams,int,int)`.

### toString

```
public String [toString](https://developer.android.com/reference/androidx/percentlayout/widget/PercentLayoutHelper.PercentLayoutInfo#toString())()
```

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