android.animation.ObjectAnimator.ofFloat()

Here are the examples of the java api android.animation.ObjectAnimator.ofFloat() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1425 Examples 7

19 Source : SegueViewChangeHandler.java
with Apache License 2.0
from Zhuinden

@Override
protected Animator createAnimator(@Nonnull View from, @Nonnull View to, int direction) {
    int fromTranslation = (-1) * direction * from.getWidth();
    int toTranslation = direction * to.getWidth();
    AnimatorSet set = new AnimatorSet();
    set.play(ObjectAnimator.ofFloat(from, "translationX", fromTranslation));
    set.play(ObjectAnimator.ofFloat(to, "translationX", toTranslation, 0));
    return set;
}

19 Source : FadeViewChangeHandler.java
with Apache License 2.0
from Zhuinden

@Override
protected Animator createAnimator(@Nonnull View previousView, @Nonnull View newView, int direction) {
    AnimatorSet set = new AnimatorSet();
    set.play(ObjectAnimator.ofFloat(previousView, "alpha", 1, 0));
    set.play(ObjectAnimator.ofFloat(newView, "alpha", 0, 1));
    return set;
}

19 Source : SegueViewChangeHandler.java
with Apache License 2.0
from Zhuinden

@Override
protected Animator createAnimator(@NonNull View from, @NonNull View to, int direction) {
    int fromTranslation = (-1) * direction * from.getWidth();
    int toTranslation = direction * to.getWidth();
    AnimatorSet set = new AnimatorSet();
    set.play(ObjectAnimator.ofFloat(from, "translationX", fromTranslation));
    set.play(ObjectAnimator.ofFloat(to, "translationX", toTranslation, 0));
    return set;
}

19 Source : FadeViewChangeHandler.java
with Apache License 2.0
from Zhuinden

@Override
protected Animator createAnimator(@NonNull View previousView, @NonNull View newView, int direction) {
    AnimatorSet set = new AnimatorSet();
    set.play(ObjectAnimator.ofFloat(previousView, "alpha", 1, 0));
    set.play(ObjectAnimator.ofFloat(newView, "alpha", 0, 1));
    return set;
}

19 Source : InContentAnim.java
with GNU General Public License v3.0
from z-chu

public void start() {
    if (contentView.getVisibility() != View.VISIBLE) {
        if (set == null) {
            set = new AnimatorSet();
            ObjectAnimator contentFadeIn = ObjectAnimator.ofFloat(contentView, View.ALPHA, 0f, 1f);
            ObjectAnimator contentTranslateIn = ObjectAnimator.ofFloat(contentView, View.TRANSLATION_Y, ANIM_TRANSLATE_Y, 0);
            ObjectAnimator loadingFadeOut = ObjectAnimator.ofFloat(loadingView, View.ALPHA, 1f, 0f);
            ObjectAnimator loadingTranslateOut = ObjectAnimator.ofFloat(loadingView, View.TRANSLATION_Y, 0, -ANIM_TRANSLATE_Y);
            set.playTogether(contentFadeIn, contentTranslateIn, loadingFadeOut, loadingTranslateOut);
            set.setDuration(ANIM_TIME_LONG);
            set.addListener(new AnimatorListenerAdapter() {

                @Override
                public void onAnimationStart(Animator animation) {
                    contentView.setTranslationY(0);
                    contentView.setVisibility(View.VISIBLE);
                    loadingView.setTranslationY(0);
                }

                @Override
                public void onAnimationEnd(Animator animation) {
                    contentView.setTranslationY(0);
                    loadingView.setTranslationY(0);
                    loadingView.setVisibility(View.GONE);
                    // For future showLoading calls
                    loadingView.setAlpha(1f);
                }
            });
        } else {
            loadingView.setVisibility(View.GONE);
        }
        set.start();
    }
}

19 Source : NumAnim.java
with Apache License 2.0
from Yuphee

public void start(View view) {
    if (lastAnimator != null) {
        lastAnimator.removeAllListeners();
        lastAnimator.end();
        lastAnimator.cancel();
    }
    ObjectAnimator animX = ObjectAnimator.ofFloat(view, "scaleX", 1.6f, 1.0f);
    ObjectAnimator animY = ObjectAnimator.ofFloat(view, "scaleY", 1.6f, 1.0f);
    AnimatorSet animSet = new AnimatorSet();
    lastAnimator = animSet;
    animSet.setDuration(400);
    animSet.setInterpolator(new OvershootInterpolator());
    animSet.playTogether(animX, animY);
    animSet.start();
}

19 Source : AnimationFactory.java
with Apache License 2.0
from yuanhoujun

public static Animator emptyAnimator() {
    Animator animator = ObjectAnimator.ofFloat(null, "alpha", 255, 255);
    animator.setDuration(0);
    return animator;
}

19 Source : StaggeredDistanceSlide.java
with Apache License 2.0
from yongjhih

private Animator createAnimator(final View view, float startTranslationY, float endTranslationY) {
    view.setTranslationY(startTranslationY);
    final List<Boolean> ancestralClipping = TransitionUtils.setAncestralClipping(view, false);
    Animator transition = ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, endTranslationY);
    transition.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            TransitionUtils.restoreAncestralClipping(view, ancestralClipping);
        }
    });
    return transition;
}

19 Source : LiftOff.java
with Apache License 2.0
from yongjhih

@Override
public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues, TransitionValues endValues) {
    return ObjectAnimator.ofFloat(endValues.view, View.TRANSLATION_Z, initialElevation, finalElevation);
}

19 Source : SpotsDialog.java
with Apache License 2.0
from yibulaxi

private Animator[] createAnimations() {
    Animator[] animators = new Animator[size];
    for (int i = 0; i < spots.length; i++) {
        Animator move = ObjectAnimator.ofFloat(spots[i], "xFactor", 0, 1);
        move.setDuration(DURATION);
        move.setInterpolator(new HesitateInterpolator());
        move.setStartDelay(DELAY * i);
        animators[i] = move;
    }
    return animators;
}

19 Source : ZoomOutUpAnimator.java
with Apache License 2.0
from yibulaxi

@Override
protected void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 1, 0), ObjectAnimator.ofFloat(target, "scaleX", 1, 0.475f, 0.1f), ObjectAnimator.ofFloat(target, "scaleY", 1, 0.475f, 0.1f), ObjectAnimator.ofFloat(target, "translationY", 0, 60, -target.getBottom()));
}

19 Source : ZoomOutRightAnimator.java
with Apache License 2.0
from yibulaxi

@Override
protected void prepare(View target) {
    ViewGroup parent = (ViewGroup) target.getParent();
    int distance = parent.getWidth() - parent.getLeft();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 1, 0), ObjectAnimator.ofFloat(target, "scaleX", 1, 0.475f, 0.1f), ObjectAnimator.ofFloat(target, "scaleY", 1, 0.475f, 0.1f), ObjectAnimator.ofFloat(target, "translationX", 0, -42, distance));
}

19 Source : ZoomOutLeftAnimator.java
with Apache License 2.0
from yibulaxi

@Override
protected void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 1, 0), ObjectAnimator.ofFloat(target, "scaleX", 1, 0.475f, 0.1f), ObjectAnimator.ofFloat(target, "scaleY", 1, 0.475f, 0.1f), ObjectAnimator.ofFloat(target, "translationX", 0, 42, -target.getRight()));
}

19 Source : ZoomOutDownAnimator.java
with Apache License 2.0
from yibulaxi

@Override
protected void prepare(View target) {
    ViewGroup parent = (ViewGroup) target.getParent();
    int distance = parent.getHeight() - target.getTop();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 1, 0), ObjectAnimator.ofFloat(target, "scaleX", 1, 0.475f, 0.1f), ObjectAnimator.ofFloat(target, "scaleY", 1, 0.475f, 0.1f), ObjectAnimator.ofFloat(target, "translationY", 0, -60, distance));
}

19 Source : ZoomOutAnimator.java
with Apache License 2.0
from yibulaxi

@Override
protected void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0, 0), ObjectAnimator.ofFloat(target, "scaleX", 1, 0.3f, 0), ObjectAnimator.ofFloat(target, "scaleY", 1, 0.3f, 0));
}

19 Source : ZoomInUpAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    ViewGroup parent = (ViewGroup) target.getParent();
    int distance = parent.getHeight() - target.getTop();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1), ObjectAnimator.ofFloat(target, "scaleX", 0.1f, 0.475f, 1), ObjectAnimator.ofFloat(target, "scaleY", 0.1f, 0.475f, 1), ObjectAnimator.ofFloat(target, "translationY", distance, -60, 0));
}

19 Source : ZoomInRightAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "scaleX", 0.1f, 0.475f, 1), ObjectAnimator.ofFloat(target, "scaleY", 0.1f, 0.475f, 1), ObjectAnimator.ofFloat(target, "translationX", target.getWidth() + target.getPaddingRight(), -48, 0), ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1));
}

19 Source : ZoomInLeftAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "scaleX", 0.1f, 0.475f, 1), ObjectAnimator.ofFloat(target, "scaleY", 0.1f, 0.475f, 1), ObjectAnimator.ofFloat(target, "translationX", -target.getRight(), 48, 0), ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1));
}

19 Source : ZoomInDownAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "scaleX", 0.1f, 0.475f, 1), ObjectAnimator.ofFloat(target, "scaleY", 0.1f, 0.475f, 1), ObjectAnimator.ofFloat(target, "translationY", -target.getBottom(), 60, 0), ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1));
}

19 Source : ZoomInAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "scaleX", 0.45f, 1), ObjectAnimator.ofFloat(target, "scaleY", 0.45f, 1), ObjectAnimator.ofFloat(target, "alpha", 0, 1));
}

19 Source : RollOutAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "translationX", 0, target.getWidth()), ObjectAnimator.ofFloat(target, "rotation", 0, 120));
}

19 Source : RollInAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 0, 1), ObjectAnimator.ofFloat(target, "translationX", -(target.getWidth() - target.getPaddingLeft() - target.getPaddingRight()), 0), ObjectAnimator.ofFloat(target, "rotation", -120, 0));
}

19 Source : TakingOffAnimator.java
with Apache License 2.0
from yibulaxi

@Override
protected void prepare(View target) {
    getAnimatorAgent().playTogether(Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "scaleX", 1f, 1.5f)), Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "scaleY", 1f, 1.5f)), Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "alpha", 1, 0)));
}

19 Source : LandingAnimator.java
with Apache License 2.0
from yibulaxi

@Override
protected void prepare(View target) {
    getAnimatorAgent().playTogether(Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "scaleX", 1.5f, 1f)), Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "scaleY", 1.5f, 1f)), Glider.glide(Skill.QuintEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "alpha", 0, 1f)));
}

19 Source : DropOutAnimator.java
with Apache License 2.0
from yibulaxi

@Override
protected void prepare(View target) {
    int distance = target.getTop() + target.getHeight();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 0, 1), Glider.glide(Skill.BounceEaseOut, getDuration(), ObjectAnimator.ofFloat(target, "translationY", -distance, 0)));
}

19 Source : HingeAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    float x = target.getPaddingLeft();
    float y = target.getPaddingTop();
    getAnimatorAgent().playTogether(Glider.glide(Skill.SineEaseInOut, 1300, ObjectAnimator.ofFloat(target, "rotation", 0, 80, 60, 80, 60, 60)), ObjectAnimator.ofFloat(target, "translationY", 0, 0, 0, 0, 0, 700), ObjectAnimator.ofFloat(target, "alpha", 1, 1, 1, 1, 1, 0), ObjectAnimator.ofFloat(target, "pivotX", x, x, x, x, x, x), ObjectAnimator.ofFloat(target, "pivotY", y, y, y, y, y, y));
    setDuration(1300);
}

19 Source : SlideOutUpAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "translationY", 0, -target.getBottom()));
}

19 Source : SlideOutRightAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    ViewGroup parent = (ViewGroup) target.getParent();
    int distance = parent.getWidth() - target.getLeft();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "translationX", 0, distance));
}

19 Source : SlideOutLeftAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "translationX", 0, -target.getRight()));
}

19 Source : SlideOutDownAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    ViewGroup parent = (ViewGroup) target.getParent();
    int distance = parent.getHeight() - target.getTop();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "translationY", 0, distance));
}

19 Source : SlideInUpAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    ViewGroup parent = (ViewGroup) target.getParent();
    int distance = parent.getHeight() - target.getTop();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 0, 1), ObjectAnimator.ofFloat(target, "translationY", distance, 0));
}

19 Source : SlideInRightAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    ViewGroup parent = (ViewGroup) target.getParent();
    int distance = parent.getWidth() - target.getLeft();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 0, 1), ObjectAnimator.ofFloat(target, "translationX", distance, 0));
}

19 Source : SlideInLeftAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    ViewGroup parent = (ViewGroup) target.getParent();
    int distance = parent.getWidth() - target.getLeft();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 0, 1), ObjectAnimator.ofFloat(target, "translationX", -distance, 0));
}

19 Source : SlideInDownAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    int distance = target.getTop() + target.getHeight();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 0, 1), ObjectAnimator.ofFloat(target, "translationY", -distance, 0));
}

19 Source : RotateOutUpRightAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    float x = target.getWidth() - target.getPaddingRight();
    float y = target.getHeight() - target.getPaddingBottom();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "rotation", 0, 90), ObjectAnimator.ofFloat(target, "pivotX", x, x), ObjectAnimator.ofFloat(target, "pivotY", y, y));
}

19 Source : RotateOutUpLeftAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    float x = target.getPaddingLeft();
    float y = target.getHeight() - target.getPaddingBottom();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "rotation", 0, -90), ObjectAnimator.ofFloat(target, "pivotX", x, x), ObjectAnimator.ofFloat(target, "pivotY", y, y));
}

19 Source : RotateOutDownRightAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    float x = target.getWidth() - target.getPaddingRight();
    float y = target.getHeight() - target.getPaddingBottom();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "rotation", 0, -90), ObjectAnimator.ofFloat(target, "pivotX", x, x), ObjectAnimator.ofFloat(target, "pivotY", y, y));
}

19 Source : RotateOutDownLeftAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    float x = target.getPaddingLeft();
    float y = target.getHeight() - target.getPaddingBottom();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "rotation", 0, 90), ObjectAnimator.ofFloat(target, "pivotX", x, x), ObjectAnimator.ofFloat(target, "pivotY", y, y));
}

19 Source : RotateOutAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "rotation", 0, 200));
}

19 Source : RotateInUpRightAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    float x = target.getWidth() - target.getPaddingRight();
    float y = target.getHeight() - target.getPaddingBottom();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "rotation", -90, 0), ObjectAnimator.ofFloat(target, "alpha", 0, 1), ObjectAnimator.ofFloat(target, "pivotX", x, x), ObjectAnimator.ofFloat(target, "pivotY", y, y));
}

19 Source : RotateInUpLeftAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    float x = target.getPaddingLeft();
    float y = target.getHeight() - target.getPaddingBottom();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "rotation", 90, 0), ObjectAnimator.ofFloat(target, "alpha", 0, 1), ObjectAnimator.ofFloat(target, "pivotX", x, x), ObjectAnimator.ofFloat(target, "pivotY", y, y));
}

19 Source : RotateInDownRightAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    float x = target.getWidth() - target.getPaddingRight();
    float y = target.getHeight() - target.getPaddingBottom();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "rotation", 90, 0), ObjectAnimator.ofFloat(target, "alpha", 0, 1), ObjectAnimator.ofFloat(target, "pivotX", x, x), ObjectAnimator.ofFloat(target, "pivotY", y, y));
}

19 Source : RotateInDownLeftAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    float x = target.getPaddingLeft();
    float y = target.getHeight() - target.getPaddingBottom();
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "rotation", -90, 0), ObjectAnimator.ofFloat(target, "alpha", 0, 1), ObjectAnimator.ofFloat(target, "pivotX", x, x), ObjectAnimator.ofFloat(target, "pivotY", y, y));
}

19 Source : RotateInAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "rotation", -200, 0), ObjectAnimator.ofFloat(target, "alpha", 0, 1));
}

19 Source : FlipOutYAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "rotationY", 0, 90), ObjectAnimator.ofFloat(target, "alpha", 1, 0));
}

19 Source : FlipOutXAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "rotationX", 0, 90), ObjectAnimator.ofFloat(target, "alpha", 1, 0));
}

19 Source : FlipInYAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "rotationY", 90, -15, 15, 0), ObjectAnimator.ofFloat(target, "alpha", 0.25f, 0.5f, 0.75f, 1));
}

19 Source : FlipInXAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "rotationX", 90, -15, 15, 0), ObjectAnimator.ofFloat(target, "alpha", 0.25f, 0.5f, 0.75f, 1));
}

19 Source : FadeOutUpAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "translationY", 0, -target.getHeight() / 4));
}

19 Source : FadeOutRightAnimator.java
with Apache License 2.0
from yibulaxi

@Override
public void prepare(View target) {
    getAnimatorAgent().playTogether(ObjectAnimator.ofFloat(target, "alpha", 1, 0), ObjectAnimator.ofFloat(target, "translationX", 0, target.getWidth() / 4));
}

See More Examples