use of android.view.animation.AccelerateInterpolator in project JamsMusicPlayer by psaravan.
the class BrowserSubGridActivity method slideAwayHeader.
/**
*
*/
/**
* Slides away the header layout.
*/
private void slideAwayHeader() {
TranslateAnimation slideDown = new TranslateAnimation(mHeaderLayout, 400, new AccelerateInterpolator(2.0f), View.INVISIBLE, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -2.0f);
slideDown.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
mHeaderLayout.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animation animation) {
mHeaderLayout.setVisibility(View.INVISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
slideDown.animate();
}
use of android.view.animation.AccelerateInterpolator 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.AccelerateInterpolator 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);
}
use of android.view.animation.AccelerateInterpolator in project FlyRefresh by race604.
the class MainActivity method bounceAnimateView.
private void bounceAnimateView(View view) {
if (view == null) {
return;
}
Animator swing = ObjectAnimator.ofFloat(view, "rotationX", 0, 30, -20, 0);
swing.setDuration(400);
swing.setInterpolator(new AccelerateInterpolator());
swing.start();
}
use of android.view.animation.AccelerateInterpolator in project SmoothProgressBar by castorflex.
the class MakeCustomActivity method setInterpolator.
private void setInterpolator(int position) {
switch(position) {
case 1:
mCurrentInterpolator = new LinearInterpolator();
mSeekBarFactor.setEnabled(false);
break;
case 2:
mCurrentInterpolator = new AccelerateDecelerateInterpolator();
mSeekBarFactor.setEnabled(false);
break;
case 3:
mCurrentInterpolator = new DecelerateInterpolator(mFactor);
mSeekBarFactor.setEnabled(true);
break;
case 4:
mCurrentInterpolator = new FastOutSlowInInterpolator();
mSeekBarFactor.setEnabled(true);
break;
case 0:
default:
mCurrentInterpolator = new AccelerateInterpolator(mFactor);
mSeekBarFactor.setEnabled(true);
break;
}
mProgressBar.setSmoothProgressDrawableInterpolator(mCurrentInterpolator);
mProgressBar.setSmoothProgressDrawableColors(getResources().getIntArray(R.array.gplus_colors));
updateValues();
}
Aggregations