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