Search in sources :

Example 6 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project Leonids by plattysoft.

the class EmiterTimeLimitedExampleActivity method onClick.

@Override
public void onClick(View arg0) {
    ParticleSystem ps = new ParticleSystem(this, 100, R.drawable.star_pink, 1000);
    ps.setScaleRange(0.7f, 1.3f);
    ps.setSpeedModuleAndAngleRange(0.07f, 0.16f, 0, 180);
    ps.setRotationSpeedRange(90, 180);
    ps.setAcceleration(0.00013f, 90);
    ps.setFadeOut(200, new AccelerateInterpolator());
    ps.emit(arg0, 100, 2000);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ParticleSystem(com.plattysoft.leonids.ParticleSystem)

Example 7 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project Leonids by plattysoft.

the class FollowCursorExampleActivity method onTouchEvent.

@Override
public boolean onTouchEvent(MotionEvent event) {
    switch(event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            // Create a particle system and start emiting
            ps = new ParticleSystem(this, 100, R.drawable.star_pink, 800);
            ps.setScaleRange(0.7f, 1.3f);
            ps.setSpeedRange(0.05f, 0.1f);
            ps.setRotationSpeedRange(90, 180);
            ps.setFadeOut(200, new AccelerateInterpolator());
            ps.emit((int) event.getX(), (int) event.getY(), 40);
            break;
        case MotionEvent.ACTION_MOVE:
            ps.updateEmitPoint((int) event.getX(), (int) event.getY());
            break;
        case MotionEvent.ACTION_UP:
            ps.stopEmitting();
            break;
    }
    return true;
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ParticleSystem(com.plattysoft.leonids.ParticleSystem)

Example 8 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project AndroidPicker by gzu-liyujiang.

the class CustomHeaderAndFooterPicker method show.

@Override
public void show() {
    super.show();
    ViewAnimator.animate(getRootView()).duration(2000).interpolator(new AccelerateInterpolator()).slideBottom().start();
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator)

Example 9 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project NotificationPeekPort by lzanita09.

the class NotificationLayout method hideNotificationContent.

private void hideNotificationContent() {
    if (!mContentShowing) {
        // Content is already hidden.
        return;
    }
    mContentShowing = false;
    final ViewGroup peekView = (ViewGroup) getParent();
    final View contentView = peekView.findViewById(R.id.notification_content);
    LinearLayout contentTextLayout = (LinearLayout) contentView.findViewById(R.id.content_layout);
    // Animations.
    contentTextLayout.animate().translationY(50).setInterpolator(new AccelerateInterpolator()).start();
    contentView.animate().alpha(0f).setInterpolator(new AccelerateInterpolator()).setListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            peekView.removeView(contentView);
        }
    }).start();
    // Send broadcast to NotificationPeekActivity to let it show the components again.
    Intent intent = new Intent(NotificationPeekActivity.NotificationPeekReceiver.ACTION_HIDE_CONTENT);
    getContext().sendBroadcast(intent);
}
Also used : Animator(android.animation.Animator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ViewGroup(android.view.ViewGroup) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) Intent(android.content.Intent) View(android.view.View) LinearLayout(android.widget.LinearLayout)

Example 10 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project AdvancedMaterialDrawer by madcyph3r.

the class MaterialRippleLayoutNineOld method startRipple.

private void startRipple(final Runnable animationEndRunnable) {
    if (eventCancelled)
        return;
    float endRadius = getEndRadius();
    cancelAnimations();
    rippleAnimator = new AnimatorSet();
    rippleAnimator.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            if (!ripplePersistent) {
                setRadius(0);
                setRippleAlpha(rippleAlpha);
            }
            if (animationEndRunnable != null && rippleDelayClick) {
                animationEndRunnable.run();
            }
            childView.setPressed(false);
        }
    });
    ObjectAnimator ripple = ObjectAnimator.ofFloat(this, radiusProperty, radius, endRadius);
    ripple.setDuration(rippleDuration);
    ripple.setInterpolator(new DecelerateInterpolator());
    ObjectAnimator fade = ObjectAnimator.ofInt(this, circleAlphaProperty, rippleAlpha, 0);
    fade.setDuration(rippleFadeDuration);
    fade.setInterpolator(new AccelerateInterpolator());
    fade.setStartDelay(rippleDuration - rippleFadeDuration - FADE_EXTRA_DELAY);
    if (ripplePersistent) {
        rippleAnimator.play(ripple);
    } else if (getRadius() > endRadius) {
        fade.setStartDelay(0);
        rippleAnimator.play(fade);
    } else {
        rippleAnimator.playTogether(ripple, fade);
    }
    rippleAnimator.start();
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) Animator(com.nineoldandroids.animation.Animator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) AnimatorListenerAdapter(com.nineoldandroids.animation.AnimatorListenerAdapter) ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Aggregations

AccelerateInterpolator (android.view.animation.AccelerateInterpolator)186 Animator (android.animation.Animator)62 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)54 View (android.view.View)52 ObjectAnimator (android.animation.ObjectAnimator)41 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)40 ImageView (android.widget.ImageView)26 AnimatorSet (android.animation.AnimatorSet)24 TextView (android.widget.TextView)23 Animation (android.view.animation.Animation)21 ValueAnimator (android.animation.ValueAnimator)17 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)14 LinearInterpolator (android.view.animation.LinearInterpolator)14 TranslateAnimation (android.view.animation.TranslateAnimation)14 OvershootInterpolator (android.view.animation.OvershootInterpolator)13 Point (android.graphics.Point)12 Paint (android.graphics.Paint)10 Interpolator (android.view.animation.Interpolator)9 AlphaAnimation (android.view.animation.AlphaAnimation)8 AnticipateOvershootInterpolator (android.view.animation.AnticipateOvershootInterpolator)8