1 /*
2  * Copyright 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package androidx.core.view;
17 
18 import android.animation.Animator;
19 import android.animation.AnimatorListenerAdapter;
20 import android.animation.ValueAnimator;
21 import android.annotation.SuppressLint;
22 import android.graphics.Paint;
23 import android.os.Build;
24 import android.view.View;
25 import android.view.ViewPropertyAnimator;
26 import android.view.animation.Interpolator;
27 
28 import androidx.annotation.RequiresApi;
29 
30 import org.jspecify.annotations.NonNull;
31 import org.jspecify.annotations.Nullable;
32 
33 import java.lang.ref.WeakReference;
34 
35 public final class ViewPropertyAnimatorCompat {
36     private final WeakReference<View> mView;
37 
ViewPropertyAnimatorCompat(View view)38     ViewPropertyAnimatorCompat(View view) {
39         mView = new WeakReference<>(view);
40     }
41 
42     /**
43      * Sets the duration for the underlying animator that animates the requested properties.
44      * By default, the animator uses the default value for ValueAnimator. Calling this method
45      * will cause the declared value to be used instead.
46      *
47      * @param value The length of ensuing property animations, in milliseconds. The value
48      * cannot be negative.
49      * @return This object, allowing calls to methods in this class to be chained.
50      */
setDuration(long value)51     public @NonNull ViewPropertyAnimatorCompat setDuration(long value) {
52         View view;
53         if ((view = mView.get()) != null) {
54             view.animate().setDuration(value);
55         }
56         return this;
57     }
58 
59     /**
60      * This method will cause the View's <code>alpha</code> property to be animated to the
61      * specified value. Animations already running on the property will be canceled.
62      *
63      * @param value The value to be animated to.
64      * @return This object, allowing calls to methods in this class to be chained.
65      */
alpha(float value)66     public @NonNull ViewPropertyAnimatorCompat alpha(float value) {
67         View view;
68         if ((view = mView.get()) != null) {
69             view.animate().alpha(value);
70         }
71         return this;
72     }
73 
74     /**
75      * This method will cause the View's <code>alpha</code> property to be animated by the
76      * specified value. Animations already running on the property will be canceled.
77      *
78      * @param value The amount to be animated by, as an offset from the current value.
79      * @return This object, allowing calls to methods in this class to be chained.
80      */
alphaBy(float value)81     public @NonNull ViewPropertyAnimatorCompat alphaBy(float value) {
82         View view;
83         if ((view = mView.get()) != null) {
84             view.animate().alphaBy(value);
85         }
86         return this;
87     }
88 
89     /**
90      * This method will cause the View's <code>translationX</code> property to be animated to the
91      * specified value. Animations already running on the property will be canceled.
92      *
93      * @param value The value to be animated to.
94      * @return This object, allowing calls to methods in this class to be chained.
95      */
translationX(float value)96     public @NonNull ViewPropertyAnimatorCompat translationX(float value) {
97         View view;
98         if ((view = mView.get()) != null) {
99             view.animate().translationX(value);
100         }
101         return this;
102     }
103 
104     /**
105      * This method will cause the View's <code>translationY</code> property to be animated to the
106      * specified value. Animations already running on the property will be canceled.
107      *
108      * @param value The value to be animated to.
109      * @return This object, allowing calls to methods in this class to be chained.
110      */
translationY(float value)111     public @NonNull ViewPropertyAnimatorCompat translationY(float value) {
112         View view;
113         if ((view = mView.get()) != null) {
114             view.animate().translationY(value);
115         }
116         return this;
117     }
118 
119     /**
120      * Specifies an action to take place when the next animation ends. The action is only
121      * run if the animation ends normally; if the ViewPropertyAnimator is canceled during
122      * that animation, the runnable will not run.
123      * This method, along with {@link #withStartAction(Runnable)}, is intended to help facilitate
124      * choreographing ViewPropertyAnimator animations with other animations or actions
125      * in the application.
126      *
127      * <p>For example, the following code animates a view to x=200 and then back to 0:</p>
128      * <pre>
129      *     Runnable endAction = new Runnable() {
130      *         public void run() {
131      *             view.animate().x(0);
132      *         }
133      *     };
134      *     view.animate().x(200).withEndAction(endAction);
135      * </pre>
136      *
137      * <p>For API 14 and 15, this method will run by setting
138      * a listener on the ViewPropertyAnimatorCompat object and running the action
139      * in that listener's {@link ViewPropertyAnimatorListener#onAnimationEnd(View)} method.</p>
140      *
141      * @param runnable The action to run when the next animation ends.
142      * @return This object, allowing calls to methods in this class to be chained.
143      */
withEndAction(@onNull Runnable runnable)144     public @NonNull ViewPropertyAnimatorCompat withEndAction(@NonNull Runnable runnable) {
145         View view;
146         if ((view = mView.get()) != null) {
147             ViewPropertyAnimator animator = view.animate();
148             animator.withEndAction(runnable);
149         }
150         return this;
151     }
152 
153     /**
154      * Returns the current duration of property animations. If the duration was set on this
155      * object, that value is returned. Otherwise, the default value of the underlying Animator
156      * is returned.
157      *
158      * @see #setDuration(long)
159      * @return The duration of animations, in milliseconds.
160      */
getDuration()161     public long getDuration() {
162         View view;
163         if ((view = mView.get()) != null) {
164             return view.animate().getDuration();
165         } else {
166             return 0;
167         }
168     }
169 
170     /**
171      * Sets the interpolator for the underlying animator that animates the requested properties.
172      * By default, the animator uses the default interpolator for ValueAnimator. Calling this method
173      * will cause the declared object to be used instead.
174      *
175      * @param value The TimeInterpolator to be used for ensuing property animations.
176      * @return This object, allowing calls to methods in this class to be chained.
177      */
setInterpolator(@ullable Interpolator value)178     public @NonNull ViewPropertyAnimatorCompat setInterpolator(@Nullable Interpolator value) {
179         View view;
180         if ((view = mView.get()) != null) {
181             view.animate().setInterpolator(value);
182         }
183         return this;
184     }
185 
186     /**
187      * Returns the timing interpolator that this animation uses.
188      *
189      * @return The timing interpolator for this animation.
190      */
getInterpolator()191     public @Nullable Interpolator getInterpolator() {
192         View view;
193         if ((view = mView.get()) != null) {
194             ViewPropertyAnimator animator = view.animate();
195             return (Interpolator) animator.getInterpolator();
196         }
197         return null;
198     }
199 
200     /**
201      * Sets the startDelay for the underlying animator that animates the requested properties.
202      * By default, the animator uses the default value for ValueAnimator. Calling this method
203      * will cause the declared value to be used instead.
204      *
205      * @param value The delay of ensuing property animations, in milliseconds. The value
206      * cannot be negative.
207      * @return This object, allowing calls to methods in this class to be chained.
208      */
setStartDelay(long value)209     public @NonNull ViewPropertyAnimatorCompat setStartDelay(long value) {
210         View view;
211         if ((view = mView.get()) != null) {
212             view.animate().setStartDelay(value);
213         }
214         return this;
215     }
216 
217     /**
218      * Returns the current startDelay of property animations. If the startDelay was set on this
219      * object, that value is returned. Otherwise, the default value of the underlying Animator
220      * is returned.
221      *
222      * @see #setStartDelay(long)
223      * @return The startDelay of animations, in milliseconds.
224      */
getStartDelay()225     public long getStartDelay() {
226         View view;
227         if ((view = mView.get()) != null) {
228             return view.animate().getStartDelay();
229         } else {
230             return 0;
231         }
232     }
233 
234     /**
235      * This method will cause the View's <code>rotation</code> property to be animated to the
236      * specified value. Animations already running on the property will be canceled.
237      *
238      * @param value The value to be animated to.
239      * @return This object, allowing calls to methods in this class to be chained.
240      */
rotation(float value)241     public @NonNull ViewPropertyAnimatorCompat rotation(float value) {
242         View view;
243         if ((view = mView.get()) != null) {
244             view.animate().rotation(value);
245         }
246         return this;
247     }
248 
249     /**
250      * This method will cause the View's <code>rotation</code> property to be animated by the
251      * specified value. Animations already running on the property will be canceled.
252      *
253      * @param value The amount to be animated by, as an offset from the current value.
254      * @return This object, allowing calls to methods in this class to be chained.
255      */
rotationBy(float value)256     public @NonNull ViewPropertyAnimatorCompat rotationBy(float value) {
257         View view;
258         if ((view = mView.get()) != null) {
259             view.animate().rotationBy(value);
260         }
261         return this;
262     }
263 
264     /**
265      * This method will cause the View's <code>rotationX</code> property to be animated to the
266      * specified value. Animations already running on the property will be canceled.
267      *
268      * @param value The value to be animated to.
269      * @return This object, allowing calls to methods in this class to be chained.
270      */
rotationX(float value)271     public @NonNull ViewPropertyAnimatorCompat rotationX(float value) {
272         View view;
273         if ((view = mView.get()) != null) {
274             view.animate().rotationX(value);
275         }
276         return this;
277     }
278 
279     /**
280      * This method will cause the View's <code>rotationX</code> property to be animated by the
281      * specified value. Animations already running on the property will be canceled.
282      *
283      * @param value The amount to be animated by, as an offset from the current value.
284      * @return This object, allowing calls to methods in this class to be chained.
285      */
rotationXBy(float value)286     public @NonNull ViewPropertyAnimatorCompat rotationXBy(float value) {
287         View view;
288         if ((view = mView.get()) != null) {
289             view.animate().rotationXBy(value);
290         }
291         return this;
292     }
293 
294     /**
295      * This method will cause the View's <code>rotationY</code> property to be animated to the
296      * specified value. Animations already running on the property will be canceled.
297      *
298      * @param value The value to be animated to.
299      * @return This object, allowing calls to methods in this class to be chained.
300      */
rotationY(float value)301     public @NonNull ViewPropertyAnimatorCompat rotationY(float value) {
302         View view;
303         if ((view = mView.get()) != null) {
304             view.animate().rotationY(value);
305         }
306         return this;
307     }
308 
309     /**
310      * This method will cause the View's <code>rotationY</code> property to be animated by the
311      * specified value. Animations already running on the property will be canceled.
312      *
313      * @param value The amount to be animated by, as an offset from the current value.
314      * @return This object, allowing calls to methods in this class to be chained.
315      */
rotationYBy(float value)316     public @NonNull ViewPropertyAnimatorCompat rotationYBy(float value) {
317         View view;
318         if ((view = mView.get()) != null) {
319             view.animate().rotationYBy(value);
320         }
321         return this;
322     }
323 
324     /**
325      * This method will cause the View's <code>scaleX</code> property to be animated to the
326      * specified value. Animations already running on the property will be canceled.
327      *
328      * @param value The value to be animated to.
329      * @return This object, allowing calls to methods in this class to be chained.
330      */
scaleX(float value)331     public @NonNull ViewPropertyAnimatorCompat scaleX(float value) {
332         View view;
333         if ((view = mView.get()) != null) {
334             view.animate().scaleX(value);
335         }
336         return this;
337     }
338 
339     /**
340      * This method will cause the View's <code>scaleX</code> property to be animated by the
341      * specified value. Animations already running on the property will be canceled.
342      *
343      * @param value The amount to be animated by, as an offset from the current value.
344      * @return This object, allowing calls to methods in this class to be chained.
345      */
scaleXBy(float value)346     public @NonNull ViewPropertyAnimatorCompat scaleXBy(float value) {
347         View view;
348         if ((view = mView.get()) != null) {
349             view.animate().scaleXBy(value);
350         }
351         return this;
352     }
353 
354     /**
355      * This method will cause the View's <code>scaleY</code> property to be animated to the
356      * specified value. Animations already running on the property will be canceled.
357      *
358      * @param value The value to be animated to.
359      * @return This object, allowing calls to methods in this class to be chained.
360      */
scaleY(float value)361     public @NonNull ViewPropertyAnimatorCompat scaleY(float value) {
362         View view;
363         if ((view = mView.get()) != null) {
364             view.animate().scaleY(value);
365         }
366         return this;
367     }
368 
369     /**
370      * This method will cause the View's <code>scaleY</code> property to be animated by the
371      * specified value. Animations already running on the property will be canceled.
372      *
373      * @param value The amount to be animated by, as an offset from the current value.
374      * @return This object, allowing calls to methods in this class to be chained.
375      */
scaleYBy(float value)376     public @NonNull ViewPropertyAnimatorCompat scaleYBy(float value) {
377         View view;
378         if ((view = mView.get()) != null) {
379             view.animate().scaleYBy(value);
380         }
381         return this;
382     }
383 
384     /**
385      * Cancels all property animations that are currently running or pending.
386      */
cancel()387     public void cancel() {
388         View view;
389         if ((view = mView.get()) != null) {
390             view.animate().cancel();
391         }
392     }
393 
394     /**
395      * This method will cause the View's <code>x</code> property to be animated to the
396      * specified value. Animations already running on the property will be canceled.
397      *
398      * @param value The value to be animated to.
399      * @return This object, allowing calls to methods in this class to be chained.
400      */
x(float value)401     public @NonNull ViewPropertyAnimatorCompat x(float value) {
402         View view;
403         if ((view = mView.get()) != null) {
404             view.animate().x(value);
405         }
406         return this;
407     }
408 
409     /**
410      * This method will cause the View's <code>x</code> property to be animated by the
411      * specified value. Animations already running on the property will be canceled.
412      *
413      * @param value The amount to be animated by, as an offset from the current value.
414      * @return This object, allowing calls to methods in this class to be chained.
415      */
xBy(float value)416     public @NonNull ViewPropertyAnimatorCompat xBy(float value) {
417         View view;
418         if ((view = mView.get()) != null) {
419             view.animate().xBy(value);
420         }
421         return this;
422     }
423 
424     /**
425      * This method will cause the View's <code>y</code> property to be animated to the
426      * specified value. Animations already running on the property will be canceled.
427      *
428      * @param value The value to be animated to.
429      * @return This object, allowing calls to methods in this class to be chained.
430      */
y(float value)431     public @NonNull ViewPropertyAnimatorCompat y(float value) {
432         View view;
433         if ((view = mView.get()) != null) {
434             view.animate().y(value);
435         }
436         return this;
437     }
438 
439     /**
440      * This method will cause the View's <code>y</code> property to be animated by the
441      * specified value. Animations already running on the property will be canceled.
442      *
443      * @param value The amount to be animated by, as an offset from the current value.
444      * @return This object, allowing calls to methods in this class to be chained.
445      */
yBy(float value)446     public @NonNull ViewPropertyAnimatorCompat yBy(float value) {
447         View view;
448         if ((view = mView.get()) != null) {
449             view.animate().yBy(value);
450         }
451         return this;
452     }
453 
454     /**
455      * This method will cause the View's <code>translationX</code> property to be animated by the
456      * specified value. Animations already running on the property will be canceled.
457      *
458      * @param value The amount to be animated by, as an offset from the current value.
459      * @return This object, allowing calls to methods in this class to be chained.
460      */
translationXBy(float value)461     public @NonNull ViewPropertyAnimatorCompat translationXBy(float value) {
462         View view;
463         if ((view = mView.get()) != null) {
464             view.animate().translationXBy(value);
465         }
466         return this;
467     }
468 
469     /**
470      * This method will cause the View's <code>translationY</code> property to be animated by the
471      * specified value. Animations already running on the property will be canceled.
472      *
473      * @param value The amount to be animated by, as an offset from the current value.
474      * @return This object, allowing calls to methods in this class to be chained.
475      */
translationYBy(float value)476     public @NonNull ViewPropertyAnimatorCompat translationYBy(float value) {
477         View view;
478         if ((view = mView.get()) != null) {
479             view.animate().translationYBy(value);
480         }
481         return this;
482     }
483 
484     /**
485      * This method will cause the View's <code>translationZ</code> property to be animated by the
486      * specified value. Animations already running on the property will be canceled.
487      *
488      * <p>Prior to API 21, this method will do nothing.</p>
489      *
490      * @param value The amount to be animated by, as an offset from the current value.
491      * @return This object, allowing calls to methods in this class to be chained.
492      */
translationZBy(float value)493     public @NonNull ViewPropertyAnimatorCompat translationZBy(float value) {
494         View view;
495         if ((view = mView.get()) != null) {
496             if (Build.VERSION.SDK_INT >= 21) {
497                 ViewPropertyAnimator animator = view.animate();
498                 Api21Impl.translationZBy(animator, value);
499             }
500         }
501         return this;
502     }
503 
504     /**
505      * This method will cause the View's <code>translationZ</code> property to be animated to the
506      * specified value. Animations already running on the property will be canceled.
507      *
508      * <p>Prior to API 21, this method will do nothing.</p>
509      *
510      * @param value The amount to be animated by, as an offset from the current value.
511      * @return This object, allowing calls to methods in this class to be chained.
512      */
translationZ(float value)513     public @NonNull ViewPropertyAnimatorCompat translationZ(float value) {
514         View view;
515         if ((view = mView.get()) != null) {
516             if (Build.VERSION.SDK_INT >= 21) {
517                 ViewPropertyAnimator animator = view.animate();
518                 Api21Impl.translationZ(animator, value);
519             }
520         }
521         return this;
522     }
523 
524     /**
525      * This method will cause the View's <code>z</code> property to be animated to the
526      * specified value. Animations already running on the property will be canceled.
527      *
528      * <p>Prior to API 21, this method will do nothing.</p>
529      *
530      * @param value The amount to be animated by, as an offset from the current value.
531      * @return This object, allowing calls to methods in this class to be chained.
532      */
z(float value)533     public @NonNull ViewPropertyAnimatorCompat z(float value) {
534         View view;
535         if ((view = mView.get()) != null) {
536             if (Build.VERSION.SDK_INT >= 21) {
537                 ViewPropertyAnimator animator = view.animate();
538                 Api21Impl.z(animator, value);
539             }
540         }
541         return this;
542     }
543 
544     /**
545      * This method will cause the View's <code>z</code> property to be animated by the
546      * specified value. Animations already running on the property will be canceled.
547      *
548      * <p>Prior to API 21, this method will do nothing.</p>
549      *
550      * @param value The amount to be animated by, as an offset from the current value.
551      * @return This object, allowing calls to methods in this class to be chained.
552      */
zBy(float value)553     public @NonNull ViewPropertyAnimatorCompat zBy(float value) {
554         View view;
555         if ((view = mView.get()) != null) {
556             if (Build.VERSION.SDK_INT >= 21) {
557                 ViewPropertyAnimator animator = view.animate();
558                 Api21Impl.zBy(animator, value);
559             }
560         }
561         return this;
562     }
563 
564     /**
565      * Starts the currently pending property animations immediately. Calling <code>start()</code>
566      * is optional because all animations start automatically at the next opportunity. However,
567      * if the animations are needed to start immediately and synchronously (not at the time when
568      * the next event is processed by the hierarchy, which is when the animations would begin
569      * otherwise), then this method can be used.
570      */
start()571     public void start() {
572         View view;
573         if ((view = mView.get()) != null) {
574             view.animate().start();
575         }
576     }
577 
578     /**
579      * The View associated with this ViewPropertyAnimator will have its
580      * {@link View#setLayerType(int, Paint) layer type} set to
581      * {@link View#LAYER_TYPE_HARDWARE} for the duration of the next animation.
582      * As stated in the documentation for {@link View#LAYER_TYPE_HARDWARE},
583      * the actual type of layer used internally depends on the runtime situation of the
584      * view. If the activity and this view are hardware-accelerated, then the layer will be
585      * accelerated as well. If the activity or the view is not accelerated, then the layer will
586      * effectively be the same as {@link View#LAYER_TYPE_SOFTWARE}.
587      *
588      * <p>This state is not persistent, either on the View or on this ViewPropertyAnimator: the
589      * layer type of the View will be restored when the animation ends to what it was when this
590      * method was called, and this setting on ViewPropertyAnimator is only valid for the next
591      * animation. Note that calling this method and then independently setting the layer type of
592      * the View (by a direct call to
593      * {@link View#setLayerType(int, Paint)}) will result in some
594      * inconsistency, including having the layer type restored to its pre-withLayer()
595      * value when the animation ends.</p>
596      *
597      * @see View#setLayerType(int, Paint)
598      * @return This object, allowing calls to methods in this class to be chained.
599      */
600     @SuppressLint("WrongConstant")
withLayer()601     public @NonNull ViewPropertyAnimatorCompat withLayer() {
602         View view;
603         if ((view = mView.get()) != null) {
604             ViewPropertyAnimator animator = view.animate();
605             animator.withLayer();
606         }
607         return this;
608     }
609 
610     /**
611      * Specifies an action to take place when the next animation runs. If there is a
612      * {@link #setStartDelay(long) startDelay} set on this ViewPropertyAnimator, then the
613      * action will run after that startDelay expires, when the actual animation begins.
614      * This method, along with {@link #withEndAction(Runnable)}, is intended to help facilitate
615      * choreographing ViewPropertyAnimator animations with other animations or actions
616      * in the application.
617      *
618      * @param runnable The action to run when the next animation starts.
619      * @return This object, allowing calls to methods in this class to be chained.
620      */
withStartAction(@onNull Runnable runnable)621     public @NonNull ViewPropertyAnimatorCompat withStartAction(@NonNull Runnable runnable) {
622         View view;
623         if ((view = mView.get()) != null) {
624             ViewPropertyAnimator animator = view.animate();
625             animator.withStartAction(runnable);
626         }
627         return this;
628     }
629 
630     /**
631      * Sets a listener for events in the underlying Animators that run the property
632      * animations.
633      *
634      * @param listener The listener to be called with AnimatorListener events. A value of
635      * <code>null</code> removes any existing listener.
636      * @return This object, allowing calls to methods in this class to be chained.
637      */
setListener( final @Nullable ViewPropertyAnimatorListener listener)638     public @NonNull ViewPropertyAnimatorCompat setListener(
639             final @Nullable ViewPropertyAnimatorListener listener) {
640         final View view;
641         if ((view = mView.get()) != null) {
642             setListenerInternal(view, listener);
643         }
644         return this;
645     }
646 
setListenerInternal(final View view, final ViewPropertyAnimatorListener listener)647     private void setListenerInternal(final View view, final ViewPropertyAnimatorListener listener) {
648         if (listener != null) {
649             view.animate().setListener(new AnimatorListenerAdapter() {
650                 @Override
651                 public void onAnimationCancel(Animator animation) {
652                     listener.onAnimationCancel(view);
653                 }
654 
655                 @Override
656                 public void onAnimationEnd(Animator animation) {
657                     listener.onAnimationEnd(view);
658                 }
659 
660                 @Override
661                 public void onAnimationStart(Animator animation) {
662                     listener.onAnimationStart(view);
663                 }
664             });
665         } else {
666             view.animate().setListener(null);
667         }
668     }
669 
670     /**
671      * Sets a listener for update events in the underlying Animator that runs
672      * the property animations.
673      *
674      * @param listener The listener to be called with update events. A value of
675      * <code>null</code> removes any existing listener.
676      * @return This object, allowing calls to methods in this class to be chained.
677      */
setUpdateListener( final @Nullable ViewPropertyAnimatorUpdateListener listener)678     public @NonNull ViewPropertyAnimatorCompat setUpdateListener(
679             final @Nullable ViewPropertyAnimatorUpdateListener listener) {
680         final View view;
681         if ((view = mView.get()) != null) {
682             ValueAnimator.AnimatorUpdateListener wrapped = null;
683             if (listener != null) {
684                     wrapped = valueAnimator -> listener.onAnimationUpdate(view);
685                 }
686             ViewPropertyAnimator animator = view.animate();
687             animator.setUpdateListener(wrapped);
688         }
689         return this;
690     }
691 
692     @RequiresApi(21)
693     static class Api21Impl {
Api21Impl()694         private Api21Impl() {
695             // This class is not instantiable.
696         }
697 
translationZBy(ViewPropertyAnimator viewPropertyAnimator, float value)698         static ViewPropertyAnimator translationZBy(ViewPropertyAnimator viewPropertyAnimator,
699                 float value) {
700             return viewPropertyAnimator.translationZBy(value);
701         }
702 
translationZ(ViewPropertyAnimator viewPropertyAnimator, float value)703         static ViewPropertyAnimator translationZ(ViewPropertyAnimator viewPropertyAnimator,
704                 float value) {
705             return viewPropertyAnimator.translationZ(value);
706         }
707 
z(ViewPropertyAnimator viewPropertyAnimator, float value)708         static ViewPropertyAnimator z(ViewPropertyAnimator viewPropertyAnimator, float value) {
709             return viewPropertyAnimator.z(value);
710         }
711 
zBy(ViewPropertyAnimator viewPropertyAnimator, float value)712         static ViewPropertyAnimator zBy(ViewPropertyAnimator viewPropertyAnimator, float value) {
713             return viewPropertyAnimator.zBy(value);
714         }
715     }
716 }
717