Render an animator to pulsate a view in place.
@param labelToAnimate the view to pulsate.
@return The animator object. Use .start() to begin.
186442
public static ObjectAnimator getPulseAnimator(View labelToAnimate, float decreaseRatio,
            float increaseRatio) {
        Keyframe k0 = Keyframe.ofFloat(0f, 1f);
        Keyframe k1 = Keyframe.ofFloat(0.275f, decreaseRatio);
        Keyframe k2 = Keyframe.ofFloat(0.69f, increaseRatio);
        Keyframe k3 = Keyframe.ofFloat(1f, 1f);

        PropertyValuesHolder scaleX = PropertyValuesHolder.ofKeyframe("scaleX", k0, k1, k2, k3);
        PropertyValuesHolder scaleY = PropertyValuesHolder.ofKeyframe("scaleY", k0, k1, k2, k3);
        ObjectAnimator pulseAnimator =
                ObjectAnimator.ofPropertyValuesHolder(labelToAnimate, scaleX, scaleY);
        pulseAnimator.setDuration(PULSE_ANIMATOR_DURATION);

        return pulseAnimator;
    }
1059079
public static AnimatedLabel createClassicSpinningLine(int speed) {
        AnimatedLabel animatedLabel = new AnimatedLabel("-");
        animatedLabel.addFrame("\\");
        animatedLabel.addFrame("|");
        animatedLabel.addFrame("/");
        animatedLabel.startAnimation(speed);
        return animatedLabel;
    }
1190826
public static DefaultTransitionController wrapAnimator(@NonNull Animator anim) {
        AnimatorSet set = new AnimatorSet();
        set.play(anim);
        return new DefaultTransitionController(set);
    }
930689
@Override
    public void animateTo(int x, int y) {
        // If no layout, delay this call
        if (!mMapView.isLayoutOccurred()) {
            mReplayController.animateTo(x, y);
            return;
        }

        if (!mMapView.isAnimating()) {
            mMapView.mIsFlinging = false;
            final int xStart = (int)mMapView.getMapScrollX();
            final int yStart = (int)mMapView.getMapScrollY();

            final int dx = x - mMapView.getWidth() / 2;
            final int dy = y - mMapView.getHeight() / 2;

            if (dx != xStart || dy != yStart) {
                mMapView.getScroller().startScroll(xStart, yStart, dx, dy, Configuration.getInstance().getAnimationSpeedDefault());
                mMapView.postInvalidate();
            }
        }
    }
390968
private Animator preparePulseAnimation() {
        AnimatorSet animation = new AnimatorSet();

        Animator firstBounce = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.CIRCLE_SCALE_PROPERTY,
                drawable.getCircleScale(), 0.88f);
        firstBounce.setDuration(300);
        firstBounce.setInterpolator(new CycleInterpolator(1));
        Animator secondBounce = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.CIRCLE_SCALE_PROPERTY,
                0.75f, 0.83f);
        secondBounce.setDuration(300);
        secondBounce.setInterpolator(new CycleInterpolator(1));
        Animator thirdBounce = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.CIRCLE_SCALE_PROPERTY,
                0.75f, 0.80f);
        thirdBounce.setDuration(300);
        thirdBounce.setInterpolator(new CycleInterpolator(1));

        animation.playSequentially(firstBounce, secondBounce, thirdBounce);
        return animation;
    }
1317290
public TransitionController addAnimatorAsTransition(@NonNull Animator mAnim) {
        AnimatorSet as = new AnimatorSet();
        as.play(mAnim);
        return addAnimatorSetAsTransition(null, as);
    }
90785
protected void layoutLabel ()
    {
        Graphics2D gfx = _mgr.createGraphics();
        if (gfx == null) {
            return;
        }
        try {
            gfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                 (_antiAliased) ?
                                 RenderingHints.VALUE_ANTIALIAS_ON :
                                 RenderingHints.VALUE_ANTIALIAS_OFF);
            _label.layout(gfx);
        } finally {
            gfx.dispose();
        }
    }
1049616
public static Label buildLabel(final String label) {
        return addLabel(Label.newBuilder(), Locale.getDefault(), label).build();
    }
1087728
public static Animation createAnimation(XmlReader node)
    {
        Check.notNull(node);

        final String name = node.readString(ANIMATION_NAME);
        final int start = node.readInteger(ANIMATION_START);
        final int end = node.readInteger(ANIMATION_END);
        final double speed = node.readDouble(ANIMATION_SPEED);
        final boolean reversed = node.readBoolean(ANIMATION_REVERSED);
        final boolean repeat = node.readBoolean(ANIMATION_REPEAT);

        return new Animation(name, start, end, speed, reversed, repeat);
    }
342090
public ActionListDialogBuilder addAction(final String label, final Runnable action) {
        return addAction(new Runnable() {
            @Override
            public String toString() {
                return label;
            }

            @Override
            public void run() {
                action.run();
            }
        });
    }
969070
@Override
    public void visitLabel(Label label) {
        if (enabled && handlers.containsKey(label)) {
            handlerPendingInstruction = label;
        }
        super.visitLabel(label);
    }
617498
public void startBackgroundIconRotateAnimation() {
        // init infinite animation of no animation was previously configured.
        if (backgroundRotateAnimation == null) {
            startForegroundIconRotateAnimation(0d, 360d, Animation.INDEFINITE, JFXConstants.ANIMATION_DURATION_ROTATION_DEFAULT, Interpolator.LINEAR, false);
            return;
        }
        backgroundRotateAnimation.play();
    }
176083
@Override
  public void start() {
    if (mIsRunning || mAnimationBackend == null || mAnimationBackend.getFrameCount() <= 1) {
      return;
    }
    mIsRunning = true;
    mStartTimeMs = now();
    mExpectedRenderTimeMs = mStartTimeMs;
    mLastFrameAnimationTimeMs = -1;
    mLastDrawnFrameNumber = -1;
    invalidateSelf();
    mAnimationListener.onAnimationStart(this);
  }
949613
private void animateView(final View target, final int type) {
        if(ANIMATION_EXPAND==type&&target.getVisibility()==VISIBLE){
            return;
        }
        if(ANIMATION_COLLAPSE==type&&target.getVisibility()!=VISIBLE){
            return;
        }
        if(mDefaultAnimExecutor !=null){
            mDefaultAnimExecutor.executeAnim(target,type);
        }

    }
98259
public final synchronized void setLabel(String label) {
        if(label == null) {
            throw new IllegalArgumentException("null label to a button is not allowed");
        }
        if(label.isEmpty()) {
            label = " ";
        }
        this.label = label;
        invalidate();
    }
228484
private Animator prepareStyle3Animation() {
        AnimatorSet animation = new AnimatorSet();

        ObjectAnimator progressAnimation = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.PROGRESS_PROPERTY, 0.75f, 0f);
        progressAnimation.setDuration(1200);
        progressAnimation.setInterpolator(new AnticipateInterpolator());

        Animator innerCircleAnimation = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.CIRCLE_SCALE_PROPERTY, 0.75f, 0f);
        innerCircleAnimation.setDuration(1200);
        innerCircleAnimation.setInterpolator(new AnticipateInterpolator());

        ObjectAnimator invertedProgress = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.PROGRESS_PROPERTY, 0f, 0.75f);
        invertedProgress.setDuration(1200);
        invertedProgress.setStartDelay(3200);
        invertedProgress.setInterpolator(new OvershootInterpolator());

        Animator invertedCircle = ObjectAnimator.ofFloat(drawable, CircularProgressDrawable.CIRCLE_SCALE_PROPERTY, 0f, 0.75f);
        invertedCircle.setDuration(1200);
        invertedCircle.setStartDelay(3200);
        invertedCircle.setInterpolator(new OvershootInterpolator());

        animation.playTogether(progressAnimation, innerCircleAnimation, invertedProgress, invertedCircle);
        return animation;
    }
374751
private Label createLabel(String label) {
        Pane pane = new Pane();
        root.addChild(pane);
        Label lbl = new Label();
        lbl.setName(label);
        pane.addChild(lbl);
        adjustPanes();
        return lbl;
    }