-
-
Save hitherejoe/92fc2623706a2a52589b to your computer and use it in GitHub Desktop.
This file contains 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
private void resizeView() { | |
final float widthHeightRatio = (float) getHeight() / (float) getWidth(); | |
resizeViewProperty(View.SCALE_X, .5f, 200); | |
resizeViewProperty(View.SCALE_Y, .5f / widthHeightRatio, 250); | |
} | |
private void resizeViewProperty(Property<View, Float> property, | |
float targetScale, | |
int durationOffset) { | |
ObjectAnimator animator = ObjectAnimator.ofFloat(this, property, 1f, targetScale); | |
animator.setInterpolator(new LinearOutSlowInInterpolator()); | |
animator.setStartDelay(DELAY_COLOR_CHANGE + durationOffset); | |
animator.start(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment