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

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
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setDuration, setInterpolator
	 * @param imageView      {@link ImageView} which display image in 
	 * @param durationMillis The length of the animation in milliseconds 
	 */ 
	public static void animate(View imageView, int durationMillis) {
		if (imageView != null) {
			AlphaAnimation fadeImage = new AlphaAnimation(0, 1);
			fadeImage.setDuration(durationMillis);
			fadeImage.setInterpolator(new DecelerateInterpolator());
			imageView.startAnimation(fadeImage);
		} 
	} 
} 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setDuration, setInterpolator, setRepeatCount, setRepeatMode, setStartTime
            if (mInterpolator == null) {
                mInterpolator = new LinearInterpolator();
            } 
 
            mTransformation = new Transformation();
            mAnimation = new AlphaAnimation(0.0f, 1.0f);
            mAnimation.setRepeatMode(mBehavior);
            mAnimation.setRepeatCount(Animation.INFINITE);
            mAnimation.setDuration(mDuration);
            mAnimation.setInterpolator(mInterpolator);
            mAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
        } 
        postInvalidate(); 
    } 
 
    /** 
     * <p>Stop the indeterminate progress animation.</p> 
     */ 
    void stopAnimation() { 
        mAnimation = null;
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setDuration, setFillAfter
	private static void setAlpha(View view, float alphaValue){
		 
    	if(alphaValue == 1){
    		view.clearAnimation();
    	}else{ 
    		AlphaAnimation alpha = new AlphaAnimation(alphaValue, alphaValue);
        	alpha.setDuration(0); // Make animation instant
        	alpha.setFillAfter(true); // Tell it to persist after the animation ends    	
        	view.startAnimation(alpha);
    	} 
		 
	} 
	 
	public static void ensureUIThread(){ 
    	 
    	if(!isUIThread()){ 
    		AQUtility.report(new IllegalStateException("Not UI Thread"));
    	} 
    	 
    } 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setDuration, setFillAfter
 
    public LightView(Context context) {
        super(context);
 
        // だんだん透明になるAlphaAnimationを生成 
        mAnimation = new AlphaAnimation(1, 0);
        // 3秒で動くように 
        mAnimation.setDuration(3000);
        // 終了後、元に戻らないように 
        mAnimation.setFillAfter(true);
    } 
 
    public void randomDraw() { 
        // アニメーション中に次のアニメーションが動いて 
        // 欲しいのでキャンセルする 
        clearAnimation();
        // 色をランダムに選んで 
        mColor = mColors[random.nextInt(mColors.length - 1)];
        // アニメーション開始 
        startAnimation(mAnimation);
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setDuration
 
        if (mOrientation == orientation) return;
        mOrientation = orientation;
 
        if (getGLRootView() != null) { 
            AlphaAnimation anim = new AlphaAnimation(0.2f, 1);
            anim.setDuration(200);
            startAnimation(anim);
        } 
    } 
 
    abstract public GLView getPopupContent(); 
 
    abstract public void overrideSettings(String key, String settings);
 
    abstract public void reloadPreferences(); 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setDuration, setFillAfter
   } 
 
   public void setLoading(boolean loading) {
      if (loading) {
         mLoadingBar.setVisibility(View.VISIBLE);
         AlphaAnimation alpha = new AlphaAnimation(0.5F, 0.5F);
         alpha.setDuration(0); // Make animation instant.
         alpha.setFillAfter(true); // Persist after the animation ends.
         mImageview.startAnimation(alpha);
      } else { 
         mLoadingBar.setVisibility(View.GONE);
         mImageview.clearAnimation();
      } 
   } 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setAnimationListener, setDuration, setRepeatCount, setRepeatMode
     */ 
    protected void blink(final boolean hide, final int count) {
        AnimationSet blinkEffect = new AnimationSet(true);
        float start = getVisibility() == View.VISIBLE ? 1.0f : 0.0f;
        float end = getVisibility() == View.VISIBLE ? 0.0f : 1.0f;
        AlphaAnimation alpha = new AlphaAnimation(start, end);
        alpha.setDuration(BLINK_FADE_EFFECT_DURATION);
        alpha.setRepeatMode(Animation.REVERSE);
        alpha.setRepeatCount(count);
        alpha.setAnimationListener(new Animation.AnimationListener() {
            public void onAnimationStart(Animation animation) {/**NON BLOCK**/}
 
            public void onAnimationRepeat(Animation animation) {/**NON BLOCK**/}
 
            public void onAnimationEnd(Animation animation) {
                // Hide clock 
                if (hide) {
                    setVisibility(View.INVISIBLE);
                } 
            } 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setDuration
This code example shows how to use the following methods:setDuration, setFillAfter, setRepeatCount
		mCurrentStrip += 1;
		if(mCurrentStrip < mStrips.size()) {
			s = mStrips.get(mCurrentStrip);
			mStripProgress.setVisibility(View.VISIBLE);
			 
			Animation animation = new AlphaAnimation(1.0f, 0.0f);		
			animation.setDuration(500);
			animation.setRepeatCount(0);
			animation.setFillAfter(true);
					 
			mZoomImageView.startAnimation(animation);
			 
			fileUrl = s.getImg();
			new LoadPhotoBitmapThread().start();
		} 
		else { 
			Toast.makeText(getBaseContext(), "The End!", Toast.LENGTH_SHORT).show();
		} 
				 
	} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Android AlphaAnimation Questions & Answers:

See Code Examples for Android AlphaAnimation Methods: