Android TranslateAnimation - 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 TranslateAnimation class.

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: 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); 
    } 
     
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
@Implements(AnimationUtils.class) 
public class ShadowAnimationUtils { 
 
  @Implementation 
  public static Animation loadAnimation(Context context, int id) { 
    Animation anim = new TranslateAnimation(0, 0, 30, 0); 
    Robolectric.shadowOf(anim).setLoadedFromResourceId(id); 
    return anim; 
  } 
 
  @Implementation 
  public static Interpolator loadInterpolator(Context context, int id) { 
    return new LinearInterpolator(); 
  } 
 
  @Implementation 
  public static LayoutAnimationController loadLayoutAnimation(Context context, int id) { 
    Animation anim = new TranslateAnimation(0, 0, 30, 0); 
    LayoutAnimationController layoutAnim = new LayoutAnimationController(anim); 
    Robolectric.shadowOf(layoutAnim).setLoadedFromResourceId(id); 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
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);
	} 
 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setAnimationListener, setDuration
	            break; 
	        case BOTTOM:
	            y=getHeight();
	            break; 
		}		 
		TranslateAnimation anim=new TranslateAnimation(0, x, 0,y);
		anim.setDuration(ANIM_DURATION);
		anim.setAnimationListener(new AnimationListener() {
			 
			//@Override 
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub 
			} 
			 
			//@Override 
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub 
			} 
			 
			//@Override 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android TranslateAnimation Questions & Answers:

See Code Examples for Android TranslateAnimation Methods: