Search in sources :

Example 11 with ScaleAnimation

use of android.view.animation.ScaleAnimation in project Klyph by jonathangerbaud.

the class AnimationHelper method createHeightOutAnimation.

/**
	 * @return A fade out animation from 100% - 0% taking half a second
	 */
public static Animation createHeightOutAnimation() {
    Animation heightOut = new ScaleAnimation(SCALE_1, SCALE_1, SCALE_1, SCALE_0);
    heightOut.setDuration(ANIMATION_LENGTH);
    return heightOut;
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 12 with ScaleAnimation

use of android.view.animation.ScaleAnimation in project mobile-android by photo.

the class BordersPanel method onLoadComplete.

@SuppressWarnings("deprecation")
@Override
public void onLoadComplete(final ImageView view, Bitmap bitmap, int tag) {
    if (!isActive())
        return;
    View parent = (View) view.getParent();
    if (null != bitmap) {
        view.setImageDrawable(new BitmapDrawable(bitmap));
    } else {
        view.setImageResource(R.drawable.feather_iap_dialog_image_na);
    }
    if (parent != null && parent.findViewById(R.id.progress) != null) {
        parent.findViewById(R.id.progress).setVisibility(View.GONE);
    }
    if (!mEnableEffectAnimation) {
        view.setVisibility(View.VISIBLE);
        return;
    }
    if (null != view && parent != null) {
        if (mHList.getScrollX() == 0) {
            if (parent.getLeft() < mHList.getRight()) {
                ScaleAnimation anim = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, (float) 0.5, Animation.RELATIVE_TO_SELF, (float) 0.5);
                anim.setAnimationListener(new AnimationListener() {

                    @Override
                    public void onAnimationStart(Animation animation) {
                        view.setVisibility(View.VISIBLE);
                    }

                    @Override
                    public void onAnimationRepeat(Animation animation) {
                    }

                    @Override
                    public void onAnimationEnd(Animation animation) {
                    }
                });
                anim.setDuration(100);
                anim.setStartOffset(mHList.getScreenPositionForView(view) * 100);
                view.startAnimation(anim);
                view.setVisibility(View.INVISIBLE);
                return;
            }
        }
        view.setVisibility(View.VISIBLE);
    }
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) Animation(android.view.animation.Animation) BitmapDrawable(android.graphics.drawable.BitmapDrawable) FakeBitmapDrawable(com.aviary.android.feather.library.graphics.drawable.FakeBitmapDrawable) AnimationListener(android.view.animation.Animation.AnimationListener) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) HorizontalVariableListView(com.aviary.android.feather.widget.HorizontalVariableListView) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 13 with ScaleAnimation

use of android.view.animation.ScaleAnimation in project Android2048GameLesson by plter.

the class AnimLayer method createScaleTo1.

public void createScaleTo1(Card target) {
    ScaleAnimation sa = new ScaleAnimation(0.1f, 1, 0.1f, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    sa.setDuration(100);
    target.setAnimation(null);
    target.getLabel().startAnimation(sa);
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation)

Example 14 with ScaleAnimation

use of android.view.animation.ScaleAnimation in project JamsMusicPlayer by psaravan.

the class QueueDrawerFragment method animatePauseToPlay.

/**
     * Animates the pause button to a play button.
     */
private void animatePauseToPlay() {
    //Check to make sure the current icon is the pause icon.
    if (mPlayPauseButton.getId() != R.drawable.pause_light)
        return;
    //Scale out the pause button.
    final ScaleAnimation scaleOut = new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f, mPlayPauseButton.getWidth() / 2, mPlayPauseButton.getHeight() / 2);
    scaleOut.setDuration(150);
    scaleOut.setInterpolator(new AccelerateInterpolator());
    //Scale in the play button.
    final ScaleAnimation scaleIn = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, mPlayPauseButton.getWidth() / 2, mPlayPauseButton.getHeight() / 2);
    scaleIn.setDuration(150);
    scaleIn.setInterpolator(new DecelerateInterpolator());
    scaleOut.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            mPlayPauseButton.setImageResource(R.drawable.play_light);
            mPlayPauseButton.setPadding(0, 0, -5, 0);
            mPlayPauseButton.startAnimation(scaleIn);
        }

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

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            mPlayPauseButton.setScaleX(1.0f);
            mPlayPauseButton.setScaleY(1.0f);
            mPlayPauseButton.setId(R.drawable.play_light);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    mPlayPauseButton.startAnimation(scaleOut);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ScaleAnimation(android.view.animation.ScaleAnimation) Animation(android.view.animation.Animation) ScaleAnimation(android.view.animation.ScaleAnimation)

Example 15 with ScaleAnimation

use of android.view.animation.ScaleAnimation in project JamsMusicPlayer by psaravan.

the class QueueDrawerFragment method animatePlayToPause.

/**
     * Animates the play button to a pause button.
     */
private void animatePlayToPause() {
    //Check to make sure the current icon is the play icon.
    if (mPlayPauseButton.getId() != R.drawable.play_light)
        return;
    //Fade out the play button.
    final ScaleAnimation scaleOut = new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f, mPlayPauseButton.getWidth() / 2, mPlayPauseButton.getHeight() / 2);
    scaleOut.setDuration(150);
    scaleOut.setInterpolator(new AccelerateInterpolator());
    //Scale in the pause button.
    final ScaleAnimation scaleIn = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, mPlayPauseButton.getWidth() / 2, mPlayPauseButton.getHeight() / 2);
    scaleIn.setDuration(150);
    scaleIn.setInterpolator(new DecelerateInterpolator());
    scaleOut.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            mPlayPauseButton.setImageResource(R.drawable.pause_light);
            mPlayPauseButton.setPadding(0, 0, 0, 0);
            mPlayPauseButton.startAnimation(scaleIn);
        }

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

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            mPlayPauseButton.setScaleX(1.0f);
            mPlayPauseButton.setScaleY(1.0f);
            mPlayPauseButton.setId(R.drawable.pause_light);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    mPlayPauseButton.startAnimation(scaleOut);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ScaleAnimation(android.view.animation.ScaleAnimation) Animation(android.view.animation.Animation) ScaleAnimation(android.view.animation.ScaleAnimation)

Aggregations

ScaleAnimation (android.view.animation.ScaleAnimation)114 AnimationSet (android.view.animation.AnimationSet)60 AlphaAnimation (android.view.animation.AlphaAnimation)56 Animation (android.view.animation.Animation)50 TranslateAnimation (android.view.animation.TranslateAnimation)40 ClipRectAnimation (android.view.animation.ClipRectAnimation)28 CurvedTranslateAnimation (com.android.server.wm.animation.CurvedTranslateAnimation)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 WindowAnimation_wallpaperCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation)26