use of com.nineoldandroids.animation.ObjectAnimator in project XhsEmoticonsKeyboard by w446108264.
the class AnimEmoticonsIndicatorView method playBy.
public void playBy(int startPosition, int nextPosition, PageSetEntity pageSetEntity) {
if (!checkPageSetEntity(pageSetEntity)) {
return;
}
updateIndicatorCount(pageSetEntity.getPageCount());
boolean isShowInAnimOnly = false;
if (startPosition < 0 || nextPosition < 0 || nextPosition == startPosition) {
startPosition = nextPosition = 0;
}
if (startPosition < 0) {
isShowInAnimOnly = true;
startPosition = nextPosition = 0;
}
final ImageView imageViewStrat = mImageViews.get(startPosition);
final ImageView imageViewNext = mImageViews.get(nextPosition);
ObjectAnimator anim1 = ObjectAnimator.ofFloat(imageViewStrat, "scaleX", 1.0f, 0.25f);
ObjectAnimator anim2 = ObjectAnimator.ofFloat(imageViewStrat, "scaleY", 1.0f, 0.25f);
if (mPlayByOutAnimatorSet != null && mPlayByOutAnimatorSet.isRunning()) {
mPlayByOutAnimatorSet.cancel();
mPlayByOutAnimatorSet = null;
}
mPlayByOutAnimatorSet = new AnimatorSet();
mPlayByOutAnimatorSet.play(anim1).with(anim2);
mPlayByOutAnimatorSet.setDuration(100);
ObjectAnimator animIn1 = ObjectAnimator.ofFloat(imageViewNext, "scaleX", 0.25f, 1.0f);
ObjectAnimator animIn2 = ObjectAnimator.ofFloat(imageViewNext, "scaleY", 0.25f, 1.0f);
if (mPlayByInAnimatorSet != null && mPlayByInAnimatorSet.isRunning()) {
mPlayByInAnimatorSet.cancel();
mPlayByInAnimatorSet = null;
}
mPlayByInAnimatorSet = new AnimatorSet();
mPlayByInAnimatorSet.play(animIn1).with(animIn2);
mPlayByInAnimatorSet.setDuration(100);
if (isShowInAnimOnly) {
mPlayByInAnimatorSet.start();
return;
}
anim1.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
imageViewStrat.setImageDrawable(mDrawableNomal);
ObjectAnimator animFil1l = ObjectAnimator.ofFloat(imageViewStrat, "scaleX", 1.0f);
ObjectAnimator animFill2 = ObjectAnimator.ofFloat(imageViewStrat, "scaleY", 1.0f);
AnimatorSet mFillAnimatorSet = new AnimatorSet();
mFillAnimatorSet.play(animFil1l).with(animFill2);
mFillAnimatorSet.start();
imageViewNext.setImageDrawable(mDrawableSelect);
mPlayByInAnimatorSet.start();
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
mPlayByOutAnimatorSet.start();
}
use of com.nineoldandroids.animation.ObjectAnimator in project AndroidSweetSheet by zzz40500.
the class IndicatorView method alphaDismiss.
public void alphaDismiss(boolean isAnimation) {
if (isAnimation) {
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this, "alpha", 1, 0);
objectAnimator.setDuration(300);
objectAnimator.start();
} else {
ViewHelper.setAlpha(this, 0);
}
}
use of com.nineoldandroids.animation.ObjectAnimator in project AndroidSweetSheet by zzz40500.
the class CustomDelegate method alphaAnimation.
private void alphaAnimation() {
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(getContentRelativeLayout(), "alpha", 0, 1);
objectAnimator.setDuration(1200);
objectAnimator.setInterpolator(new DecelerateInterpolator());
objectAnimator.start();
}
use of com.nineoldandroids.animation.ObjectAnimator in project AndroidSweetSheet by zzz40500.
the class Delegate method dismiss.
/**
* 消失
*/
protected void dismiss() {
if (getStatus() == SweetSheet.Status.DISMISS) {
return;
}
mBg.setClickable(false);
dismissShowdown();
ObjectAnimator translationOut = ObjectAnimator.ofFloat(mRootView, "translationY", 0, mRootView.getHeight());
translationOut.setDuration(600);
translationOut.setInterpolator(new DecelerateInterpolator());
translationOut.addListener(new SimpleAnimationListener() {
@Override
public void onAnimationStart(Animator animation) {
mStatus = SweetSheet.Status.DISMISSING;
}
@Override
public void onAnimationEnd(Animator animation) {
mStatus = SweetSheet.Status.DISMISS;
mParentVG.removeView(mRootView);
}
});
translationOut.start();
}
use of com.nineoldandroids.animation.ObjectAnimator in project AndroidSweetSheet by zzz40500.
the class Delegate method showShowdown.
/**
* 显示模糊背景
*/
protected void showShowdown() {
ViewHelper.setTranslationY(mRootView, 0);
mEffect.effect(mParentVG, mBg);
ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
if (mBg.getParent() != null) {
mParentVG.removeView(mBg);
}
mParentVG.addView(mBg, lp);
ViewHelper.setAlpha(mBg, 0);
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBg, "alpha", 0, 1);
objectAnimator.setDuration(400);
objectAnimator.start();
}
Aggregations