Android RotateAnimation - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android RotateAnimation class.

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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDuration, setFillAfter, setInterpolator, setStartOffset
This code example shows how to use the following methods:
	 
	@Test 
	public void testAnimationList() { 
		Animation alpha = new AlphaAnimation(1f, 2f);
		Animation translate =  new TranslateAnimation(1f, 2f, 3f, 4f);
		Animation rotate = new RotateAnimation(1f, 2f);
		set.addAnimation(alpha);
		set.addAnimation(translate);
		set.addAnimation(rotate);
		 
		List<Animation> list = shadow.getAnimations();
        assertThat(list.size()).isEqualTo(3);
        assertThat(list.get(0)).isSameAs(alpha);
        assertThat(list.get(1)).isSameAs(translate);
        assertThat(list.get(2)).isSameAs(rotate);
	} 
 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDuration, setFillAfter
	 * @param durationMillis 
	 *            �D���� 
	 */ 
	public static Animation getRotateAnimation(float fromDegrees,
			float toDegrees, int durationMillis) {
		RotateAnimation rotate = new RotateAnimation(fromDegrees, toDegrees,
				Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
				0.5f); 
		rotate.setDuration(durationMillis);
		rotate.setFillAfter(true);
		return rotate;
	} 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDuration, setInterpolator, start
		} 
	} 
 
	public void animateToss() 
	{ 
		Animation animation = new RotateAnimation(0.0f, 3600.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
		animation.setDuration(1500);
		animation.setInterpolator(new AccelerateDecelerateInterpolator());
		setAnimation(animation);
		animation.start();
	} 
	 
	@Override 
	protected void onDraw(Canvas canvas) 
	{ 
		canvas.drawBitmap(tossPicture, (canvas.getWidth() / 2) - (tossPicture.getWidth() / 2), (canvas.getHeight() / 2) - (tossPicture.getHeight() / 2), null);
	} 
	 
	private Bitmap rotate(Bitmap bm, float degrees)
	{ 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDuration, setFillAfter, setFillEnabled, setRepeatCount
			} 
		} 
	} 
 
	public void startAnimation(int previous, int current) {
		Animation animation = new RotateAnimation(previous, current,
				Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
		animation.setDuration(250);
		animation.setRepeatCount(0);
		animation.setFillAfter(true);
		animation.setFillEnabled(true);
 
		mRecordButton.startAnimation(animation);
		mPlayButton.startAnimation(animation);
	} 
	 
	public static interface AudioRecorderPlayerListener { 
		public void onAudioStatusChanged(int stated);
	} 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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, setFillAfter, setStartOffset
	} 
	 
	public static void startAnimationOut(final ViewGroup viewGroup,int duration,int startOffset){
		 
		Animation animation;
		animation=new RotateAnimation(0, 180, Animation.RELATIVE_TO_SELF,0.5f, Animation.RELATIVE_TO_SELF, 1.0f);
		animation.setDuration(duration);
		animation.setFillAfter(true);
		animation.setStartOffset(startOffset);
		 
		animation.setAnimationListener(new AnimationListener() {
			 
			@Override 
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub 
				 
			} 
			 
			@Override 
			public void onAnimationRepeat(Animation animation) {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDuration
        mImageView.startAnimation(animation);
    } 
 
    public void startRotate(View view) {
        RotateAnimation animation;
        animation = new RotateAnimation(0, 360, mImageView.getWidth() / 2.0F, mImageView.getHeight() / 2.0F);
        // 3秒で 
        animation.setDuration(3000);
        mImageView.startAnimation(animation);
    } 
 
    public void onClick(View view) {
        int i = mSpinner.getSelectedItemPosition();
        Log.d("Recipe", "selectedItemPosition=" + i);
        int anim = 0;
        switch (i) {
        case 0: 
            anim = android.R.anim.accelerate_decelerate_interpolator;
            break; 
        case 1: 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Android RotateAnimation Questions & Answers:

See Code Examples for Android RotateAnimation Methods: