Langue

ViewPropertyAnimator.WithEndAction(IRunnable) Méthode

Définition

Spécifie une action à effectuer lorsque l’animation suivante se termine.

[Android.Runtime.Register("withEndAction", "(Ljava/lang/Runnable;)Landroid/view/ViewPropertyAnimator;", "GetWithEndAction_Ljava_lang_Runnable_Handler")]
public virtual Android.Views.ViewPropertyAnimator WithEndAction(Java.Lang.IRunnable? runnable);
[<Android.Runtime.Register("withEndAction", "(Ljava/lang/Runnable;)Landroid/view/ViewPropertyAnimator;", "GetWithEndAction_Ljava_lang_Runnable_Handler")>]
abstract member WithEndAction : Java.Lang.IRunnable -> Android.Views.ViewPropertyAnimator
override this.WithEndAction : Java.Lang.IRunnable -> Android.Views.ViewPropertyAnimator

Paramètres

runnable
IRunnable

Action à exécuter lorsque l’animation suivante se termine.

Retours

Cet objet, permettant aux appels aux méthodes de cette classe d’être chaînés.

Attributs

Remarques

Spécifie une action à effectuer lorsque l’animation suivante se termine. L’action est exécutée uniquement si l’animation se termine normalement ; si ViewPropertyAnimator est annulé pendant cette animation, l’exécution ne s’exécute pas. Cette méthode, ainsi que #withStartAction(Runnable), est destinée à faciliter la chorégraphie ViewPropertyAnimator animations avec d’autres animations ou actions dans l’application.

Par exemple, le code suivant anime une vue sur x=200, puis revient à 0 :

Runnable endAction = new Runnable() {
                    public void run() {
                        view.animate().x(0);
                    }
                };
                view.animate().x(200).withEndAction(endAction);

Java documentation pour android.view.ViewPropertyAnimator.withEndAction(java.lang.Runnable).

Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.

S’applique à