use of android.view.animation.ScaleAnimation in project Tapad by berict.
the class AnimateHelper method scaleInOverShoot.
public void scaleInOverShoot(final int view_id, final int delay, final long duration, String handlerName, final Activity activity) {
final ScaleAnimation scaleInOverShoot = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scaleInOverShoot.setInterpolator(new OvershootInterpolator());
Map<String, Handler> handlerCreator = new HashMap<>();
handlerCreator.put(handlerName, new Handler());
handlerCreator.get(handlerName).postDelayed(new Runnable() {
@Override
public void run() {
View view = activity.findViewById(view_id);
scaleInOverShoot.setDuration(duration);
view.startAnimation(scaleInOverShoot);
view.setVisibility(View.VISIBLE);
Log.i("AnimateHelper", "scale IN OVERSHOOT effect for " + String.valueOf(duration) + "ms with " + String.valueOf(delay) + "ms delay");
}
}, delay);
}
use of android.view.animation.ScaleAnimation in project Tapad by berict.
the class AnimateHelper method scaleIn.
public void scaleIn(final View view, final int delay, final long duration, String handlerName) {
final ScaleAnimation scaleIn = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
view.setVisibility(View.INVISIBLE);
scaleIn.setInterpolator(new AccelerateDecelerateInterpolator());
if (delay > 0) {
Map<String, Handler> handlerCreator = new HashMap<>();
handlerCreator.put(handlerName, new Handler());
handlerCreator.get(handlerName).postDelayed(new Runnable() {
@Override
public void run() {
scaleIn.setDuration(duration);
view.startAnimation(scaleIn);
view.setVisibility(View.VISIBLE);
Log.i("AnimateHelper", "scale IN effect for " + String.valueOf(duration) + "ms with " + String.valueOf(delay) + "ms delay");
}
}, delay);
} else {
scaleIn.setDuration(duration);
view.startAnimation(scaleIn);
view.setVisibility(View.VISIBLE);
Log.i("AnimateHelper", "scale IN effect for " + String.valueOf(duration) + "ms with " + String.valueOf(delay) + "ms delay");
}
}
use of android.view.animation.ScaleAnimation in project Tapad by berict.
the class AnimateHelper method scaleIn.
public void scaleIn(final View view, int touchX, int touchY, final int delay, final long duration, String handlerName, Activity activity) {
float x = touchX / window.getWindowWidthPx(activity);
float y = touchY / window.getWindowHeightPx(activity);
final ScaleAnimation scaleOut = new ScaleAnimation(0, 1, 0, 1, Animation.ABSOLUTE, x, Animation.ABSOLUTE, y);
scaleOut.setInterpolator(new AccelerateDecelerateInterpolator());
Map<String, Handler> handlerCreator = new HashMap<>();
handlerCreator.put(handlerName, new Handler());
handlerCreator.get(handlerName).postDelayed(new Runnable() {
@Override
public void run() {
view.setVisibility(View.VISIBLE);
scaleOut.setDuration(duration);
view.startAnimation(scaleOut);
Log.i("AnimateHelper", "scale IN effect for " + String.valueOf(duration) + "ms with " + String.valueOf(delay) + "ms delay");
}
}, delay);
handlerCreator.get(handlerName).postDelayed(new Runnable() {
@Override
public void run() {
view.setVisibility(View.GONE);
}
}, delay + 10);
}
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;
}
use of android.view.animation.ScaleAnimation in project GwellDemo by dxsdyhm.
the class ScreenShotImageView method AnimalStar.
private void AnimalStar() {
final AlphaAnimation alphaAnimation = new AlphaAnimation(0.1f, 1.0f);
alphaAnimation.setDuration(100);
final ScaleAnimation animation = new ScaleAnimation(1.0f, 0.3f, 1.0f, 0.3f, Animation.RELATIVE_TO_SELF, 0.1f, Animation.RELATIVE_TO_SELF, 0.9f);
animation.setDuration(800);
animation.setFillAfter(true);
AnimationSet set = new AnimationSet(false);
set.setFillAfter(true);
set.addAnimation(alphaAnimation);
set.addAnimation(animation);
this.setAnimation(set);
set.start();
set.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
setColorFilter(Color.WHITE);
}
@Override
public void onAnimationEnd(Animation animation) {
if (removeHandler != null) {
removeHandler.sendEmptyMessageDelayed(0, DeleteTime);
}
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
}
Aggregations