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);
}
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;
}
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();
}
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);
}
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();
}
Aggregations