use of android.support.v4.view.animation.FastOutLinearInInterpolator in project android-topeka by googlesamples.
the class QuizFragment method setAvatarDrawable.
@SuppressWarnings("ConstantConditions")
private void setAvatarDrawable(AvatarView avatarView) {
Player player = PreferencesHelper.getPlayer(getActivity());
avatarView.setAvatar(player.getAvatar().getDrawableId());
ViewCompat.animate(avatarView).setInterpolator(new FastOutLinearInInterpolator()).setStartDelay(500).scaleX(1).scaleY(1).start();
}
use of android.support.v4.view.animation.FastOutLinearInInterpolator in project android-topeka by googlesamples.
the class QuizActivity method prepareCircularReveal.
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void prepareCircularReveal(View startView, FrameLayout targetView) {
int centerX = (startView.getLeft() + startView.getRight()) / 2;
// Subtract the start view's height to adjust for relative coordinates on screen.
int centerY = (startView.getTop() + startView.getBottom()) / 2 - startView.getHeight();
float endRadius = (float) Math.hypot(centerX, centerY);
mCircularReveal = ViewAnimationUtils.createCircularReveal(targetView, centerX, centerY, startView.getWidth(), endRadius);
mCircularReveal.setInterpolator(new FastOutLinearInInterpolator());
mCircularReveal.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mIcon.setVisibility(View.GONE);
mCircularReveal.removeListener(this);
}
});
// Adding a color animation from the FAB's color to transparent creates a dissolve like
// effect to the circular reveal.
int accentColor = ContextCompat.getColor(this, mCategory.getTheme().getAccentColor());
mColorChange = ObjectAnimator.ofInt(targetView, ViewUtils.FOREGROUND_COLOR, accentColor, Color.TRANSPARENT);
mColorChange.setEvaluator(new ArgbEvaluator());
mColorChange.setInterpolator(mInterpolator);
}
use of android.support.v4.view.animation.FastOutLinearInInterpolator in project RxTools by vondear.
the class RxSwipeCaptcha method createMatchAnim.
// 验证动画初始化区域
private void createMatchAnim() {
mFailAnim = ValueAnimator.ofFloat(0, 1);
mFailAnim.setDuration(100).setRepeatCount(4);
mFailAnim.setRepeatMode(ValueAnimator.REVERSE);
// 失败的时候先闪一闪动画 斗鱼是 隐藏-显示 -隐藏 -显示
mFailAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
onCaptchaMatchCallback.matchFailed(RxSwipeCaptcha.this);
}
});
mFailAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float animatedValue = (float) animation.getAnimatedValue();
Log.d(TAG, "onAnimationUpdate: " + animatedValue);
if (animatedValue < 0.5f) {
isDrawMask = false;
} else {
isDrawMask = true;
}
invalidate();
}
});
int width = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 100, getResources().getDisplayMetrics());
mSuccessAnim = ValueAnimator.ofInt(mWidth + width, 0);
mSuccessAnim.setDuration(500);
mSuccessAnim.setInterpolator(new FastOutLinearInInterpolator());
mSuccessAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mSuccessAnimOffset = (int) animation.getAnimatedValue();
invalidate();
}
});
mSuccessAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
isShowSuccessAnim = true;
}
@Override
public void onAnimationEnd(Animator animation) {
onCaptchaMatchCallback.matchSuccess(RxSwipeCaptcha.this);
isShowSuccessAnim = false;
isMatchMode = false;
}
});
mSuccessPaint = new Paint();
mSuccessPaint.setShader(new LinearGradient(0, 0, width / 2 * 3, mHeight, new int[] { 0x00ffffff, 0x88ffffff }, new float[] { 0, 0.5f }, Shader.TileMode.MIRROR));
// 模仿斗鱼 是一个平行四边形滚动过去
mSuccessPath = new Path();
mSuccessPath.moveTo(0, 0);
mSuccessPath.rLineTo(width, 0);
mSuccessPath.rLineTo(width / 2, mHeight);
mSuccessPath.rLineTo(-width, 0);
mSuccessPath.close();
}
use of android.support.v4.view.animation.FastOutLinearInInterpolator in project LabDayApp by jakdor.
the class MainFragment method animateMenuItems.
/**
* Animate logo and menu cards
*/
public void animateMenuItems() {
Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.main_logo_anim);
animation.setInterpolator(new FastOutLinearInInterpolator());
animation.start();
binding.menuLogo.startAnimation(animation);
View[] menuItems = { binding.menuTimetable.getRoot(), binding.menuMap.getRoot(), binding.menuMedia.getRoot(), binding.menuInfo.getRoot() };
for (View view : menuItems) {
view.setTranslationY(50.0f);
view.setScaleX(0.75f);
view.setScaleY(0.75f);
view.setAlpha(0.0f);
}
animationHandler.postDelayed(getNextAnimator(menuItems, 0), 100);
}
use of android.support.v4.view.animation.FastOutLinearInInterpolator in project weiui by kuaifan.
the class SwipeCaptchaView method createMatchAnim.
// 验证动画初始化区域
private void createMatchAnim() {
mFailAnim = ValueAnimator.ofFloat(0, 1);
mFailAnim.setDuration(100).setRepeatCount(4);
mFailAnim.setRepeatMode(ValueAnimator.REVERSE);
// 失败的时候先闪一闪动画 斗鱼是 隐藏-显示 -隐藏 -显示
mFailAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
onCaptchaMatchCallback.matchFailed(SwipeCaptchaView.this);
}
});
mFailAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float animatedValue = (float) animation.getAnimatedValue();
// Log.d(TAG, "onAnimationUpdate: " + animatedValue);
if (animatedValue < 0.5f) {
isDrawMask = false;
} else {
isDrawMask = true;
}
invalidate();
}
});
int width = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 100, getResources().getDisplayMetrics());
mSuccessAnim = ValueAnimator.ofInt(mWidth + width, 0);
mSuccessAnim.setDuration(500);
mSuccessAnim.setInterpolator(new FastOutLinearInInterpolator());
mSuccessAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mSuccessAnimOffset = (int) animation.getAnimatedValue();
invalidate();
}
});
mSuccessAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
isShowSuccessAnim = true;
}
@Override
public void onAnimationEnd(Animator animation) {
onCaptchaMatchCallback.matchSuccess(SwipeCaptchaView.this);
isShowSuccessAnim = false;
isMatchMode = false;
}
});
mSuccessPaint = new Paint();
mSuccessPaint.setShader(new LinearGradient(0, 0, width / 2 * 3, mHeight, new int[] { 0x00ffffff, 0x88ffffff }, new float[] { 0, 0.5f }, Shader.TileMode.MIRROR));
// 模仿斗鱼 是一个平行四边形滚动过去
mSuccessPath = new Path();
mSuccessPath.moveTo(0, 0);
mSuccessPath.rLineTo(width, 0);
mSuccessPath.rLineTo(width / 2, mHeight);
mSuccessPath.rLineTo(-width, 0);
mSuccessPath.close();
}
Aggregations