use of android.view.animation.LinearInterpolator in project ENViews by codeestX.
the class ENVolumeView method onSizeChanged.
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mWidth = w * 5 / 6;
mHeight = h;
mBaseLength = mWidth / 6;
mCenterX = w / 2;
mCenterY = h / 2;
mPath.moveTo(mCenterX - 3 * mBaseLength, mCenterY);
mPath.lineTo(mCenterX - 3 * mBaseLength, mCenterY - 0.5f * mBaseLength);
mPath.lineTo(mCenterX - 2 * mBaseLength, mCenterY - 0.5f * mBaseLength);
mPath.lineTo(mCenterX, mCenterY - 2 * mBaseLength);
mPath.lineTo(mCenterX, mCenterY + 2 * mBaseLength);
mPath.lineTo(mCenterX - 2 * mBaseLength, mCenterY + 0.5f * mBaseLength);
mPath.lineTo(mCenterX - 3 * mBaseLength, mCenterY + 0.5f * mBaseLength);
mPath.close();
mPathMeasure.setPath(mPath, false);
mPathLength = mPathMeasure.getLength();
vibrateAnim = ValueAnimator.ofFloat(1.f, 100.f);
vibrateAnim.setDuration(100);
vibrateAnim.setInterpolator(new LinearInterpolator());
vibrateAnim.setRepeatCount(ValueAnimator.INFINITE);
vibrateAnim.setRepeatMode(ValueAnimator.REVERSE);
vibrateAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
mFraction = valueAnimator.getAnimatedFraction();
invalidate();
}
});
}
use of android.view.animation.LinearInterpolator 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);
}
use of android.view.animation.LinearInterpolator in project ArcMenu by daCapricorn.
the class ArcLayout method createShrinkAnimation.
private static Animation createShrinkAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta, long startOffset, long duration, Interpolator interpolator) {
AnimationSet animationSet = new AnimationSet(false);
animationSet.setFillAfter(true);
final long preDuration = duration / 2;
Animation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setStartOffset(startOffset);
rotateAnimation.setDuration(preDuration);
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setFillAfter(true);
animationSet.addAnimation(rotateAnimation);
Animation translateAnimation = new RotateAndTranslateAnimation(0, toXDelta, 0, toYDelta, 360, 720);
translateAnimation.setStartOffset(startOffset + preDuration);
translateAnimation.setDuration(duration - preDuration);
translateAnimation.setInterpolator(interpolator);
translateAnimation.setFillAfter(true);
animationSet.addAnimation(translateAnimation);
return animationSet;
}
use of android.view.animation.LinearInterpolator in project LoadingDrawable by dinuscxj.
the class LoadingRenderer method setupAnimators.
private void setupAnimators() {
mRenderAnimator = ValueAnimator.ofFloat(0.0f, 1.0f);
mRenderAnimator.setRepeatCount(Animation.INFINITE);
mRenderAnimator.setRepeatMode(Animation.RESTART);
mRenderAnimator.setDuration(mDuration);
//fuck you! the default interpolator is AccelerateDecelerateInterpolator
mRenderAnimator.setInterpolator(new LinearInterpolator());
mRenderAnimator.addUpdateListener(mAnimatorUpdateListener);
}
use of android.view.animation.LinearInterpolator in project RecyclerRefreshLayout by dinuscxj.
the class MaterialRefreshView method startAnimator.
private void startAnimator() {
mRotateAnimator = ValueAnimator.ofFloat(0.0f, 1.0f);
mRotateAnimator.setInterpolator(new LinearInterpolator());
mRotateAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float rotateProgress = (float) animation.getAnimatedValue();
setStartDegrees(DEFAULT_START_DEGREES + rotateProgress * 360);
}
});
mRotateAnimator.setRepeatMode(ValueAnimator.RESTART);
mRotateAnimator.setRepeatCount(ValueAnimator.INFINITE);
mRotateAnimator.setDuration(ANIMATION_DURATION);
mRotateAnimator.start();
}
Aggregations