Search in sources :

Example 16 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project android_frameworks_base by ResurrectionRemix.

the class DragState method createReturnAnimationLocked.

private Animation createReturnAnimationLocked() {
    final AnimationSet set = new AnimationSet(false);
    set.addAnimation(new TranslateAnimation(0, mOriginalX - mCurrentX, 0, mOriginalY - mCurrentY));
    set.addAnimation(new AlphaAnimation(mOriginalAlpha, mOriginalAlpha / 2));
    set.setDuration(ANIMATION_DURATION_MS);
    set.setInterpolator(mCubicEaseOutInterpolator);
    set.initialize(0, 0, 0, 0);
    // Will start on the first call to getTransformation.
    set.start();
    return set;
}
Also used : TranslateAnimation(android.view.animation.TranslateAnimation) AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 17 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project android_frameworks_base by ResurrectionRemix.

the class DragState method createCancelAnimationLocked.

private Animation createCancelAnimationLocked() {
    final AnimationSet set = new AnimationSet(false);
    set.addAnimation(new ScaleAnimation(1, 0, 1, 0, mThumbOffsetX, mThumbOffsetY));
    set.addAnimation(new AlphaAnimation(mOriginalAlpha, 0));
    set.setDuration(ANIMATION_DURATION_MS);
    set.setInterpolator(mCubicEaseOutInterpolator);
    set.initialize(0, 0, 0, 0);
    // Will start on the first call to getTransformation.
    set.start();
    return set;
}
Also used : AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 18 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project android_frameworks_base by ResurrectionRemix.

the class ProgressBar method startAnimation.

/**
     * <p>Start the indeterminate progress animation.</p>
     */
void startAnimation() {
    if (getVisibility() != VISIBLE || getWindowVisibility() != VISIBLE) {
        return;
    }
    if (mIndeterminateDrawable instanceof Animatable) {
        mShouldStartAnimationDrawable = true;
        mHasAnimation = false;
    } else {
        mHasAnimation = true;
        if (mInterpolator == null) {
            mInterpolator = new LinearInterpolator();
        }
        if (mTransformation == null) {
            mTransformation = new Transformation();
        } else {
            mTransformation.clear();
        }
        if (mAnimation == null) {
            mAnimation = new AlphaAnimation(0.0f, 1.0f);
        } else {
            mAnimation.reset();
        }
        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 19 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project AprilBeacon-Android-SDK by AprilBrother.

the class NotifyInContentActivity method setAnimtionStart.

private void setAnimtionStart() {
    ImageView iv = (ImageView) findViewById(R.id.iv_notify_content_in);
    AlphaAnimation alphaAnimation = new AlphaAnimation(0.1f, 1.0f);
    alphaAnimation.setDuration(3000);
    iv.startAnimation(alphaAnimation);
}
Also used : ImageView(android.widget.ImageView) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 20 with AlphaAnimation

use of android.view.animation.AlphaAnimation in project BaseRecyclerViewAdapterHelper by CymChad.

the class BaseViewHolder method setAlpha.

/**
     * Add an action to set the alpha of a view. Can be called multiple times.
     * Alpha between 0-1.
     */
public BaseViewHolder 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)

Aggregations

AlphaAnimation (android.view.animation.AlphaAnimation)349 Animation (android.view.animation.Animation)152 TranslateAnimation (android.view.animation.TranslateAnimation)102 AnimationSet (android.view.animation.AnimationSet)101 ScaleAnimation (android.view.animation.ScaleAnimation)65 View (android.view.View)33 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)30 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