Stay organized with collections
Save and categorize content based on your preferences.
FadeProvider
public
final
class
FadeProvider
extends Object
implements
VisibilityAnimatorProvider
java.lang.Object
|
↳ |
com.google.android.material.transition.platform.FadeProvider
|
A class that configures and is able to provide an Animator
that fades a view.
Summary
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
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
|
Public constructors
FadeProvider
public FadeProvider ()
Public methods
createAppear
public 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
|
createDisappear
public 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
|
getIncomingEndThreshold
public float getIncomingEndThreshold ()
Get the fraction at which the appearing fade animation will end between 0 and 1.
setIncomingEndThreshold
public 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 |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# FadeProvider\n\nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nFadeProvider\n============\n\n\n`\npublic\n\nfinal\n\nclass\nFadeProvider\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\nimplements\n\n`[VisibilityAnimatorProvider](/reference/com/google/android/material/transition/platform/VisibilityAnimatorProvider)`\n\n\n`\n\n|---|--------------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.google.android.material.transition.platform.FadeProvider |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA class that configures and is able to provide an [Animator](/reference/android/animation/Animator) that fades a view.\n\nSummary\n-------\n\n| ### Public constructors ||\n|----------------------------------------------------------------------------------------------------------------|---|\n| ` `[FadeProvider](/reference/com/google/android/material/transition/platform/FadeProvider#FadeProvider())`() ` |\n\n| ### Public methods ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` Animator` | ` `[createAppear](/reference/com/google/android/material/transition/platform/FadeProvider#createAppear(android.view.ViewGroup,%20android.view.View))`(ViewGroup sceneRoot, View view) ` Should return an Animator that animates in the appearing target `view`. |\n| ` Animator` | ` `[createDisappear](/reference/com/google/android/material/transition/platform/FadeProvider#createDisappear(android.view.ViewGroup,%20android.view.View))`(ViewGroup sceneRoot, View view) ` Should return an Animator that animates out the disappearing target `view`. |\n| ` float` | ` `[getIncomingEndThreshold](/reference/com/google/android/material/transition/platform/FadeProvider#getIncomingEndThreshold())`() ` Get the fraction at which the appearing fade animation will end between 0 and 1. |\n| ` void` | ` `[setIncomingEndThreshold](/reference/com/google/android/material/transition/platform/FadeProvider#setIncomingEndThreshold(float))`(float incomingEndThreshold) ` Set the fraction by which an appearing fade animation should end between 0 and 1. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n| From interface ` `[com.google.android.material.transition.platform.VisibilityAnimatorProvider](/reference/com/google/android/material/transition/platform/VisibilityAnimatorProvider)` ` |----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract Animator` | ` `[createAppear](/reference/com/google/android/material/transition/platform/VisibilityAnimatorProvider#createAppear(android.view.ViewGroup,%20android.view.View))`(ViewGroup sceneRoot, View view) ` Should return an Animator that animates in the appearing target `view`. | | ` abstract Animator` | ` `[createDisappear](/reference/com/google/android/material/transition/platform/VisibilityAnimatorProvider#createDisappear(android.view.ViewGroup,%20android.view.View))`(ViewGroup sceneRoot, View view) ` Should return an Animator that animates out the disappearing target `view`. | ||\n\nPublic constructors\n-------------------\n\n### FadeProvider\n\n```\npublic FadeProvider ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### createAppear\n\n```\npublic Animator createAppear (ViewGroup sceneRoot, \n View view)\n```\n\nShould return an Animator that animates in the appearing target `view`.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------|\n| `sceneRoot` | `ViewGroup`: The root of the transition hierarchy, which can be useful for checking configurations such as RTL \u003cbr /\u003e |\n| `view` | `View`: The view that is appearing \u003cbr /\u003e |\n\n| Returns ||\n|------------|--------|\n| `Animator` | \u003cbr /\u003e |\n\n### createDisappear\n\n```\npublic Animator createDisappear (ViewGroup sceneRoot, \n View view)\n```\n\nShould return an Animator that animates out the disappearing target `view`.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------|\n| `sceneRoot` | `ViewGroup`: The root of the transition hierarchy, which can be useful for checking configurations such as RTL \u003cbr /\u003e |\n| `view` | `View`: The view that is disappearing \u003cbr /\u003e |\n\n| Returns ||\n|------------|--------|\n| `Animator` | \u003cbr /\u003e |\n\n### getIncomingEndThreshold\n\n```\npublic float getIncomingEndThreshold ()\n```\n\nGet the fraction at which the appearing fade animation will end between 0 and 1.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------|--------|\n| `float` | \u003cbr /\u003e |\n\n**See also:**\n\n- [setIncomingEndThreshold(float)](/reference/com/google/android/material/transition/platform/FadeProvider#setIncomingEndThreshold(float)) \n\n### setIncomingEndThreshold\n\n```\npublic void setIncomingEndThreshold (float incomingEndThreshold)\n```\n\nSet the fraction by which an appearing fade animation should end between 0 and 1.\n\nThis can be used to stagger animations when this class' resulting animator is used inside an\nAnimatorSet. If the containing AnimatorSet has a total duration of 100 milliseconds and\nincomingEndThreshold is set to .75f, this class' animator will run and complete (the view will\nbe completely faded in) after the AnimatorSet has run for 75 milliseconds.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------------------|----------------|\n| `incomingEndThreshold` | `float` \u003cbr /\u003e |"]]