Search in sources :

Example 26 with BounceInterpolator

use of android.view.animation.BounceInterpolator in project android_frameworks_base by ResurrectionRemix.

the class QSPanel method setAnimationTile.

private void setAnimationTile(TileRecord r) {
    ObjectAnimator animTile = null;
    int animStyle = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_STYLE, 0, UserHandle.USER_CURRENT);
    int animDuration = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_DURATION, 2000, UserHandle.USER_CURRENT);
    int interpolatorType = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_INTERPOLATOR, 0, UserHandle.USER_CURRENT);
    if (animStyle == 0) {
    //No animation
    }
    if (animStyle == 1) {
        animTile = ObjectAnimator.ofFloat(r.tileView, "rotationY", 0f, 360f);
    }
    if (animStyle == 2) {
        animTile = ObjectAnimator.ofFloat(r.tileView, "rotation", 0f, 360f);
    }
    if (animTile != null) {
        switch(interpolatorType) {
            case 0:
                animTile.setInterpolator(new LinearInterpolator());
                break;
            case 1:
                animTile.setInterpolator(new AccelerateInterpolator());
                break;
            case 2:
                animTile.setInterpolator(new DecelerateInterpolator());
                break;
            case 3:
                animTile.setInterpolator(new AccelerateDecelerateInterpolator());
                break;
            case 4:
                animTile.setInterpolator(new BounceInterpolator());
                break;
            case 5:
                animTile.setInterpolator(new OvershootInterpolator());
                break;
            case 6:
                animTile.setInterpolator(new AnticipateInterpolator());
                break;
            case 7:
                animTile.setInterpolator(new AnticipateOvershootInterpolator());
                break;
            default:
                break;
        }
        animTile.setDuration(animDuration);
        animTile.start();
    }
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) AnticipateOvershootInterpolator(android.view.animation.AnticipateOvershootInterpolator) OvershootInterpolator(android.view.animation.OvershootInterpolator) LinearInterpolator(android.view.animation.LinearInterpolator) ObjectAnimator(android.animation.ObjectAnimator) BounceInterpolator(android.view.animation.BounceInterpolator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) AnticipateOvershootInterpolator(android.view.animation.AnticipateOvershootInterpolator) AnticipateInterpolator(android.view.animation.AnticipateInterpolator)

Example 27 with BounceInterpolator

use of android.view.animation.BounceInterpolator in project android_frameworks_base by DirtyUnicorns.

the class QSPanel method setAnimationTile.

private void setAnimationTile(TileRecord r) {
    ObjectAnimator animTile = null;
    int animStyle = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_STYLE, 0, UserHandle.USER_CURRENT);
    int animDuration = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_DURATION, 2000, UserHandle.USER_CURRENT);
    int interpolatorType = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_INTERPOLATOR, 0, UserHandle.USER_CURRENT);
    if (animStyle == 0) {
    //No animation
    }
    if (animStyle == 1) {
        animTile = ObjectAnimator.ofFloat(r.tileView, "rotationY", 0f, 360f);
    }
    if (animStyle == 2) {
        animTile = ObjectAnimator.ofFloat(r.tileView, "rotation", 0f, 360f);
    }
    if (animTile != null) {
        switch(interpolatorType) {
            case 0:
                animTile.setInterpolator(new LinearInterpolator());
                break;
            case 1:
                animTile.setInterpolator(new AccelerateInterpolator());
                break;
            case 2:
                animTile.setInterpolator(new DecelerateInterpolator());
                break;
            case 3:
                animTile.setInterpolator(new AccelerateDecelerateInterpolator());
                break;
            case 4:
                animTile.setInterpolator(new BounceInterpolator());
                break;
            case 5:
                animTile.setInterpolator(new OvershootInterpolator());
                break;
            case 6:
                animTile.setInterpolator(new AnticipateInterpolator());
                break;
            case 7:
                animTile.setInterpolator(new AnticipateOvershootInterpolator());
                break;
            default:
                break;
        }
        animTile.setDuration(animDuration);
        animTile.start();
    }
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) AnticipateOvershootInterpolator(android.view.animation.AnticipateOvershootInterpolator) OvershootInterpolator(android.view.animation.OvershootInterpolator) LinearInterpolator(android.view.animation.LinearInterpolator) ObjectAnimator(android.animation.ObjectAnimator) BounceInterpolator(android.view.animation.BounceInterpolator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) AnticipateOvershootInterpolator(android.view.animation.AnticipateOvershootInterpolator) AnticipateInterpolator(android.view.animation.AnticipateInterpolator)

Example 28 with BounceInterpolator

use of android.view.animation.BounceInterpolator in project android_frameworks_base by crdroidandroid.

the class QSPanel method setAnimationTile.

private void setAnimationTile(TileRecord r) {
    ObjectAnimator animTile = null;
    int animStyle = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_STYLE, 0, UserHandle.USER_CURRENT);
    int animDuration = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_DURATION, 2000, UserHandle.USER_CURRENT);
    int interpolatorType = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.ANIM_TILE_INTERPOLATOR, 0, UserHandle.USER_CURRENT);
    if (animStyle == 0) {
    //No animation
    }
    if (animStyle == 1) {
        animTile = ObjectAnimator.ofFloat(r.tileView, "rotationY", 0f, 360f);
    }
    if (animStyle == 2) {
        animTile = ObjectAnimator.ofFloat(r.tileView, "rotation", 0f, 360f);
    }
    if (animTile != null) {
        switch(interpolatorType) {
            case 0:
                animTile.setInterpolator(new LinearInterpolator());
                break;
            case 1:
                animTile.setInterpolator(new AccelerateInterpolator());
                break;
            case 2:
                animTile.setInterpolator(new DecelerateInterpolator());
                break;
            case 3:
                animTile.setInterpolator(new AccelerateDecelerateInterpolator());
                break;
            case 4:
                animTile.setInterpolator(new BounceInterpolator());
                break;
            case 5:
                animTile.setInterpolator(new OvershootInterpolator());
                break;
            case 6:
                animTile.setInterpolator(new AnticipateInterpolator());
                break;
            case 7:
                animTile.setInterpolator(new AnticipateOvershootInterpolator());
                break;
            default:
                break;
        }
        animTile.setDuration(animDuration);
        animTile.start();
    }
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) AnticipateOvershootInterpolator(android.view.animation.AnticipateOvershootInterpolator) OvershootInterpolator(android.view.animation.OvershootInterpolator) LinearInterpolator(android.view.animation.LinearInterpolator) ObjectAnimator(android.animation.ObjectAnimator) BounceInterpolator(android.view.animation.BounceInterpolator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) AnticipateOvershootInterpolator(android.view.animation.AnticipateOvershootInterpolator) AnticipateInterpolator(android.view.animation.AnticipateInterpolator)

Example 29 with BounceInterpolator

use of android.view.animation.BounceInterpolator in project smartmodule by carozhu.

the class AnimationController method setEffect.

private void setEffect(Animation animation, int interpolatorType, long durationMillis, long delayMillis) {
    switch(interpolatorType) {
        case 0:
            animation.setInterpolator(new LinearInterpolator());
            break;
        case 1:
            animation.setInterpolator(new AccelerateInterpolator());
            break;
        case 2:
            animation.setInterpolator(new DecelerateInterpolator());
            break;
        case 3:
            animation.setInterpolator(new AccelerateDecelerateInterpolator());
            break;
        case 4:
            animation.setInterpolator(new BounceInterpolator());
            break;
        case 5:
            animation.setInterpolator(new OvershootInterpolator());
            break;
        case 6:
            animation.setInterpolator(new AnticipateInterpolator());
            break;
        case 7:
            animation.setInterpolator(new AnticipateOvershootInterpolator());
            break;
        default:
            break;
    }
    animation.setDuration(durationMillis);
    animation.setStartOffset(delayMillis);
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) AnticipateOvershootInterpolator(android.view.animation.AnticipateOvershootInterpolator) OvershootInterpolator(android.view.animation.OvershootInterpolator) LinearInterpolator(android.view.animation.LinearInterpolator) BounceInterpolator(android.view.animation.BounceInterpolator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) AnticipateOvershootInterpolator(android.view.animation.AnticipateOvershootInterpolator) AnticipateInterpolator(android.view.animation.AnticipateInterpolator)

Example 30 with BounceInterpolator

use of android.view.animation.BounceInterpolator in project WilliamChart by diogobernardino.

the class LineCardOne method dismiss.

@Override
public void dismiss(Runnable action) {
    super.dismiss(action);
    mChart.dismissAllTooltips();
    mChart.dismiss(new Animation().setInterpolator(new BounceInterpolator()).withEndAction(action));
}
Also used : BounceInterpolator(android.view.animation.BounceInterpolator) Animation(com.db.chart.animation.Animation)

Aggregations

BounceInterpolator (android.view.animation.BounceInterpolator)32 View (android.view.View)10 ImageView (android.widget.ImageView)8 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)6 LinearInterpolator (android.view.animation.LinearInterpolator)6 TextView (android.widget.TextView)6 ObjectAnimator (android.animation.ObjectAnimator)5 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)5 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)4 AnticipateInterpolator (android.view.animation.AnticipateInterpolator)4 AnticipateOvershootInterpolator (android.view.animation.AnticipateOvershootInterpolator)4 Interpolator (android.view.animation.Interpolator)4 OvershootInterpolator (android.view.animation.OvershootInterpolator)4 Scroller (android.widget.Scroller)4 Animator (android.animation.Animator)3 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)3 ViewGroup (android.view.ViewGroup)3 Animation (com.db.chart.animation.Animation)3 ValueAnimator (android.animation.ValueAnimator)2 SuppressLint (android.annotation.SuppressLint)2