Search in sources :

Example 21 with ObjectAnimator

use of com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator in project httpclient by pixmob.

the class AbsActionBarView method animateToVisibility.

public void animateToVisibility(int visibility) {
    if (mVisibilityAnim != null) {
        mVisibilityAnim.cancel();
    }
    if (visibility == VISIBLE) {
        if (getVisibility() != VISIBLE) {
            setAlpha(0);
            if (mSplitView != null && mMenuView != null) {
                mMenuView.setAlpha(0);
            }
        }
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 1);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        if (mSplitView != null && mMenuView != null) {
            AnimatorSet set = new AnimatorSet();
            ObjectAnimator splitAnim = ObjectAnimator.ofFloat(mMenuView, "alpha", 1);
            splitAnim.setDuration(FADE_DURATION);
            set.addListener(mVisAnimListener.withFinalVisibility(visibility));
            set.play(anim).with(splitAnim);
            set.start();
        } else {
            anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
            anim.start();
        }
    } else {
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 0);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        if (mSplitView != null && mMenuView != null) {
            AnimatorSet set = new AnimatorSet();
            ObjectAnimator splitAnim = ObjectAnimator.ofFloat(mMenuView, "alpha", 0);
            splitAnim.setDuration(FADE_DURATION);
            set.addListener(mVisAnimListener.withFinalVisibility(visibility));
            set.play(anim).with(splitAnim);
            set.start();
        } else {
            anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
            anim.start();
        }
    }
}
Also used : ObjectAnimator(com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.actionbarsherlock.internal.nineoldandroids.animation.AnimatorSet)

Example 22 with ObjectAnimator

use of com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator in project AndroidTraining by mixi-inc.

the class ScrollingTabContainerView method animateToVisibility.

public void animateToVisibility(int visibility) {
    if (mVisibilityAnim != null) {
        mVisibilityAnim.cancel();
    }
    if (visibility == VISIBLE) {
        if (getVisibility() != VISIBLE) {
            setAlpha(0);
        }
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 1);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
        anim.start();
    } else {
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 0);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
        anim.start();
    }
}
Also used : ObjectAnimator(com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator)

Example 23 with ObjectAnimator

use of com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator in project AndroidTraining by mixi-inc.

the class AbsActionBarView method animateToVisibility.

public void animateToVisibility(int visibility) {
    if (mVisibilityAnim != null) {
        mVisibilityAnim.cancel();
    }
    if (visibility == VISIBLE) {
        if (getVisibility() != VISIBLE) {
            setAlpha(0);
            if (mSplitView != null && mMenuView != null) {
                mMenuView.setAlpha(0);
            }
        }
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 1);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        if (mSplitView != null && mMenuView != null) {
            AnimatorSet set = new AnimatorSet();
            ObjectAnimator splitAnim = ObjectAnimator.ofFloat(mMenuView, "alpha", 1);
            splitAnim.setDuration(FADE_DURATION);
            set.addListener(mVisAnimListener.withFinalVisibility(visibility));
            set.play(anim).with(splitAnim);
            set.start();
        } else {
            anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
            anim.start();
        }
    } else {
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 0);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        if (mSplitView != null && mMenuView != null) {
            AnimatorSet set = new AnimatorSet();
            ObjectAnimator splitAnim = ObjectAnimator.ofFloat(mMenuView, "alpha", 0);
            splitAnim.setDuration(FADE_DURATION);
            set.addListener(mVisAnimListener.withFinalVisibility(visibility));
            set.play(anim).with(splitAnim);
            set.start();
        } else {
            anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
            anim.start();
        }
    }
}
Also used : ObjectAnimator(com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.actionbarsherlock.internal.nineoldandroids.animation.AnimatorSet)

Example 24 with ObjectAnimator

use of com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator in project ActionBarSherlock by JakeWharton.

the class ScrollingTabContainerView method animateToVisibility.

public void animateToVisibility(int visibility) {
    if (mVisibilityAnim != null) {
        mVisibilityAnim.cancel();
    }
    if (visibility == VISIBLE) {
        if (getVisibility() != VISIBLE) {
            setAlpha(0);
        }
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 1);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
        anim.start();
    } else {
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 0);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
        anim.start();
    }
}
Also used : ObjectAnimator(com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator)

Example 25 with ObjectAnimator

use of com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator in project ActionBarSherlock by JakeWharton.

the class AbsActionBarView method animateToVisibility.

public void animateToVisibility(int visibility) {
    if (mVisibilityAnim != null) {
        mVisibilityAnim.cancel();
    }
    if (visibility == VISIBLE) {
        if (getVisibility() != VISIBLE) {
            setAlpha(0);
            if (mSplitView != null && mMenuView != null) {
                mMenuView.setAlpha(0);
            }
        }
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 1);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        if (mSplitView != null && mMenuView != null) {
            AnimatorSet set = new AnimatorSet();
            ObjectAnimator splitAnim = ObjectAnimator.ofFloat(mMenuView, "alpha", 1);
            splitAnim.setDuration(FADE_DURATION);
            set.addListener(mVisAnimListener.withFinalVisibility(visibility));
            set.play(anim).with(splitAnim);
            set.start();
        } else {
            anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
            anim.start();
        }
    } else {
        ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 0);
        anim.setDuration(FADE_DURATION);
        anim.setInterpolator(sAlphaInterpolator);
        if (mSplitView != null && mMenuView != null) {
            AnimatorSet set = new AnimatorSet();
            ObjectAnimator splitAnim = ObjectAnimator.ofFloat(mMenuView, "alpha", 0);
            splitAnim.setDuration(FADE_DURATION);
            set.addListener(mVisAnimListener.withFinalVisibility(visibility));
            set.play(anim).with(splitAnim);
            set.start();
        } else {
            anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
            anim.start();
        }
    }
}
Also used : ObjectAnimator(com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.actionbarsherlock.internal.nineoldandroids.animation.AnimatorSet)

Aggregations

ObjectAnimator (com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator)28 AnimatorSet (com.actionbarsherlock.internal.nineoldandroids.animation.AnimatorSet)21 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)14 AnimatorProxy (com.actionbarsherlock.internal.nineoldandroids.view.animation.AnimatorProxy)14