@Override
public void endAnimation(DynamicWeatherView dynamicWeatherView, Animator.AnimatorListener listener) {
super.endAnimation(dynamicWeatherView, listener);
dynamicWeatherView.removeCallbacks(flashRunnable);
ValueAnimator animator = ValueAnimator.ofFloat(getWidth() - bitmap.getWidth() * 0.2f, getWidth());
animator.setDuration(1000);
animator.setRepeatCount(0);
animator.setInterpolator(new AccelerateInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
transFactor = (float) animation.getAnimatedValue();
}
});
if (listener != null) {
animator.addListener(listener);
}
animator.start();
}
java类android.view.animation.AccelerateInterpolator的实例源码
RainType.java 文件源码
项目:FakeWeather
阅读 29
收藏 0
点赞 0
评论 0
SnowType.java 文件源码
项目:FakeWeather
阅读 24
收藏 0
点赞 0
评论 0
@Override
public void endAnimation(DynamicWeatherView dynamicWeatherView, Animator.AnimatorListener listener) {
super.endAnimation(dynamicWeatherView, listener);
ValueAnimator animator = ValueAnimator.ofFloat(getWidth() - bitmap.getWidth() * 0.25f, getWidth());
animator.setDuration(1000);
animator.setRepeatCount(0);
animator.setInterpolator(new AccelerateInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
transFactor = (float) animation.getAnimatedValue();
}
});
if (listener != null) {
animator.addListener(listener);
}
animator.start();
}
SandstormType.java 文件源码
项目:FakeWeather
阅读 18
收藏 0
点赞 0
评论 0
@Override
public void endAnimation(DynamicWeatherView dynamicWeatherView, Animator.AnimatorListener listener) {
super.endAnimation(dynamicWeatherView, listener);
ValueAnimator animator1 = ValueAnimator.ofFloat(1, 0);
animator1.setInterpolator(new AccelerateInterpolator());
animator1.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
speed = (float) animation.getAnimatedValue() * 32;
rotate = (float) animation.getAnimatedValue();
}
});
AnimatorSet animSet = new AnimatorSet();
animSet.play(animator1);
animSet.setDuration(1000);
if (listener != null) {
animSet.addListener(listener);
}
animSet.start();
}
OvercastType.java 文件源码
项目:FakeWeather
阅读 26
收藏 0
点赞 0
评论 0
@Override
public void endAnimation(DynamicWeatherView dynamicWeatherView, Animator.AnimatorListener listener) {
super.endAnimation(dynamicWeatherView, listener);
ValueAnimator animator = ValueAnimator.ofFloat(1, -1);
animator.setDuration(1000);
animator.setRepeatCount(0);
animator.setInterpolator(new AccelerateInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
hillTransFactor = (float) animation.getAnimatedValue();
}
});
if (listener != null) {
animator.addListener(listener);
}
animator.start();
}
RippleView.java 文件源码
项目:Garbage_RippleView
阅读 27
收藏 0
点赞 0
评论 0
private void init() {
setLayerType(LAYER_TYPE_SOFTWARE,null);
mPaint = new Paint();
mPaint.setStyle(Paint.Style.FILL);
mPaint.setStrokeWidth(1);
mPaint.setAntiAlias(true);
mPaint.setColor(Color.RED);
mPath = new Path();
anim = ValueAnimator.ofFloat(0f,1f);
anim.setInterpolator(new AccelerateInterpolator());
anim.setDuration(5000);
anim.setRepeatCount(ValueAnimator.INFINITE);
anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
progress = (float)animation.getAnimatedValue();
invalidate();
}
});
anim.start();
}
Calculator.java 文件源码
项目:CalcMate
阅读 30
收藏 0
点赞 0
评论 0
private Cling initCling(int clingId, int[] positionData, float revealRadius, boolean showHand, boolean animate) {
setPagingEnabled(false);
clingActive = true;
Cling cling = (Cling) findViewById(clingId);
if(cling != null) {
//getActionBar().hide();
getActionBar().hide();
cling.init(this, positionData, revealRadius, showHand);
cling.setVisibility(View.VISIBLE);
cling.setLayerType(View.LAYER_TYPE_HARDWARE, null);
if(animate) {
cling.buildLayer();
cling.setAlpha(0f);
cling.animate().alpha(1f).setInterpolator(new AccelerateInterpolator()).setDuration(Cling.SHOW_CLING_DURATION).setStartDelay(0).start();
}
else {
cling.setAlpha(1f);
}
}
return cling;
}
ShowroomActivity.java 文件源码
项目:showroom-android
阅读 27
收藏 0
点赞 0
评论 0
private void hideHelpOverlay() {
if (animationsInProgress) return;
animationsInProgress = true;
titleLayout.bringToFront();
mainLayout.setVisibility(View.VISIBLE);
Animator hideAnimation;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
hideAnimation = ViewAnimationUtils.createCircularReveal(helpLayout, titleBtnHelpCenterX, titleBtnHelpCenterY, screenDiagonalPx, 0);
} else {
hideAnimation = ObjectAnimator.ofFloat(helpLayout, "alpha", 1f, 0f);
}
hideAnimation.setInterpolator(new AccelerateInterpolator());
hideAnimation.setDuration(250);
hideAnimation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
helpLayout.setVisibility(View.GONE);
animationsInProgress = false;
helpLayoutShown = false;
helpLayoutScrollView.scrollTo(0, 0);
}
});
hideAnimation.start();
}
FlipDownItemAnimator.java 文件源码
项目:GitHub
阅读 19
收藏 0
点赞 0
评论 0
@Override
protected ViewPropertyAnimatorCompat animateRemoveImpl(ViewHolder holder) {
return ViewCompat.animate(holder.itemView)
.rotationY(90)
.translationX(-(holder.itemView.getMeasuredWidth() / 4))
.scaleX(0.5F)
.scaleY(0.5F)
.setInterpolator(new AccelerateInterpolator());
}
FromTopItemAnimator.java 文件源码
项目:GitHub
阅读 24
收藏 0
点赞 0
评论 0
@Override
protected ViewPropertyAnimatorCompat animateRemoveImpl(ViewHolder holder) {
Point screen = Utils.getScreenDimensions(holder.itemView.getContext());
int top = holder.itemView.getTop();
return ViewCompat.animate(holder.itemView)
.rotation(80)
.translationY(screen.y - top)
.setInterpolator(new AccelerateInterpolator());
}
MaterialViewPagerImageHelper.java 文件源码
项目:GitHub
阅读 24
收藏 0
点赞 0
评论 0
public static void fadeIn(View view, float alpha, int fadeDuration, ViewPropertyAnimatorListenerAdapter listener) {
//fade to alpha=0
ViewCompat.animate(view)
.alpha(alpha)
.setDuration(fadeDuration)
.withLayer()
.setInterpolator(new AccelerateInterpolator())
.setListener(listener);
}