Example usage for android.view.animation OvershootInterpolator OvershootInterpolator

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

Introduction

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

Prototype

public OvershootInterpolator(float tension) 

Source Link

Usage

From source file:com.commonsware.cwac.cam2.support.CameraFragment.java

private void changeMenuIconAnimation(final FloatingActionMenu menu) {
    AnimatorSet set = new AnimatorSet();
    final ImageView v = menu.getMenuIconView();
    ObjectAnimator scaleOutX = ObjectAnimator.ofFloat(v, "scaleX", 1.0f, 0.2f);
    ObjectAnimator scaleOutY = ObjectAnimator.ofFloat(v, "scaleY", 1.0f, 0.2f);
    ObjectAnimator scaleInX = ObjectAnimator.ofFloat(v, "scaleX", 0.2f, 1.0f);
    ObjectAnimator scaleInY = ObjectAnimator.ofFloat(v, "scaleY", 0.2f, 1.0f);

    scaleOutX.setDuration(50);//from  w  w  w  .ja v a2 s.  com
    scaleOutY.setDuration(50);

    scaleInX.setDuration(150);
    scaleInY.setDuration(150);
    scaleInX.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationStart(Animator animation) {
            v.setImageResource(
                    menu.isOpened() ? R.drawable.cwac_cam2_ic_close : R.drawable.cwac_cam2_ic_action_settings);
        }
    });

    set.play(scaleOutX).with(scaleOutY);
    set.play(scaleInX).with(scaleInY).after(scaleOutX);
    set.setInterpolator(new OvershootInterpolator(2));
    menu.setIconToggleAnimatorSet(set);
}

From source file:app.hanks.com.conquer.activity.MainActivity.java

private void startContentAnimation() {
    addButtom.animate().translationY(0).setInterpolator(new OvershootInterpolator(1.f)).setStartDelay(300)
            .setDuration(400).start();//from w  w w.  j a va 2  s  .  co m
    changeFramgnt(R.id.layout_content, currentFragment);
}

From source file:com.wanderingcan.floatingactionmenu.FloatingActionMenu.java

private void initDefaultIconAnimation() {

    mExpandAnimation.play(/*from  w  ww.ja v a 2s  .co  m*/
            ObjectAnimator.ofFloat(mMenuButton, "rotation", COLLAPSED_PLUS_ROTATION, EXPANDED_PLUS_ROTATION));

    mCollapseAnimation.play(
            ObjectAnimator.ofFloat(mMenuButton, "rotation", EXPANDED_PLUS_ROTATION, COLLAPSED_PLUS_ROTATION));
    mExpandAnimation.setInterpolator(new OvershootInterpolator(5f));
    mCollapseAnimation.setInterpolator(new OvershootInterpolator(5f));
    mExpandAnimation.setDuration(mAnimationDuration);
    mCollapseAnimation.setDuration(mAnimationDuration);
}

From source file:io.digibyte.tools.animation.BRAnimator.java

public static LayoutTransition getDefaultTransition() {
    LayoutTransition itemLayoutTransition = new LayoutTransition();
    itemLayoutTransition.setStartDelay(LayoutTransition.APPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.DISAPPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGE_APPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGE_DISAPPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGING, 0);
    itemLayoutTransition.setDuration(100);
    itemLayoutTransition.setInterpolator(LayoutTransition.CHANGING, new OvershootInterpolator(2f));
    Animator scaleUp = ObjectAnimator.ofPropertyValuesHolder((Object) null,
            PropertyValuesHolder.ofFloat(View.SCALE_X, 1, 1), PropertyValuesHolder.ofFloat(View.SCALE_Y, 0, 1));
    scaleUp.setDuration(50);/*  www.  j  a va 2s. com*/
    scaleUp.setStartDelay(50);
    Animator scaleDown = ObjectAnimator.ofPropertyValuesHolder((Object) null,
            PropertyValuesHolder.ofFloat(View.SCALE_X, 1, 1), PropertyValuesHolder.ofFloat(View.SCALE_Y, 1, 0));
    scaleDown.setDuration(2);
    itemLayoutTransition.setAnimator(LayoutTransition.APPEARING, scaleUp);
    itemLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
    itemLayoutTransition.enableTransitionType(LayoutTransition.CHANGING);
    return itemLayoutTransition;
}

From source file:org.sufficientlysecure.keychain.ui.ViewKeyAdvActivity.java

private void animateMenuItem(final MenuItem vEditSubkeys, final boolean animateShow) {

    View actionView = LayoutInflater.from(this).inflate(R.layout.edit_icon, null);
    vEditSubkeys.setActionView(actionView);
    actionView.setTranslationX(animateShow ? 150 : 0);

    ViewPropertyAnimator animator = actionView.animate();
    animator.translationX(animateShow ? 0 : 150);
    animator.setDuration(300);/*from w w  w . j a v a 2 s  . c  o m*/
    animator.setInterpolator(new OvershootInterpolator(1.5f));
    animator.setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            if (!animateShow) {
                vEditSubkeys.setVisible(false);
            }
            vEditSubkeys.setActionView(null);
        }
    });
    animator.start();

}

From source file:support.plus.reportit.MainActivity.java

private void createCustomAnimation() {
    final FloatingActionMenu menu3 = (FloatingActionMenu) findViewById(R.id.menuShare);

    AnimatorSet set = new AnimatorSet();

    ObjectAnimator scaleOutX = ObjectAnimator.ofFloat(menu3.getMenuIconView(), "scaleX", 1.0f, 0.2f);
    ObjectAnimator scaleOutY = ObjectAnimator.ofFloat(menu3.getMenuIconView(), "scaleY", 1.0f, 0.2f);

    ObjectAnimator scaleInX = ObjectAnimator.ofFloat(menu3.getMenuIconView(), "scaleX", 0.2f, 1.0f);
    ObjectAnimator scaleInY = ObjectAnimator.ofFloat(menu3.getMenuIconView(), "scaleY", 0.2f, 1.0f);

    scaleOutX.setDuration(50);/* ww w .j a v a 2 s. co m*/
    scaleOutY.setDuration(50);

    scaleInX.setDuration(150);
    scaleInY.setDuration(150);

    scaleInX.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationStart(Animator animation) {
            menu3.getMenuIconView().setImageResource(
                    menu3.isOpened() ? R.drawable.ic_share_white_24dp : R.drawable.ic_done_white_24dp);
        }
    });

    set.play(scaleOutX).with(scaleOutY);
    set.play(scaleInX).with(scaleInY).after(scaleOutX);
    set.setInterpolator(new OvershootInterpolator(2));

    menu3.setIconToggleAnimatorSet(set);
}

From source file:lemonlabs.android.expandablebuttonmenu.ExpandableButtonMenu.java

/**
 * Initialized animation properties//from  w w  w  .  j  a v a  2  s  .c o  m
 */
private void calculateAnimationProportions() {
    TRANSLATION_Y = sHeight * buttonDistanceY;
    TRANSLATION_X = sWidth * buttonDistanceX;

    anticipation = new AnticipateInterpolator(INTERPOLATOR_WEIGHT);
    overshoot = new OvershootInterpolator(INTERPOLATOR_WEIGHT);
}

From source file:jahirfiquitiva.iconshowcase.activities.AltWallpaperViewerActivity.java

private void openMenu() {
    fab.animate().rotation(45.0f).withLayer().setDuration(300).setInterpolator(new OvershootInterpolator(10.0F))
            .start();//from w  ww . j  av  a  2s.com
    showFab(applyFab);
    showFab(saveFab);
    showFab(infoFab);
}

From source file:jahirfiquitiva.iconshowcase.activities.AltWallpaperViewerActivity.java

private void closeMenu() {
    hideFab(infoFab);/*from  ww w  . ja  v a2s  .co  m*/
    hideFab(saveFab);
    hideFab(applyFab);
    fab.animate().rotation(0.0f).withLayer().setDuration(300).setInterpolator(new OvershootInterpolator(10.0F))
            .start();
}

From source file:jahirfiquitiva.iconshowcase.activities.AltWallpaperViewerActivity.java

private void reshowFab(FloatingActionButton fab) {
    if (fab != null) {
        fab.show(new FloatingActionButton.OnVisibilityChangedListener() {
            @Override/*from  w w  w.  j a  v  a  2  s .  com*/
            public void onShown(FloatingActionButton fab) {
                super.onShown(fab);
                fab.animate().rotation(0.0f).withLayer().setDuration(300)
                        .setInterpolator(new OvershootInterpolator(10.0F)).start();
            }
        });
        fab.setVisibility(View.VISIBLE);
    }
}