private void createAnimation(float alpha,float x,float y,long duration){
  Animator alphaAnimator=ObjectAnimator.ofPropertyValuesHolder(this,PropertyValuesHolder.ofFloat("alpha",getAlpha(),alpha));
  Animator translationXAnimator=ObjectAnimator.ofPropertyValuesHolder(this,PropertyValuesHolder.ofFloat("translationX",getTranslationX(),x));
  Animator translationYAnimator=ObjectAnimator.ofPropertyValuesHolder(this,PropertyValuesHolder.ofFloat("translationY",getTranslationY(),y));
  mCurrentAnimation=new AnimatorSet();
  mCurrentAnimation.setDuration(Math.max(duration,0));
  mCurrentAnimation.playTogether(alphaAnimator,translationXAnimator,translationYAnimator);
  mCurrentAnimation.addListener(mAnimatorListenerAdapter);
  mCurrentAnimation.setInterpolator(mInterpolator);
  mCurrentAnimation.start();
}

private void createAnimation ( float alpha , float x , float y , long duration ) { Animator alphaAnimator = ObjectAnimator . ofPropertyValuesHolder ( this , PropertyValuesHolder . ofFloat ( "alpha" , getAlpha ( ) , alpha ) ) ; Animator translationXAnimator = ObjectAnimator . ofPropertyValuesHolder ( this , PropertyValuesHolder . ofFloat ( "translationX" , getTranslationX ( ) , x ) ) ; Animator translationYAnimator = ObjectAnimator . ofPropertyValuesHolder ( this , PropertyValuesHolder . ofFloat ( "translationY" , getTranslationY ( ) , y ) ) ; mCurrentAnimation = new AnimatorSet ( ) ; mCurrentAnimation . setDuration ( Math . max ( duration , 0 ) ) ; mCurrentAnimation . playTogether ( alphaAnimator , translationXAnimator , translationYAnimator ) ; mCurrentAnimation . addListener ( mAnimatorListenerAdapter ) ; mCurrentAnimation . setInterpolator ( mInterpolator ) ; mCurrentAnimation . start ( ) ; }
creates an animation that slides the view to the given location and visibility .
