use of android.animation.ObjectAnimator in project Depth-LIB-Android- by danielzeller.
the class RootActivity method fadeColoTo.
private void fadeColoTo(int newColor, TextView view) {
ObjectAnimator color = ObjectAnimator.ofObject(view, "TextColor", new ArgbEvaluator(), view.getCurrentTextColor(), newColor);
color.setDuration(200);
color.start();
}
use of android.animation.ObjectAnimator in project MaterialShowcaseView by deano2390.
the class AnimationFactory method fadeOutView.
@Override
public void fadeOutView(View target, long duration, final AnimationEndListener listener) {
ObjectAnimator oa = ObjectAnimator.ofFloat(target, ALPHA, INVISIBLE);
oa.setDuration(duration).addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
listener.onAnimationEnd();
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
oa.start();
}
use of android.animation.ObjectAnimator in project circular-progress-button by dmytrodanylyk.
the class MorphingAnimation method start.
public void start() {
ValueAnimator widthAnimation = ValueAnimator.ofInt(mFromWidth, mToWidth);
final GradientDrawable gradientDrawable = mDrawable.getGradientDrawable();
widthAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
Integer value = (Integer) animation.getAnimatedValue();
int leftOffset;
int rightOffset;
int padding;
if (mFromWidth > mToWidth) {
leftOffset = (mFromWidth - value) / 2;
rightOffset = mFromWidth - leftOffset;
padding = (int) (mPadding * animation.getAnimatedFraction());
} else {
leftOffset = (mToWidth - value) / 2;
rightOffset = mToWidth - leftOffset;
padding = (int) (mPadding - mPadding * animation.getAnimatedFraction());
}
gradientDrawable.setBounds(leftOffset + padding, padding, rightOffset - padding, mView.getHeight() - padding);
}
});
ObjectAnimator bgColorAnimation = ObjectAnimator.ofInt(gradientDrawable, "color", mFromColor, mToColor);
bgColorAnimation.setEvaluator(new ArgbEvaluator());
ObjectAnimator strokeColorAnimation = ObjectAnimator.ofInt(mDrawable, "strokeColor", mFromStrokeColor, mToStrokeColor);
strokeColorAnimation.setEvaluator(new ArgbEvaluator());
ObjectAnimator cornerAnimation = ObjectAnimator.ofFloat(gradientDrawable, "cornerRadius", mFromCornerRadius, mToCornerRadius);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.setDuration(mDuration);
animatorSet.playTogether(widthAnimation, bgColorAnimation, strokeColorAnimation, cornerAnimation);
animatorSet.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
if (mListener != null) {
mListener.onAnimationEnd();
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
animatorSet.start();
}
use of android.animation.ObjectAnimator in project UltimateAndroid by cymcsg.
the class MenuCircleShowingAnimation method closePromotedActions.
/**
* Set close animation for promoted actions
*/
public AnimatorSet closePromotedActions() {
if (objectAnimator == null) {
objectAnimatorSetup();
}
AnimatorSet animation = new AnimatorSet();
for (int i = 0; i < promotedActions.size(); i++) {
objectAnimator[i] = setCloseAnimation(promotedActions.get(i), i);
}
if (objectAnimator.length == 0) {
objectAnimator = null;
}
animation.playTogether(objectAnimator);
animation.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
mainImageButton.startAnimation(rotateCloseAnimation);
mainImageButton.setClickable(false);
}
@Override
public void onAnimationEnd(Animator animator) {
mainImageButton.setClickable(true);
hidePromotedActions();
}
@Override
public void onAnimationCancel(Animator animator) {
mainImageButton.setClickable(true);
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
return animation;
}
use of android.animation.ObjectAnimator in project UltimateAndroid by cymcsg.
the class MenuCircleShowingAnimation method openPromotedActions.
public AnimatorSet openPromotedActions() {
if (objectAnimator == null) {
objectAnimatorSetup();
}
AnimatorSet animation = new AnimatorSet();
for (int i = 0; i < promotedActions.size(); i++) {
objectAnimator[i] = setOpenAnimation(promotedActions.get(i), i);
}
if (objectAnimator.length == 0) {
objectAnimator = null;
}
animation.playTogether(objectAnimator);
animation.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
mainImageButton.startAnimation(rotateOpenAnimation);
mainImageButton.setClickable(false);
showPromotedActions();
}
@Override
public void onAnimationEnd(Animator animator) {
mainImageButton.setClickable(true);
}
@Override
public void onAnimationCancel(Animator animator) {
mainImageButton.setClickable(true);
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
return animation;
}
Aggregations