Search in sources :

Example 16 with Animation

use of android.view.animation.Animation in project ArcMenu by daCapricorn.

the class RayMenu method getItemClickListener.

private OnClickListener getItemClickListener(final OnClickListener listener) {
    return new OnClickListener() {

        @Override
        public void onClick(final View viewClicked) {
            Animation animation = bindItemAnimation(viewClicked, true, 400);
            animation.setAnimationListener(new AnimationListener() {

                @Override
                public void onAnimationStart(Animation animation) {
                }

                @Override
                public void onAnimationRepeat(Animation animation) {
                }

                @Override
                public void onAnimationEnd(Animation animation) {
                    postDelayed(new Runnable() {

                        @Override
                        public void run() {
                            itemDidDisappear();
                        }
                    }, 0);
                }
            });
            final int itemCount = mRayLayout.getChildCount();
            for (int i = 0; i < itemCount; i++) {
                View item = mRayLayout.getChildAt(i);
                if (viewClicked != item) {
                    bindItemAnimation(item, false, 300);
                }
            }
            mRayLayout.invalidate();
            mHintView.startAnimation(createHintSwitchAnimation(true));
            if (listener != null) {
                listener.onClick(viewClicked);
            }
        }
    };
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) RotateAnimation(android.view.animation.RotateAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) AnimationListener(android.view.animation.Animation.AnimationListener) ImageView(android.widget.ImageView) View(android.view.View)

Example 17 with Animation

use of android.view.animation.Animation in project ArcMenu by daCapricorn.

the class RayMenu method bindItemAnimation.

private Animation bindItemAnimation(final View child, final boolean isClicked, final long duration) {
    Animation animation = createItemDisapperAnimation(duration, isClicked);
    child.setAnimation(animation);
    return animation;
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) RotateAnimation(android.view.animation.RotateAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation)

Example 18 with Animation

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

the class MaterialProgressDrawable method isRunning.

@Override
public boolean isRunning() {
    final ArrayList<Animation> animators = mAnimators;
    final int N = animators.size();
    for (int i = 0; i < N; i++) {
        final Animation animator = animators.get(i);
        if (animator.hasStarted() && !animator.hasEnded()) {
            return true;
        }
    }
    return false;
}
Also used : Animation(android.view.animation.Animation) Paint(android.graphics.Paint)

Example 19 with Animation

use of android.view.animation.Animation in project Libraries-for-Android-Developers by eoecn.

the class ActionBarSherlockCompat method hideProgressBars.

private void hideProgressBars(IcsProgressBar horizontalProgressBar, IcsProgressBar spinnyProgressBar) {
    //getLocalFeatures();
    final int features = mFeatures;
    Animation anim = AnimationUtils.loadAnimation(mActivity, android.R.anim.fade_out);
    anim.setDuration(1000);
    if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0 && spinnyProgressBar.getVisibility() == View.VISIBLE) {
        spinnyProgressBar.startAnimation(anim);
        spinnyProgressBar.setVisibility(View.INVISIBLE);
    }
    if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getVisibility() == View.VISIBLE) {
        horizontalProgressBar.startAnimation(anim);
        horizontalProgressBar.setVisibility(View.INVISIBLE);
    }
}
Also used : Animation(android.view.animation.Animation)

Example 20 with Animation

use of android.view.animation.Animation in project android-app by eoecn.

the class SplashActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    View view = View.inflate(this, R.layout.start_activity, null);
    setContentView(view);
    Animation animation = AnimationUtils.loadAnimation(this, R.anim.alpha);
    view.startAnimation(animation);
    animation.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation arg0) {
        }

        @Override
        public void onAnimationRepeat(Animation arg0) {
        }

        @Override
        public void onAnimationEnd(Animation arg0) {
            mHandler.postDelayed(new Runnable() {

                @Override
                public void run() {
                    goHome();
                }
            }, 500);
        }
    });
    UmengUpdateAgent.setUpdateOnlyWifi(false);
    UmengUpdateAgent.update(this);
}
Also used : Animation(android.view.animation.Animation) AnimationListener(android.view.animation.Animation.AnimationListener) View(android.view.View)

Aggregations

Animation (android.view.animation.Animation)611 AlphaAnimation (android.view.animation.AlphaAnimation)163 TranslateAnimation (android.view.animation.TranslateAnimation)124 ScaleAnimation (android.view.animation.ScaleAnimation)99 AnimationListener (android.view.animation.Animation.AnimationListener)80 AnimationSet (android.view.animation.AnimationSet)71 View (android.view.View)66 Transformation (android.view.animation.Transformation)62 RotateAnimation (android.view.animation.RotateAnimation)43 Point (android.graphics.Point)35 WindowAnimation_activityCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation)35 WindowAnimation_activityCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation)35 WindowAnimation_activityOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation)35 WindowAnimation_activityOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation)35 WindowAnimation_taskCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation)35 WindowAnimation_taskCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation)35 WindowAnimation_taskOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation)35 WindowAnimation_taskOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation)35 WindowAnimation_taskToBackEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation)35 WindowAnimation_taskToBackExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation)35