Search in sources :

Example 1 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project UltimateAndroid by cymcsg.

the class TileManager method renderIndividualTile.

// package level access so it can be invoked by the render task
void renderIndividualTile(Tile tile) {
    // if it's already rendered, quit now
    if (alreadyRendered.contains(tile)) {
        return;
    }
    // create the image view if needed, with default settings
    tile.render(getContext());
    // add it to the list of those rendered
    alreadyRendered.add(tile);
    // get reference to the actual image view
    ImageView imageView = tile.getImageView();
    // get layout params from the tile's predefined dimensions
    LayoutParams layoutParams = getLayoutFromTile(tile);
    // add it to the appropriate set (which is already scaled)
    currentTileGroup.addView(imageView, layoutParams);
    // shouldn't be necessary, but is
    postInvalidate();
    // do we want to animate in tiles?
    if (transitionsEnabled) {
        // do we have an appropriate duration?
        if (transitionDuration > 0) {
            // create the animation (will be cleared by tile.destroy).  do this here for the postInvalidate listener
            AlphaAnimation fadeIn = new AlphaAnimation(0f, 1f);
            // set duration
            fadeIn.setDuration(transitionDuration);
            // this listener posts invalidate on complete, again should not be necessary but is
            fadeIn.setAnimationListener(transitionListener);
            // start it up
            imageView.startAnimation(fadeIn);
        }
    }
}
Also used : ImageView(android.widget.ImageView) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 2 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project cw-omnibus by commonsguy.

the class IcsProgressBar method startAnimation.

/**
     * <p>Start the indeterminate progress animation.</p>
     */
void startAnimation() {
    if (getVisibility() != VISIBLE) {
        return;
    }
    if (mIndeterminateDrawable instanceof Animatable) {
        mShouldStartAnimationDrawable = true;
        mAnimation = null;
    } else {
        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();
}
Also used : Transformation(android.view.animation.Transformation) LinearInterpolator(android.view.animation.LinearInterpolator) Animatable(android.graphics.drawable.Animatable) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 3 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project baseAdapter by hongyangAndroid.

the class ViewHolder method setAlpha.

@SuppressLint("NewApi")
public ViewHolder setAlpha(int viewId, float value) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        getView(viewId).setAlpha(value);
    } else {
        // Pre-honeycomb hack to set Alpha value
        AlphaAnimation alpha = new AlphaAnimation(value, value);
        alpha.setDuration(0);
        alpha.setFillAfter(true);
        getView(viewId).startAnimation(alpha);
    }
    return this;
}
Also used : AlphaAnimation(android.view.animation.AlphaAnimation) SuppressLint(android.annotation.SuppressLint)

Example 4 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project nmid-headline by miao1007.

the class Animations method FadeOut.

public static Animation FadeOut() {
    Animation anim = new AlphaAnimation(1, 0);
    anim.setInterpolator(new DecelerateInterpolator());
    anim.setDuration(500);
    return anim;
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 5 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project nmid-headline by miao1007.

the class Animations method FadeIn.

public static Animation FadeIn() {
    Animation anim = new AlphaAnimation(0, 1);
    anim.setInterpolator(new DecelerateInterpolator());
    anim.setDuration(500);
    return anim;
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) AlphaAnimation(android.view.animation.AlphaAnimation)

Aggregations

AlphaAnimation (android.view.animation.AlphaAnimation)355 Animation (android.view.animation.Animation)154 AnimationSet (android.view.animation.AnimationSet)105 TranslateAnimation (android.view.animation.TranslateAnimation)105 ScaleAnimation (android.view.animation.ScaleAnimation)65 View (android.view.View)33 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)33 LinearInterpolator (android.view.animation.LinearInterpolator)28 WindowAnimation_activityCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation)26 WindowAnimation_activityCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation)26 WindowAnimation_activityOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation)26 WindowAnimation_activityOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation)26 WindowAnimation_taskCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation)26 WindowAnimation_taskCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation)26 WindowAnimation_taskOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation)26 WindowAnimation_taskOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation)26 WindowAnimation_taskToBackEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation)26 WindowAnimation_taskToBackExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation)26 WindowAnimation_taskToFrontEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation)26 WindowAnimation_taskToFrontExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation)26