Example usage for android.view.animation Animation hasEnded

List of usage examples for android.view.animation Animation hasEnded

Introduction

In this page you can find the example usage for android.view.animation Animation hasEnded.

Prototype

public boolean hasEnded() 

Source Link

Document

Indicates whether this animation has ended or not.

Usage

From source file:com.google.android.apps.gutenberg.widget.TabLayout.java

private static boolean isAnimationRunning(Animation animation) {
    return animation != null && animation.hasStarted() && !animation.hasEnded();
}

From source file:org.edx.mobile.view.LoginActivity.java

@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
    Animation errorMessageAnim = errorLayout.getAnimation();
    if (errorMessageAnim == null || errorMessageAnim.hasEnded()) {
        ViewAnimationUtil.hideMessageBar(errorLayout);
    }//from   w ww. j a  va2 s  . c  o  m
    return super.dispatchTouchEvent(ev);
}

From source file:com.mobility.android.ui.widget.MaterialProgressDrawable.java

@Override
public boolean isRunning() {
    ArrayList<Animation> animators = mAnimators;
    int N = animators.size();
    for (int i = 0; i < N; i++) {
        Animation animator = animators.get(i);
        if (animator.hasStarted() && !animator.hasEnded()) {
            return true;
        }/*from   w w  w  .  j  a  v  a2s.c o  m*/
    }
    return false;
}

From source file:android.wuliqing.com.mylibrary.header.MaterialProgressDrawable.java

@Override
public boolean isRunning() {
    final ArrayList<Animation> animators = mAnimators;
    final int N = animators.size();
    for (int i = 0; i < N; i++) {
        final Animation animator = animators.get(i);
        if (animator.hasStarted() && !animator.hasEnded()) {
            return true;
        }//from w  ww . j a  v a 2 s .  com
    }
    return false;
}

From source file:cn.brision.football.view.ptr.header.MaterialProgressDrawable.java

@Override
public boolean isRunning() {
    final ArrayList<Animation> animators = mAnimators;
    final int size = animators.size();
    for (int i = 0; i < size; i++) {
        final Animation animator = animators.get(i);
        if (animator.hasStarted() && !animator.hasEnded()) {
            return true;
        }//from   w  ww.  ja v a 2  s . c  o  m
    }
    return false;
}

From source file:com.androidhuman.circlerefreshlayout.MaterialProgressDrawable.java

@Override
public boolean isRunning() {
    final ArrayList<Animation> animators = mAnimators;
    final int n = animators.size();
    for (int i = 0; i < n; i++) {
        final Animation animator = animators.get(i);
        if (animator.hasStarted() && !animator.hasEnded()) {
            return true;
        }/*from  www. j  av  a  2s  .  com*/
    }
    return false;
}

From source file:anabolicandroids.chanobol.util.swipebottom.SwipeRefreshLayoutBottom.java

private boolean isAnimationRunning(Animation animation) {
    return animation != null && animation.hasStarted() && !animation.hasEnded();
}

From source file:com.ray.appchallenge.view.SwipeRefreshLayoutBottom.java

private boolean isAnimationRunning(final Animation animation) {
    return animation != null && animation.hasStarted() && !animation.hasEnded();
}

From source file:org.appcelerator.titanium.view.TiUIView.java

/**
 * Animates the view if there are pending animations.
 *//*from w  ww . jav a  2s  .  c o  m*/
public void animate() {
    if (nativeView == null) {
        return;
    }

    // Pre-honeycomb, if one animation clobbers another you get a problem whereby the background of the
    // animated view's parent (or the grandparent) bleeds through.  It seems to improve if you cancel and clear
    // the older animation.  So here we cancel and clear, then re-queue the desired animation.
    if (Build.VERSION.SDK_INT < TiC.API_LEVEL_HONEYCOMB) {
        Animation currentAnimation = nativeView.getAnimation();
        if (currentAnimation != null && currentAnimation.hasStarted() && !currentAnimation.hasEnded()) {
            // Cancel existing animation and
            // re-queue desired animation.
            currentAnimation.cancel();
            nativeView.clearAnimation();
            proxy.handlePendingAnimation(true);
            return;
        }

    }

    TiAnimationBuilder builder = proxy.getPendingAnimation();
    if (builder == null) {
        return;
    }

    proxy.clearAnimation(builder);
    AnimationSet as = builder.render(proxy, nativeView);

    // If a view is "visible" but not currently seen (such as because it's covered or
    // its position is currently set to be fully outside its parent's region),
    // then Android might not animate it immediately because by default it animates
    // "on first frame" and apparently "first frame" won't happen right away if the
    // view has no visible rectangle on screen.  In that case invalidate its parent, which will
    // kick off the pending animation.
    boolean invalidateParent = false;
    ViewParent viewParent = nativeView.getParent();

    if (this.visibility == View.VISIBLE && viewParent instanceof View) {
        int width = nativeView.getWidth();
        int height = nativeView.getHeight();

        if (width == 0 || height == 0) {
            // Could be animating from nothing to something
            invalidateParent = true;
        } else {
            Rect r = new Rect(0, 0, width, height);
            Point p = new Point(0, 0);
            invalidateParent = !(viewParent.getChildVisibleRect(nativeView, r, p));
        }
    }

    Log.d(TAG, "starting animation: " + as, Log.DEBUG_MODE);
    nativeView.startAnimation(as);

    if (invalidateParent) {
        ((View) viewParent).postInvalidate();
    }
}

From source file:com.harry.refresh.SwipyRefreshLayout.java

private boolean isAnimationRunning(Animation animation) {
        return animation != null && animation.hasStarted() && !animation.hasEnded();
    }