android / android-ktx

A set of Kotlin extensions for Android app development.
https://android.github.io/android-ktx/core-ktx/
7.46k stars 563 forks source link

Added androidx.core.view.ViewPropertyAnimator #567

Closed MonteCreasor closed 6 years ago

MonteCreasor commented 6 years ago

Added androidx.core.view.ViewPropertyAnimator based on androidx.core.animation.Animator. Each extension function returns the ViewPropertyAnimator receiver so that they can be used within the existing anddroid.core.view.ViewPropertyAnimator builder pattern. Also, this extension file does not include doOnPause or doOnResume support.

I guess the thing to consider is that you can't chain multiple 'doOn...' calls since the ViewPropertyAnimator only allows a single listener. Maybe you've already considered that and have decided that since each consecutive 'doOn...' call will overwrite the listener of any previous call, this will lead to accidental complexity. Nonetheless, I personally like the convenience of these extensions.

If you want, I could add an additional comment to each function to warn the caller, for example for the doOnEnd extension:

/**

googlebot commented 6 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers
MonteCreasor commented 6 years ago

I've signed it!

googlebot commented 6 years ago

CLAs look good, thanks!

romainguy commented 6 years ago

Thank you for the PR, this is unfortunately a duplicate of #560.