Search in sources :

Example 6 with AnimationSet

use of android.view.animation.AnimationSet in project storymaker by StoryMaker.

the class DraggableGridView method animateDragged.

//EVENT HELPERS
protected void animateDragged() {
    View v = getChildAt(dragged);
    int x = getCoorFromIndex(dragged).x + childSize / 2, y = getCoorFromIndex(dragged).y + childSize / 2;
    int l = x - (3 * childSize / 4), t = y - (3 * childSize / 4);
    v.layout(l, t, l + (childSize * 3 / 2), t + (childSize * 3 / 2));
    AnimationSet animSet = new AnimationSet(true);
    ScaleAnimation scale = new ScaleAnimation(.667f, 1, .667f, 1, childSize * 3 / 4, childSize * 3 / 4);
    scale.setDuration(animT);
    AlphaAnimation alpha = new AlphaAnimation(1, .5f);
    alpha.setDuration(animT);
    animSet.addAnimation(scale);
    animSet.addAnimation(alpha);
    animSet.setFillEnabled(true);
    animSet.setFillAfter(true);
    v.clearAnimation();
    v.startAnimation(animSet);
}
Also used : ImageView(android.widget.ImageView) View(android.view.View) AnimationSet(android.view.animation.AnimationSet) Point(android.graphics.Point) AlphaAnimation(android.view.animation.AlphaAnimation) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 7 with AnimationSet

use of android.view.animation.AnimationSet in project Signal-Android by WhisperSystems.

the class HidingLinearLayout method show.

public void show() {
    if (!isEnabled() || getVisibility() == VISIBLE)
        return;
    setVisibility(VISIBLE);
    AnimationSet animation = new AnimationSet(true);
    animation.addAnimation(new ScaleAnimation(0, 1, 1, 1, Animation.RELATIVE_TO_SELF, 1f, Animation.RELATIVE_TO_SELF, 0.5f));
    animation.addAnimation(new AlphaAnimation(0, 1));
    animation.setDuration(100);
    animateWith(animation);
}
Also used : AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 8 with AnimationSet

use of android.view.animation.AnimationSet in project Signal-Android by WhisperSystems.

the class AttachmentTypeSelector method animateButtonIn.

private void animateButtonIn(View button, int delay) {
    AnimationSet animation = new AnimationSet(true);
    Animation scale = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.0f);
    animation.addAnimation(scale);
    animation.setInterpolator(new OvershootInterpolator(1));
    animation.setDuration(ANIMATION_DURATION);
    animation.setStartOffset(delay);
    button.startAnimation(animation);
}
Also used : OvershootInterpolator(android.view.animation.OvershootInterpolator) ScaleAnimation(android.view.animation.ScaleAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) Animation(android.view.animation.Animation) AnimationSet(android.view.animation.AnimationSet) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 9 with AnimationSet

use of android.view.animation.AnimationSet in project SnackBar by MrEngineer13.

the class SnackContainer method init.

private void init() {
    mInAnimationSet = new AnimationSet(false);
    TranslateAnimation mSlideInAnimation = new TranslateAnimation(TranslateAnimation.RELATIVE_TO_PARENT, 0.0f, TranslateAnimation.RELATIVE_TO_PARENT, 0.0f, TranslateAnimation.RELATIVE_TO_SELF, 1.0f, TranslateAnimation.RELATIVE_TO_SELF, 0.0f);
    AlphaAnimation mFadeInAnimation = new AlphaAnimation(0.0f, 1.0f);
    mInAnimationSet.addAnimation(mSlideInAnimation);
    mInAnimationSet.addAnimation(mFadeInAnimation);
    mOutAnimationSet = new AnimationSet(false);
    TranslateAnimation mSlideOutAnimation = new TranslateAnimation(TranslateAnimation.RELATIVE_TO_PARENT, 0.0f, TranslateAnimation.RELATIVE_TO_PARENT, 0.0f, TranslateAnimation.RELATIVE_TO_SELF, 0.0f, TranslateAnimation.RELATIVE_TO_SELF, 1.0f);
    AlphaAnimation mFadeOutAnimation = new AlphaAnimation(1.0f, 0.0f);
    mOutAnimationSet.addAnimation(mSlideOutAnimation);
    mOutAnimationSet.addAnimation(mFadeOutAnimation);
    mOutAnimationSet.setDuration(ANIMATION_DURATION);
    mOutAnimationSet.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            removeAllViews();
            if (!mSnacks.isEmpty()) {
                sendOnHide(mSnacks.poll());
            }
            if (!isEmpty()) {
                showSnack(mSnacks.peek());
            } else {
                setVisibility(View.GONE);
            }
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
}
Also used : TranslateAnimation(android.view.animation.TranslateAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) AnimationSet(android.view.animation.AnimationSet) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 10 with AnimationSet

use of android.view.animation.AnimationSet in project pull-to-make-soup by Yalantis.

the class SoupRefreshView method start.

@Override
public void start() {
    mBounceAnimation.reset();
    mScaleAnimation.reset();
    mFlameScaleAnimation.reset();
    mFlameBurnAnimation.reset();
    mBubble1Animation.reset();
    mCoverAnimation.reset();
    isRefreshing = true;
    final AnimationSet animatorSet = new AnimationSet(false);
    animatorSet.addAnimation(mFlameBurnAnimation);
    animatorSet.addAnimation(mBubble1Animation);
    animatorSet.addAnimation(mBubble2Animation);
    animatorSet.addAnimation(mBubble3Animation);
    animatorSet.addAnimation(mBubble4Animation);
    animatorSet.addAnimation(mBubble5Animation);
    animatorSet.addAnimation(mBubble6Animation);
    animatorSet.addAnimation(mCoverAnimation);
    mParent.startAnimation(mBounceAnimation);
    mBounceAnimation.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            mParent.startAnimation(mScaleAnimation);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    mScaleAnimation.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            isShadowDisplayed = true;
            mParent.startAnimation(mFlameScaleAnimation);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    mFlameScaleAnimation.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            mParent.startAnimation(animatorSet);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
}
Also used : Animation(android.view.animation.Animation) AnimationSet(android.view.animation.AnimationSet)

Aggregations

AnimationSet (android.view.animation.AnimationSet)117 AlphaAnimation (android.view.animation.AlphaAnimation)85 TranslateAnimation (android.view.animation.TranslateAnimation)75 Animation (android.view.animation.Animation)71 ScaleAnimation (android.view.animation.ScaleAnimation)69 ClipRectAnimation (android.view.animation.ClipRectAnimation)32 CurvedTranslateAnimation (com.android.server.wm.animation.CurvedTranslateAnimation)32 WindowAnimation_activityCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation)30 WindowAnimation_activityCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation)30 WindowAnimation_activityOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation)30 WindowAnimation_activityOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation)30 WindowAnimation_taskCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation)30 WindowAnimation_taskCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation)30 WindowAnimation_taskOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation)30 WindowAnimation_taskOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation)30 WindowAnimation_taskToBackEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation)30 WindowAnimation_taskToBackExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation)30 WindowAnimation_taskToFrontEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation)30 WindowAnimation_taskToFrontExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation)30 WindowAnimation_wallpaperCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation)30