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 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);
}
}
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);
}
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);
}
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);
}
Aggregations