Google is committed to advancing racial equity for Black communities. See how.

FadeProvider

public final class FadeProvider
extends Object implements VisibilityAnimatorProvider

java.lang.Object
   ↳ com.google.android.material.transition.FadeProvider


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

Summary

Public constructors

FadeProvider()

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 getIncomingEndThreshold()

Get the fraction at which the appearing fade animation will end between 0 and 1.

void setIncomingEndThreshold(float incomingEndThreshold)

Set the fraction by which an appearing fade animation should end between 0 and 1.

Inherited methods

From class java.lang.Object
From interface com.google.android.material.transition.VisibilityAnimatorProvider

Public constructors

FadeProvider

FadeProvider ()

Public methods

createAppear

Animator createAppear (ViewGroup sceneRoot, 
                View view)

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

Parameters
sceneRoot ViewGroup: The root of the transition hierarchy, which can be useful for checking configurations such as RTL

view View: The view that is appearing

Returns
Animator

createDisappear

Animator createDisappear (ViewGroup sceneRoot, 
                View view)

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

Parameters
sceneRoot ViewGroup: The root of the transition hierarchy, which can be useful for checking configurations such as RTL

view View: The view that is disappearing

Returns
Animator

getIncomingEndThreshold

float getIncomingEndThreshold ()

Get the fraction at which the appearing fade animation will end between 0 and 1.

Returns
float

setIncomingEndThreshold

void setIncomingEndThreshold (float incomingEndThreshold)

Set the fraction by which an appearing fade animation should end between 0 and 1.

This can be used to stagger animations when this class' resulting animator is used inside an AnimatorSet. If the containing AnimatorSet has a total duration of 100 milliseconds and incomingEndThreshold is set to .75f, this class' animator will run and complete (the view will be completely faded in) after the AnimatorSet has run for 75 milliseconds.

Parameters
incomingEndThreshold float