Animation setInterpolator - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Animation setInterpolator method.

This code example shows how to use the following methods:setAnimationListener, setDuration, setFillBefore, setFillEnabled, setInterpolator
This code example shows how to use the following methods:setInterpolator, addAnimation, setDuration
    fadeOut=AnimationUtils.loadAnimation(ctxt, R.anim.fade);
  } 
   
  public void toggle() { 
    TranslateAnimation anim=null;
    AnimationSet set=new AnimationSet(true);
     
    isOpen=!isOpen;
     
    if (isOpen) {
      setVisibility(View.VISIBLE);
      anim=new TranslateAnimation(0.0f, 0.0f,
                                  getHeight(),
                                  0.0f); 
    } 
    else { 
      anim=new TranslateAnimation(0.0f, 0.0f, 0.0f,
                                  getHeight());
      anim.setAnimationListener(collapseListener);
      set.addAnimation(fadeOut);

9
CodeRank
This code example shows how to use the following methods:setDuration, setFillAfter, setFillEnabled, setInterpolator
			if(olddegree == 0 && newdegree == 270){
				newdegree = -90;
			} else if(olddegree == 270 && newdegree == 0){
				newdegree = 360;
			} 
			retval = new RotateAnimation(olddegree,
					newdegree,
					Animation.RELATIVE_TO_SELF,
					0.5f, 
					Animation.RELATIVE_TO_SELF,
					0.5f); 
 
			retval.setDuration(500);
			retval.setFillEnabled(true);
			retval.setFillAfter(true);
			retval.setInterpolator(new DecelerateInterpolator());
		} 
 
		return retval;
	} 
	 
8
CodeRank
This code example shows how to use the following methods:setAnimationListener, setDuration, setInterpolator
      anim=new TranslateAnimation(0.0f, 0.0f,
                                  getHeight(),
                                  0.0f); 
    } 
    else { 
      anim=new TranslateAnimation(0.0f, 0.0f, 0.0f,
                                  getHeight());
      anim.setAnimationListener(collapseListener);
    } 
     
    anim.setDuration(speed);
    anim.setInterpolator(new AccelerateInterpolator(1.0f));
    startAnimation(anim);
  } 
   
  Animation.AnimationListener collapseListener=new Animation.AnimationListener() {
    public void onAnimationEnd(Animation animation) { 
      setVisibility(View.INVISIBLE); 
    } 
     
8
CodeRank
This code example shows how to use the following methods:setDuration, setFillAfter, setInterpolator, setStartOffset
This code example shows how to use the following methods:setAnimationListener, setDuration, setFillBefore, setFillEnabled, setInterpolator
This code example shows how to use the following methods:setDuration, setInterpolator
    	outtoLeft.setInterpolator(new AccelerateInterpolator());
    	return outtoLeft;
    } 
 
    public static Animation inFromLeftAnimation() {
    	Animation inFromLeft = new TranslateAnimation(
    			Animation.RELATIVE_TO_PARENT,  -1.0f, Animation.RELATIVE_TO_PARENT,  0.0f,
    			Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
    	); 
    	inFromLeft.setDuration(DURATION);
    	inFromLeft.setInterpolator(new AccelerateInterpolator());
    	return inFromLeft;
    } 
     
    public static Animation outToRightAnimation() {
    	Animation outtoRight = new TranslateAnimation(
    			Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  +1.0f,
    			Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
    	); 
    	outtoRight.setDuration(DURATION);
7
CodeRank
This code example shows how to use the following methods:setAnimationListener, setDuration, setInterpolator
				} 
				postProcess(); 
				return; 
			} 
			 
			animation = new TranslateAnimation(fromXDelta, toXDelta, fromYDelta, toYDelta); 
			animation.setDuration(calculatedDuration); 
			animation.setAnimationListener(animationListener); 
			if (mState == State.FLYING && mLinearFlying) { 
				animation.setInterpolator(new LinearInterpolator()); 
			} else 
			if (mInterpolator != null) { 
				animation.setInterpolator(mInterpolator); 
			} 
			startAnimation(animation); 
		} 
	}; 
 
	private AnimationListener animationListener = new AnimationListener() {
		public void onAnimationEnd(Animation animation) { 
7
CodeRank
This code example shows how to use the following methods:setDuration, setInterpolator
        } 
        translate(anim);
    } 
 
    private void translate(int interpolator) {
        Animation animation = new TranslateAnimation(0, 200, 0, 200);
        animation.setDuration(1000);
        animation.setInterpolator(this, interpolator);
 
        // 無限に繰り返す 
//        translate.setRepeatCount(-1); 
        // 4回繰り返す(0を指定した場合1回なので+1回繰り返される) 
//        translate.setRepeatCount(3); 
        // 元に戻さない(終了状態を維持する) 
//        translate.setFillAfter(true); 
 
        //アニメーションスタート 
        mImageView.startAnimation(animation);
    } 
} 
7
CodeRank
This code example shows how to use the following methods:setDuration, setInterpolator, setRepeatCount
			return; 
		} 
		float centerX = m_icon.getWidth()/2.0f;
		float centerY = m_icon.getHeight()/2.0f;
 
		RotateAnimation ra = new RotateAnimation(0, 360, centerX, centerY);
		ra.setDuration(1000);
		ra.setRepeatCount(-1);
		ra.setInterpolator(new LinearInterpolator());
		this.m_icon.startAnimation(ra);
	} 
	 
	public void endRefresh() { 
		this.m_icon.clearAnimation();
	} 
	 
	public boolean isRefreshing() { 
		Animation a = this.m_icon.getAnimation();
		return (a != null)?!a.hasEnded():false;
	} 
7
CodeRank

Related Animation setInterpolator Questions & Answers:

setInterpolator Method Overview
Sets the acceleration curve for this animation.
See Code Examples for other Android Animation Methods: