use of com.nineoldandroids.animation.AnimatorSet in project Context-Menu.Android by Yalantis.
the class AnimatorUtils method fadeOutSet.
public static AnimatorSet fadeOutSet(View v, float x) {
AnimatorSet fadeOutSet = new AnimatorSet();
fadeOutSet.playTogether(alfaDisappear(v), translationRight(v, x));
return fadeOutSet;
}
use of com.nineoldandroids.animation.AnimatorSet in project Carbon by ZieIony.
the class RippleForeground method createSoftwareExit.
@Override
protected Animator createSoftwareExit() {
final int radiusDuration;
final int originDuration;
final int opacityDuration;
if (mIsBounded) {
computeBoundedTargetValues();
radiusDuration = BOUNDED_RADIUS_EXIT_DURATION;
originDuration = BOUNDED_ORIGIN_EXIT_DURATION;
opacityDuration = BOUNDED_OPACITY_EXIT_DURATION;
} else {
radiusDuration = getRadiusExitDuration();
originDuration = radiusDuration;
opacityDuration = getOpacityExitDuration();
}
final ObjectAnimator tweenRadius = ObjectAnimator.ofFloat(this, TWEEN_RADIUS, 1);
AnimatorsCompat.setAutoCancel(tweenRadius);
//tweenRadius.setAutoCancel(true);
tweenRadius.setDuration(radiusDuration);
tweenRadius.setInterpolator(DECELERATE_INTERPOLATOR);
final ObjectAnimator tweenOrigin = ObjectAnimator.ofFloat(this, TWEEN_ORIGIN, 1);
AnimatorsCompat.setAutoCancel(tweenOrigin);
//tweenOrigin.setAutoCancel(true);
tweenOrigin.setDuration(originDuration);
tweenOrigin.setInterpolator(DECELERATE_INTERPOLATOR);
final ObjectAnimator opacity = ObjectAnimator.ofFloat(this, OPACITY, 0);
AnimatorsCompat.setAutoCancel(opacity);
//opacity.setAutoCancel(true);
opacity.setDuration(opacityDuration);
opacity.setInterpolator(LINEAR_INTERPOLATOR);
final AnimatorSet set = new AnimatorSet();
set.play(tweenOrigin).with(tweenRadius).with(opacity);
set.addListener(mAnimationListener);
return set;
}
use of com.nineoldandroids.animation.AnimatorSet 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.AnimatorSet in project ListViewAnimations by nhaarman.
the class AnimateAdditionAdapter method getView.
@Override
@NonNull
public View getView(final int position, @Nullable final View convertView, @NonNull final ViewGroup parent) {
final View view = super.getView(position, convertView, parent);
if (mInsertQueue.getActiveIndexes().contains(position)) {
int widthMeasureSpec = View.MeasureSpec.makeMeasureSpec(ViewGroup.LayoutParams.MATCH_PARENT, View.MeasureSpec.AT_MOST);
int heightMeasureSpec = View.MeasureSpec.makeMeasureSpec(ViewGroup.LayoutParams.WRAP_CONTENT, View.MeasureSpec.UNSPECIFIED);
view.measure(widthMeasureSpec, heightMeasureSpec);
int originalHeight = view.getMeasuredHeight();
ValueAnimator heightAnimator = ValueAnimator.ofInt(1, originalHeight);
heightAnimator.addUpdateListener(new HeightUpdater(view));
Animator[] customAnimators = getAdditionalAnimators(view, parent);
Animator[] animators = new Animator[customAnimators.length + 1];
animators[0] = heightAnimator;
System.arraycopy(customAnimators, 0, animators, 1, customAnimators.length);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(animators);
ViewHelper.setAlpha(view, 0);
ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(view, ALPHA, 0, 1);
AnimatorSet allAnimatorsSet = new AnimatorSet();
allAnimatorsSet.playSequentially(animatorSet, alphaAnimator);
allAnimatorsSet.setDuration(mInsertionAnimationDurationMs);
allAnimatorsSet.addListener(new ExpandAnimationListener(position));
allAnimatorsSet.start();
}
return view;
}
use of com.nineoldandroids.animation.AnimatorSet in project ListViewAnimations by nhaarman.
the class SwipeTouchListener method restoreCurrentViewTranslation.
/**
* Animates the pending {@link android.view.View} back to its original position.
*/
private void restoreCurrentViewTranslation() {
if (mCurrentView == null) {
return;
}
ObjectAnimator xAnimator = ObjectAnimator.ofFloat(mSwipingView, TRANSLATION_X, 0);
ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(mSwipingView, ALPHA, 1);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(xAnimator, alphaAnimator);
animatorSet.setDuration(mAnimationTime);
animatorSet.addListener(new RestoreAnimatorListener(mCurrentView, mCurrentPosition));
animatorSet.start();
}
Aggregations