use of android.view.animation.AccelerateInterpolator in project ViewAnimator by florent37.
the class MainActivity method animateSequentially.
protected void animateSequentially() {
ViewAnimator.animate(image).dp().width(100f, 150f).alpha(1, 0.1f).interpolator(new DecelerateInterpolator()).duration(800).thenAnimate(image).dp().width(150f, 100f).alpha(0.1f, 1f).interpolator(new AccelerateInterpolator()).duration(1200).start();
ViewAnimator.animate(image).scaleX(0, 1).scaleY(0, 1).alpha(0, 1).decelerate().duration(500).thenAnimate(image).scaleX(1, 0).scaleY(1, 0).alpha(1, 0).accelerate().duration(500);
}
use of android.view.animation.AccelerateInterpolator in project MaterialLogin by fanrunqi.
the class RegisterActivity method animateRevealClose.
public void animateRevealClose() {
Animator mAnimator = ViewAnimationUtils.createCircularReveal(cvAdd, cvAdd.getWidth() / 2, 0, cvAdd.getHeight(), fab.getWidth() / 2);
mAnimator.setDuration(500);
mAnimator.setInterpolator(new AccelerateInterpolator());
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
cvAdd.setVisibility(View.INVISIBLE);
super.onAnimationEnd(animation);
fab.setImageResource(R.drawable.plus);
RegisterActivity.super.onBackPressed();
}
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
}
});
mAnimator.start();
}
use of android.view.animation.AccelerateInterpolator in project LookLook by xinghongfei.
the class TopNewsDescribeActivity method enterAnimation.
private void enterAnimation() {
float offSet = mToolbar.getHeight();
LinearInterpolator interpolator = new LinearInterpolator();
AccelerateInterpolator accelerateInterpolator = new AccelerateInterpolator();
viewEnterAnimation(mToolbar, offSet, interpolator);
viewEnterAnimationNest(mNest, 0f, accelerateInterpolator);
}
use of android.view.animation.AccelerateInterpolator in project LookLook by xinghongfei.
the class TopNewsDescribeActivity method initData.
protected void initData() {
id = getIntent().getStringExtra("docid");
title = getIntent().getStringExtra("title");
mTextView.setText(title);
mImageUrl = getIntent().getStringExtra("image");
scrollListener = new NestedScrollView.OnScrollChangeListener() {
@Override
public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
if (oldScrollY < 168) {
mShot.setOffset(-oldScrollY);
mTextView.setOffset(-oldScrollY);
}
}
};
Glide.with(this).load(mImageUrl).override(width, heigh).listener(glideLoadListener).centerCrop().diskCacheStrategy(DiskCacheStrategy.SOURCE).into(mShot);
mTopNewsDesPresenter = new TopNewsDesPresenterImpl(this);
mNest.setOnScrollChangeListener(scrollListener);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
postponeEnterTransition();
mShot.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
mShot.getViewTreeObserver().removeOnPreDrawListener(this);
startPostponedEnterTransition();
return true;
}
});
}
mReturnHomeListener = new AnimUtils.TransitionListenerAdapter() {
@Override
public void onTransitionStart(Transition transition) {
super.onTransitionStart(transition);
// hide the fab as for some reason it jumps position?? TODO work out why
mToolbar.animate().alpha(0f).setDuration(100).setInterpolator(new AccelerateInterpolator());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mShot.setElevation(1f);
mToolbar.setElevation(0f);
}
mNest.animate().alpha(0f).setDuration(50).setInterpolator(new AccelerateInterpolator());
}
};
mEnterTrasitionListener = new AnimUtils.TransitionListenerAdapter() {
@Override
public void onTransitionEnd(Transition transition) {
super.onTransitionEnd(transition);
// 解决5.0 shara element bug
ValueAnimator valueAnimator = ValueAnimator.ofInt(0, 100).setDuration(100);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
// mShot.setOffset((Integer) valueAnimator.getAnimatedValue() * 10);
mNest.smoothScrollTo((Integer) valueAnimator.getAnimatedValue() / 10, 0);
}
});
valueAnimator.start();
// mShot.setAlpha(0.5f);
// mShot.animate().alpha(1f).setDuration(800L).start();
}
@Override
public void onTransitionResume(Transition transition) {
super.onTransitionResume(transition);
}
};
}
use of android.view.animation.AccelerateInterpolator in project LookLook by xinghongfei.
the class TopNewsDescribeActivity method expandImageAndFinish.
private void expandImageAndFinish() {
if (mShot.getOffset() != 0f) {
Animator expandImage = ObjectAnimator.ofFloat(mShot, ParallaxScrimageView.OFFSET, 0f);
expandImage.setDuration(80);
expandImage.setInterpolator(new AccelerateInterpolator());
expandImage.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
finishAfterTransition();
} else {
finish();
}
}
});
expandImage.start();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
finishAfterTransition();
} else {
finish();
}
}
}
Aggregations