use of android.view.animation.AccelerateInterpolator in project Euclid by Yalantis.
the class EuclidActivity method createOpenProfileButtonAnimation.
/**
* This method, if needed, creates and setups animation of scaling button from 0 to 1.
*/
private void createOpenProfileButtonAnimation() {
if (mProfileButtonShowAnimation == null) {
mProfileButtonShowAnimation = AnimationUtils.loadAnimation(this, R.anim.profile_button_scale);
mProfileButtonShowAnimation.setDuration(getAnimationDurationShowProfileButton());
mProfileButtonShowAnimation.setInterpolator(new AccelerateInterpolator());
mProfileButtonShowAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
mButtonProfile.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
}
}
use of android.view.animation.AccelerateInterpolator in project StarWars.Android by Yalantis.
the class SideFragment method createCheckoutRevealAnimator.
protected Animator createCheckoutRevealAnimator(final ClipRevealFrame view, int x, int y, float startRadius, float endRadius) {
setMenuVisibility(false);
Animator retAnimator;
mRadius = endRadius;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
retAnimator = ViewAnimationUtils.createCircularReveal(view, x, y, startRadius, endRadius);
} else {
view.setClipOutLines(true);
view.setClipCenter(x, y);
view.setClipRadius(startRadius);
retAnimator = ObjectAnimator.ofFloat(view, "clipRadius", startRadius, endRadius);
}
retAnimator.setDuration(ANIM_DURATION);
retAnimator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
view.setClipOutLines(false);
removeOldSideFragment();
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
retAnimator.setInterpolator(new AccelerateInterpolator(2.0f));
return retAnimator;
}
use of android.view.animation.AccelerateInterpolator in project Side-Menu.Android by Yalantis.
the class MainActivity method replaceFragment.
private ScreenShotable replaceFragment(ScreenShotable screenShotable, int topPosition) {
this.res = this.res == R.drawable.content_music ? R.drawable.content_films : R.drawable.content_music;
View view = findViewById(R.id.content_frame);
int finalRadius = Math.max(view.getWidth(), view.getHeight());
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(view, 0, topPosition, 0, finalRadius);
animator.setInterpolator(new AccelerateInterpolator());
animator.setDuration(ViewAnimator.CIRCULAR_REVEAL_ANIMATION_DURATION);
findViewById(R.id.content_overlay).setBackgroundDrawable(new BitmapDrawable(getResources(), screenShotable.getBitmap()));
animator.start();
ContentFragment contentFragment = ContentFragment.newInstance(this.res);
getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, contentFragment).commit();
return contentFragment;
}
use of android.view.animation.AccelerateInterpolator in project Side-Menu.Android by Yalantis.
the class ViewAnimator method animateView.
private void animateView(int position) {
final View view = viewList.get(position);
view.setVisibility(View.VISIBLE);
FlipAnimation rotation = new FlipAnimation(90, 0, 0.0f, view.getHeight() / 2.0f);
rotation.setDuration(ANIMATION_DURATION);
rotation.setFillAfter(true);
rotation.setInterpolator(new AccelerateInterpolator());
rotation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
view.clearAnimation();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
view.startAnimation(rotation);
}
use of android.view.animation.AccelerateInterpolator in project Side-Menu.Android by Yalantis.
the class ViewAnimator method animateHideView.
private void animateHideView(final int position) {
final View view = viewList.get(position);
FlipAnimation rotation = new FlipAnimation(0, 90, 0.0f, view.getHeight() / 2.0f);
rotation.setDuration(ANIMATION_DURATION);
rotation.setFillAfter(true);
rotation.setInterpolator(new AccelerateInterpolator());
rotation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
view.clearAnimation();
view.setVisibility(View.INVISIBLE);
if (position == viewList.size() - 1) {
animatorListener.enableHomeButton();
drawerLayout.closeDrawers();
}
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
view.startAnimation(rotation);
}
Aggregations