Created
April 7, 2020 08:44
-
-
Save alistairsykes/d2209825069a12fcc541f15f9aed24ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val diffY = resources.displayMetrics.heightPixels * 0.1F | |
val translateUp = ObjectAnimator.ofFloat(view, "translationY", 0F, -diffY) | |
translateUp.duration = 500 | |
translateUp.interpolator = LinearInterpolator() | |
val translateDown = ObjectAnimator.ofFloat(view, "translationY", -diffY, 0F) | |
translateDown.duration = 500 | |
translateDown.interpolator = BounceInterpolator() | |
val set = AnimatorSet() | |
set.playSequentially(translateUp, translateDown) | |
set.doOnEnd { | |
it.startDelay = 500 | |
it.start() | |
} | |
set.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment