Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. public static void valueAnimate(final View obj, int from, int to, Interpolator interpolator, long duration, long delay){
  2.  
  3. ValueAnimator anim = ValueAnimator.ofInt(from, to);
  4. anim.setInterpolator(interpolator == null ? DEFAULT_INTERPOLATOR : interpolator);
  5. anim.setDuration(duration);
  6. anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
  7. @Override
  8. public void onAnimationUpdate(ValueAnimator animation) {
  9. Integer value = (Integer) animation.getAnimatedValue();
  10. obj.getLayoutParams().height = value.intValue();
  11. obj.requestLayout();
  12. }
  13. });
  14. anim.setStartDelay(delay);
  15. anim.start();
  16. }
  17.  
  18. Animator.valueAnimate(mapUtilsContainer, CURR_MAPUTILC_H, 800, OVERSHOOT, 300, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement