use of android.animation.AnimatorListenerAdapter 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.animation.AnimatorListenerAdapter in project XobotOS by xamarin.
the class FragmentManagerImpl method hideFragment.
public void hideFragment(Fragment fragment, int transition, int transitionStyle) {
if (DEBUG)
Log.v(TAG, "hide: " + fragment);
if (!fragment.mHidden) {
fragment.mHidden = true;
if (fragment.mView != null) {
Animator anim = loadAnimator(fragment, transition, true, transitionStyle);
if (anim != null) {
anim.setTarget(fragment.mView);
// Delay the actual hide operation until the animation finishes, otherwise
// the fragment will just immediately disappear
final Fragment finalFragment = fragment;
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (finalFragment.mView != null) {
finalFragment.mView.setVisibility(View.GONE);
}
}
});
anim.start();
} else {
fragment.mView.setVisibility(View.GONE);
}
}
if (fragment.mAdded && fragment.mHasMenu && fragment.mMenuVisible) {
mNeedMenuInvalidate = true;
}
fragment.onHiddenChanged(true);
}
}
use of android.animation.AnimatorListenerAdapter 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();
}
}
}
use of android.animation.AnimatorListenerAdapter in project LookLook by xinghongfei.
the class ZhihuDescribeActivity 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();
}
}
}
use of android.animation.AnimatorListenerAdapter in project LookLook by xinghongfei.
the class MeiziAdapter method bindViewHolderNormal.
private void bindViewHolderNormal(final MeiziViewHolder holder, final int position) {
final Meizi meizi = meiziItemes.get(holder.getAdapterPosition());
holder.imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startDescribeActivity(meizi, holder);
}
});
// holder.textView.setText("视频");
// holder.textView.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// startDescribeActivity(meizi,holder);
// }
// });
Glide.with(mContext).load(meizi.getUrl()).listener(new RequestListener<String, GlideDrawable>() {
@Override
public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
return false;
}
@Override
public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
if (!meizi.hasFadedIn) {
holder.imageView.setHasTransientState(true);
final ObservableColorMatrix cm = new ObservableColorMatrix();
final ObjectAnimator animator = ObjectAnimator.ofFloat(cm, ObservableColorMatrix.SATURATION, 0f, 1f);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
holder.imageView.setColorFilter(new ColorMatrixColorFilter(cm));
}
});
animator.setDuration(2000L);
animator.setInterpolator(new AccelerateInterpolator());
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
holder.imageView.clearColorFilter();
holder.imageView.setHasTransientState(false);
animator.start();
meizi.hasFadedIn = true;
}
});
}
return false;
}
}).diskCacheStrategy(DiskCacheStrategy.SOURCE).centerCrop().into(new DribbbleTarget(holder.imageView, false));
}
Aggregations