# ScaleProvider

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/transition/ScaleProvider.java)

*** ** * ** ***


```
public final class ScaleProvider implements VisibilityAnimatorProvider
```

<br />

*** ** * ** ***

A class that configures and is able to provide an Animator that scales a view.

`ScaleProvider`'s constructor optionally takes a `growing` parameter. By default, this is set to true and will increase the size of the target both when appearing and disappearing. This is useful when pairing two animating targets, one appearing and one disappearing, that should both be either growing or shrinking to create a visual relationship.

## Summary

| ### Public fields |
|---|---|
| `float` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#incomingEndScale()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#incomingStartScale()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#outgoingEndScale()` |
| `float` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#outgoingStartScale()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#ScaleProvider()()` |
| `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#ScaleProvider(boolean)(boolean growing)` |

| ### Public methods |
|---|---|
| `Animator` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#createAppear(ViewGroup,View)(ViewGroup sceneRoot, View view)` Should return an Animator that animates in the appearing target `view`. |
| `Animator` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#createDisappear(ViewGroup,View)(ViewGroup sceneRoot, View view)` Should return an Animator that animates out the disappearing target `view`. |
| `float` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#getIncomingEndScale()()` The scale x and scale y value which an appearing and growing target will scale to and a disappearing and shrinking target will scale from. |
| `float` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#getIncomingStartScale()()` The scale x and scale y value which an appearing and growing target will scale from and a disappearing and shrinking target will scale to. |
| `float` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#getOutgoingEndScale()()` The scale x and scale y value which an appearing and shrinking target will scale from and a disappearing and growing target will scale to. |
| `float` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#getOutgoingStartScale()()` The scale x and scale y value which an appearing and shrinking target will scale to and a disappearing and growing target will scale from. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#isGrowing()()` Whether or not this animation's target will grow or shrink in size. |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#isScaleOnDisappear()()` Whether or not a scale animation will be run on this animation's target when disappearing. |
| `void` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#setGrowing(boolean)(boolean growing)` Set whether or not this animation's target will grow or shrink in size. |
| `void` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#setIncomingEndScale(float)(float incomingEndScale)` Set the scale x and scale y value which an appearing and growing target should scale to and a disappearing and shrinking target should scale from. |
| `void` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#setIncomingStartScale(float)(float incomingStartScale)` Set the scale x and scale y value which an appearing and growing target should scale from and a disappearing and shrinking target should scale to. |
| `void` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#setOutgoingEndScale(float)(float outgoingEndScale)` Set the scale x and scale y value which an appearing and shrinking target should scale from and a disappearing and growing target should scale to. |
| `void` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#setOutgoingStartScale(float)(float outgoingStartScale)` Set the scale x and scale y value which an appearing and shrinking target should scale to and a disappearing and growing target should scale from. |
| `void` | `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#setScaleOnDisappear(boolean)(boolean scaleOnDisappear)` Set whether or not a scale animation will be run on this animation's target when disappearing. |

## Public fields

### incomingEndScale

```
public float incomingEndScale
```

### incomingStartScale

```
public float incomingStartScale
```

### outgoingEndScale

```
public float outgoingEndScale
```

### outgoingStartScale

```
public float outgoingStartScale
```

## Public constructors

### ScaleProvider

```
public ScaleProvider()
```

### ScaleProvider

```
public ScaleProvider(boolean growing)
```

## Public methods

### createAppear

```
public Animator createAppear(ViewGroup sceneRoot, View view)
```

Should return an Animator that animates in the appearing target `view`.

| Parameters |
|---|---|
| `ViewGroup sceneRoot` | The root of the transition hierarchy, which can be useful for checking configurations such as RTL |
| `View view` | The view that is appearing |

### createDisappear

```
public Animator createDisappear(ViewGroup sceneRoot, View view)
```

Should return an Animator that animates out the disappearing target `view`.

| Parameters |
|---|---|
| `ViewGroup sceneRoot` | The root of the transition hierarchy, which can be useful for checking configurations such as RTL |
| `View view` | The view that is disappearing |

### getIncomingEndScale

```
public float getIncomingEndScale()
```

The scale x and scale y value which an appearing and growing target will scale to and a disappearing and shrinking target will scale from.

### getIncomingStartScale

```
public float getIncomingStartScale()
```

The scale x and scale y value which an appearing and growing target will scale from and a disappearing and shrinking target will scale to.

### getOutgoingEndScale

```
public float getOutgoingEndScale()
```

The scale x and scale y value which an appearing and shrinking target will scale from and a disappearing and growing target will scale to.

### getOutgoingStartScale

```
public float getOutgoingStartScale()
```

The scale x and scale y value which an appearing and shrinking target will scale to and a disappearing and growing target will scale from.

### isGrowing

```
public boolean isGrowing()
```

Whether or not this animation's target will grow or shrink in size.

### isScaleOnDisappear

```
public boolean isScaleOnDisappear()
```

Whether or not a scale animation will be run on this animation's target when disappearing.

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/transition/ScaleProvider#setScaleOnDisappear(boolean)` |   |

### setGrowing

```
public void setGrowing(boolean growing)
```

Set whether or not this animation's target will grow or shrink in size.

### setIncomingEndScale

```
public void setIncomingEndScale(float incomingEndScale)
```

Set the scale x and scale y value which an appearing and growing target should scale to and a disappearing and shrinking target should scale from.

### setIncomingStartScale

```
public void setIncomingStartScale(float incomingStartScale)
```

Set the scale x and scale y value which an appearing and growing target should scale from and a disappearing and shrinking target should scale to.

### setOutgoingEndScale

```
public void setOutgoingEndScale(float outgoingEndScale)
```

Set the scale x and scale y value which an appearing and shrinking target should scale from and a disappearing and growing target should scale to.

### setOutgoingStartScale

```
public void setOutgoingStartScale(float outgoingStartScale)
```

Set the scale x and scale y value which an appearing and shrinking target should scale to and a disappearing and growing target should scale from.

### setScaleOnDisappear

```
public void setScaleOnDisappear(boolean scaleOnDisappear)
```

Set whether or not a scale animation will be run on this animation's target when disappearing.

This is useful when using a single `ScaleProvider` that runs on multiple targets and only appearing targets should be animated.