Example usage for android.view.animation ScaleAnimation ScaleAnimation

List of usage examples for android.view.animation ScaleAnimation ScaleAnimation

Introduction

In this page you can find the example usage for android.view.animation ScaleAnimation ScaleAnimation.

Prototype

public ScaleAnimation(float fromX, float toX, float fromY, float toY, int pivotXType, float pivotXValue,
        int pivotYType, float pivotYValue) 

Source Link

Document

Constructor to use when building a ScaleAnimation from code

Usage

From source file:Main.java

public static ScaleAnimation exitScaleAnim(float toXscale, float toYscale) {
    return new ScaleAnimation(1.0f, toXscale, 1.0f, toYscale, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
}

From source file:Main.java

public static Animation getSmallerAnimation(int duration) {
    Animation animation = new ScaleAnimation(1.0f, 0f, 1.0f, 0f, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setDuration(duration);/*from   ww w .  ja va  2s  .  c o  m*/
    animation.setFillAfter(true);
    return animation;
}

From source file:Main.java

public static void btnScaleSelf(View view) {
    ScaleAnimation sa = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5F,
            Animation.RELATIVE_TO_SELF, 0.5F);
    sa.setDuration(1000);//from   www  .  ja va  2s  . c o m
    view.startAnimation(sa);
}

From source file:Main.java

public static void toBigAnim2(View view) {
    ScaleAnimation animation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.0f);
    animation.setDuration(1000);/*w ww. j a v  a  2 s.  c  o  m*/
    animation.setFillAfter(false);
    view.setAnimation(animation);
    animation.start();
}

From source file:Main.java

public static Animation zoomAnimation(float startScale, float endScale, long duration) {
    ScaleAnimation anim = new ScaleAnimation(startScale, endScale, startScale, endScale,
            Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    anim.setFillAfter(true);/*from   ww w  . j a va2 s  .c  o  m*/
    anim.setDuration(duration);
    return anim;
}

From source file:Main.java

public static void gridSelectionAnimation(View viewToAnimate) {
    ScaleAnimation animation = new ScaleAnimation(1.0f, 0.95f, 1.0f, 0.95f, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setDuration(50);//from www . jav a 2 s . co m
    viewToAnimate.startAnimation(animation);
}

From source file:Main.java

public static ScaleAnimation getScaleAnimation(float start, float end, int duration) {
    ScaleAnimation scaleAnimation = new ScaleAnimation(start, end, start, end, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    scaleAnimation.setDuration(duration);
    scaleAnimation.setFillAfter(true);/*from  ww w .  j a v a2s .co  m*/
    return scaleAnimation;
}

From source file:Main.java

public static Animation getScaleAnimation(float fromX, float toX, float fromY, float toY, long duration) {
    Animation alpha = new ScaleAnimation(fromX, toX, fromY, toY, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    alpha.setDuration(duration);//from  w w  w.  ja va  2  s.c om
    alpha.setFillAfter(true);
    return alpha;
}

From source file:Main.java

public static Animation getScaleAnimation_see_all() {
    Animation animation = new ScaleAnimation(1.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0f,
            Animation.RELATIVE_TO_SELF, 0f);
    animation.setInterpolator(new DecelerateInterpolator());
    animation.setDuration(200);//  w w  w . j  ava  2  s  . com
    return animation;
}

From source file:Main.java

public static Animation createScaleAnimation(float fromXScale, float toXScale, float fromYScale, float toYScale,
        long duration) {
    ScaleAnimation anim = new ScaleAnimation(fromXScale, toXScale, fromYScale, toYScale,
            Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    anim.setFillAfter(true);//from  ww  w  .  ja v a 2  s.  com
    anim.setInterpolator(new AccelerateInterpolator());
    anim.setDuration(duration);
    return anim;
}