daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top