use of android.view.animation.AccelerateDecelerateInterpolator in project PageIndicatorView by romandanylyk.
the class WormAnimation method createAnimator.
@NonNull
@Override
public AnimatorSet createAnimator() {
AnimatorSet animator = new AnimatorSet();
animator.setInterpolator(new AccelerateDecelerateInterpolator());
return animator;
}
use of android.view.animation.AccelerateDecelerateInterpolator in project Material-Movies by saulmm.
the class GUIUtils method startScaleAnimationFromPivot.
public static void startScaleAnimationFromPivot(int pivotX, int pivotY, final View v, final AnimatorListener animatorListener) {
final AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
v.setScaleY(SCALE_START_ANCHOR);
v.setPivotX(pivotX);
v.setPivotY(pivotY);
v.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
v.getViewTreeObserver().removeOnPreDrawListener(this);
ViewPropertyAnimator viewPropertyAnimator = v.animate().setInterpolator(interpolator).scaleY(1).scaleX(1).setDuration(SCALE_DELAY);
if (animatorListener != null)
viewPropertyAnimator.setListener(animatorListener);
viewPropertyAnimator.start();
return true;
}
});
}
use of android.view.animation.AccelerateDecelerateInterpolator in project android-ripple-background by skyfishjy.
the class RippleBackground method init.
private void init(final Context context, final AttributeSet attrs) {
if (isInEditMode())
return;
if (null == attrs) {
throw new IllegalArgumentException("Attributes should be provided to this view,");
}
final TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RippleBackground);
rippleColor = typedArray.getColor(R.styleable.RippleBackground_rb_color, getResources().getColor(R.color.rippelColor));
rippleStrokeWidth = typedArray.getDimension(R.styleable.RippleBackground_rb_strokeWidth, getResources().getDimension(R.dimen.rippleStrokeWidth));
rippleRadius = typedArray.getDimension(R.styleable.RippleBackground_rb_radius, getResources().getDimension(R.dimen.rippleRadius));
rippleDurationTime = typedArray.getInt(R.styleable.RippleBackground_rb_duration, DEFAULT_DURATION_TIME);
rippleAmount = typedArray.getInt(R.styleable.RippleBackground_rb_rippleAmount, DEFAULT_RIPPLE_COUNT);
rippleScale = typedArray.getFloat(R.styleable.RippleBackground_rb_scale, DEFAULT_SCALE);
rippleType = typedArray.getInt(R.styleable.RippleBackground_rb_type, DEFAULT_FILL_TYPE);
typedArray.recycle();
rippleDelay = rippleDurationTime / rippleAmount;
paint = new Paint();
paint.setAntiAlias(true);
if (rippleType == DEFAULT_FILL_TYPE) {
rippleStrokeWidth = 0;
paint.setStyle(Paint.Style.FILL);
} else
paint.setStyle(Paint.Style.STROKE);
paint.setColor(rippleColor);
rippleParams = new LayoutParams((int) (2 * (rippleRadius + rippleStrokeWidth)), (int) (2 * (rippleRadius + rippleStrokeWidth)));
rippleParams.addRule(CENTER_IN_PARENT, TRUE);
animatorSet = new AnimatorSet();
animatorSet.setInterpolator(new AccelerateDecelerateInterpolator());
animatorList = new ArrayList<Animator>();
for (int i = 0; i < rippleAmount; i++) {
RippleView rippleView = new RippleView(getContext());
addView(rippleView, rippleParams);
rippleViewList.add(rippleView);
final ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(rippleView, "ScaleX", 1.0f, rippleScale);
scaleXAnimator.setRepeatCount(ObjectAnimator.INFINITE);
scaleXAnimator.setRepeatMode(ObjectAnimator.RESTART);
scaleXAnimator.setStartDelay(i * rippleDelay);
scaleXAnimator.setDuration(rippleDurationTime);
animatorList.add(scaleXAnimator);
final ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(rippleView, "ScaleY", 1.0f, rippleScale);
scaleYAnimator.setRepeatCount(ObjectAnimator.INFINITE);
scaleYAnimator.setRepeatMode(ObjectAnimator.RESTART);
scaleYAnimator.setStartDelay(i * rippleDelay);
scaleYAnimator.setDuration(rippleDurationTime);
animatorList.add(scaleYAnimator);
final ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(rippleView, "Alpha", 1.0f, 0f);
alphaAnimator.setRepeatCount(ObjectAnimator.INFINITE);
alphaAnimator.setRepeatMode(ObjectAnimator.RESTART);
alphaAnimator.setStartDelay(i * rippleDelay);
alphaAnimator.setDuration(rippleDurationTime);
animatorList.add(alphaAnimator);
}
animatorSet.playTogether(animatorList);
}
use of android.view.animation.AccelerateDecelerateInterpolator in project android-ripple-background by skyfishjy.
the class MainActivity method foundDevice.
private void foundDevice() {
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.setDuration(400);
animatorSet.setInterpolator(new AccelerateDecelerateInterpolator());
ArrayList<Animator> animatorList = new ArrayList<Animator>();
ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(foundDevice, "ScaleX", 0f, 1.2f, 1f);
animatorList.add(scaleXAnimator);
ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(foundDevice, "ScaleY", 0f, 1.2f, 1f);
animatorList.add(scaleYAnimator);
animatorSet.playTogether(animatorList);
foundDevice.setVisibility(View.VISIBLE);
animatorSet.start();
}
use of android.view.animation.AccelerateDecelerateInterpolator in project Reachability by sakebook.
the class Reachability method slideOut.
private void slideOut() {
ObjectAnimator animator = ObjectAnimator.ofFloat(getHoverView(), "translationY", 0f, 300f);
animator.setDuration(DURATION_TIME);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.addListener(mHoverListener);
animator.start();
mHoverListener.setShowStatus(false);
}
Aggregations