Search in sources :

Example 6 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project cw-omnibus by commonsguy.

the class ActionBarContextView method makeOutAnimation.

private Animator makeOutAnimation() {
    ObjectAnimator buttonAnimator = ObjectAnimator.ofFloat(mClose, "translationX", -mClose.getWidth() - ((MarginLayoutParams) mClose.getLayoutParams()).leftMargin);
    buttonAnimator.setDuration(200);
    buttonAnimator.addListener(this);
    buttonAnimator.setInterpolator(new DecelerateInterpolator());
    AnimatorSet set = new AnimatorSet();
    AnimatorSet.Builder b = set.play(buttonAnimator);
    if (mMenuView != null) {
        final int count = mMenuView.getChildCount();
        if (count > 0) {
            for (int i = 0; i < 0; i++) {
                AnimatorProxy child = AnimatorProxy.wrap(mMenuView.getChildAt(i));
                child.setScaleY(0);
                ObjectAnimator a = ObjectAnimator.ofFloat(child, "scaleY", 0);
                a.setDuration(100);
                a.setStartDelay(i * 70);
                b.with(a);
            }
        }
    }
    return set;
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ObjectAnimator(com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.actionbarsherlock.internal.nineoldandroids.animation.AnimatorSet) AnimatorProxy(com.actionbarsherlock.internal.nineoldandroids.view.animation.AnimatorProxy)

Example 7 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project Launcher3 by chislon.

the class DeleteDropTarget method animateToTrashAndCompleteDrop.

private void animateToTrashAndCompleteDrop(final DragObject d) {
    final DragLayer dragLayer = mLauncher.getDragLayer();
    final Rect from = new Rect();
    dragLayer.getViewRectRelativeToSelf(d.dragView, from);
    final Rect to = getIconRect(d.dragView.getMeasuredWidth(), d.dragView.getMeasuredHeight(), mCurrentDrawable.getIntrinsicWidth(), mCurrentDrawable.getIntrinsicHeight());
    final float scale = (float) to.width() / from.width();
    mSearchDropTargetBar.deferOnDragEnd();
    deferCompleteDropIfUninstalling(d);
    Runnable onAnimationEndRunnable = new Runnable() {

        @Override
        public void run() {
            completeDrop(d);
            mSearchDropTargetBar.onDragEnd();
            mLauncher.exitSpringLoadedDragMode();
        }
    };
    dragLayer.animateView(d.dragView, from, to, scale, 1f, 1f, 0.1f, 0.1f, DELETE_ANIMATION_DURATION, new DecelerateInterpolator(2), new LinearInterpolator(), onAnimationEndRunnable, DragLayer.ANIMATION_END_DISAPPEAR, null);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) Rect(android.graphics.Rect) LinearInterpolator(android.view.animation.LinearInterpolator)

Example 8 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project OneClickAndroid by cyngn.

the class UsbActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    OneClickStats.sendEvent(this, OneClickStats.Categories.PAGE_SHOWN, OneClickStats.Actions.PAGE_ADB);
    if (adbIsEnabled()) {
        startActivity(new Intent(getBaseContext(), PtpActivity.class));
        finish();
        return;
    }
    setContentView(R.layout.usb);
    ImageView instructionView = (ImageView) findViewById(R.id.usb_instructions);
    DecelerateInterpolator interpolator = new DecelerateInterpolator(2.0f);
    AnimationSet instructionAnimations = new AnimationSet(true);
    instructionAnimations.setInterpolator(interpolator);
    TranslateAnimation instructionMoveAnimation = new TranslateAnimation(0, 0, 250, 0);
    instructionMoveAnimation.setDuration(1000);
    instructionMoveAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
    instructionAnimations.addAnimation(instructionMoveAnimation);
    // we want them to read the instructions first! so we give them a few seconds
    AlphaAnimation instructionFadeAnimation = new AlphaAnimation(0.0f, 1.0f);
    instructionFadeAnimation.setDuration(1000);
    instructionFadeAnimation.setStartOffset(500);
    instructionFadeAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
    instructionAnimations.addAnimation(instructionFadeAnimation);
    instructionView.setAnimation(instructionAnimations);
    // continue button should take even longer
    AlphaAnimation buttonAnimation = new AlphaAnimation(0.0f, 1.0f);
    buttonAnimation.setDuration(750);
    buttonAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
    buttonAnimation.setStartOffset(1000);
    findViewById(R.id.next).setAnimation(buttonAnimation);
    OnClickListener openUsbListener = new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            Intent intent = new Intent();
            intent.setClassName("com.android.settings", "com.android.settings.DevelopmentSettings");
            try {
                OneClickStats.sendEvent(view.getContext(), OneClickStats.Categories.BUTTON_CLICK, OneClickStats.Actions.BTN_ADB);
                startActivity(intent);
                startService(new Intent(getBaseContext(), UsbDebuggingMonitorService.class));
            } catch (ActivityNotFoundException e) {
                // we want to know if this happens, right?
                OneClickStats.sendEvent(view.getContext(), OneClickStats.Categories.SWITCH_ERROR, OneClickStats.Actions.ERR_ADB);
            }
        }
    };
    findViewById(R.id.next).setOnClickListener(openUsbListener);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ActivityNotFoundException(android.content.ActivityNotFoundException) TranslateAnimation(android.view.animation.TranslateAnimation) OnClickListener(android.view.View.OnClickListener) Intent(android.content.Intent) ImageView(android.widget.ImageView) AnimationSet(android.view.animation.AnimationSet) ImageView(android.widget.ImageView) View(android.view.View) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 9 with DecelerateInterpolator

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

the class StackedCardThree method show.

@Override
public void show(Runnable action) {
    super.show(action);
    BarSet dataset = new BarSet(mLabels, mValues[0]);
    dataset.setColor(Color.parseColor("#687E8E"));
    mChart.addData(dataset);
    dataset = new BarSet(mLabels, mValues[1]);
    dataset.setColor(Color.parseColor("#FF5C8E67"));
    mChart.addData(dataset);
    mChart.setRoundCorners(Tools.fromDpToPx(5));
    mChart.setBarSpacing(Tools.fromDpToPx(5));
    mChart.setBorderSpacing(Tools.fromDpToPx(5)).setYLabels(AxisRenderer.LabelPosition.NONE).setXLabels(AxisRenderer.LabelPosition.NONE).setXAxis(false).setYAxis(false).setAxisBorderValues(-80, 80, 10);
    Animation anim = new Animation().setEasing(new DecelerateInterpolator()).setEndAction(action);
    mChart.show(anim);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) BarSet(com.db.chart.model.BarSet) Animation(com.db.chart.animation.Animation)

Example 10 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project ActivityAnimationLib by dkmeteor.

the class SplitEffect method animate.

public void animate(final Activity destActivity, final int duration) {
    final Interpolator interpolator = new DecelerateInterpolator();
    destActivity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
    new Handler().post(new Runnable() {

        @Override
        public void run() {
            mSetAnim = new AnimatorSet();
            mTopImage.setLayerType(View.LAYER_TYPE_HARDWARE, null);
            mBottomImage.setLayerType(View.LAYER_TYPE_HARDWARE, null);
            mSetAnim.addListener(new Animator.AnimatorListener() {

                @Override
                public void onAnimationStart(Animator animation) {
                }

                @Override
                public void onAnimationEnd(Animator animation) {
                    clean(destActivity);
                }

                @Override
                public void onAnimationCancel(Animator animation) {
                    clean(destActivity);
                }

                @Override
                public void onAnimationRepeat(Animator animation) {
                }
            });
            Animator anim1 = ObjectAnimator.ofFloat(mTopImage, "translationY", mTopImage.getHeight() * -1);
            Animator anim2 = ObjectAnimator.ofFloat(mBottomImage, "translationY", mBottomImage.getHeight());
            if (interpolator != null) {
                anim1.setInterpolator(interpolator);
                anim2.setInterpolator(interpolator);
            }
            mSetAnim.setDuration(duration);
            mSetAnim.playTogether(anim1, anim2);
            mSetAnim.start();
        }
    });
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) Handler(android.os.Handler) Interpolator(android.view.animation.Interpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AnimatorSet(android.animation.AnimatorSet)

Aggregations

DecelerateInterpolator (android.view.animation.DecelerateInterpolator)305 ObjectAnimator (android.animation.ObjectAnimator)77 Animator (android.animation.Animator)65 ValueAnimator (android.animation.ValueAnimator)57 View (android.view.View)57 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)53 AnimatorSet (android.animation.AnimatorSet)52 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)36 ImageView (android.widget.ImageView)32 AlphaAnimation (android.view.animation.AlphaAnimation)30 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)28 Animation (android.view.animation.Animation)21 TextView (android.widget.TextView)20 Point (android.graphics.Point)18 ValueAnimator (com.nineoldandroids.animation.ValueAnimator)18 Paint (android.graphics.Paint)14 LinearInterpolator (android.view.animation.LinearInterpolator)14 ScaleAnimation (android.view.animation.ScaleAnimation)14 AnimatorSet (com.actionbarsherlock.internal.nineoldandroids.animation.AnimatorSet)14 ObjectAnimator (com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator)14