ScaleProvider

public final class ScaleProvider implements VisibilityAnimatorProvider


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 constructors

ScaleProvider(boolean growing)

Public methods

Animator
createAppear(ViewGroup sceneRoot, View view)

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

Animator
createDisappear(ViewGroup sceneRoot, View view)

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

float

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

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

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

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

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

boolean

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

void
setGrowing(boolean growing)

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

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.

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.

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.

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.

void
setScaleOnDisappear(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.

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.