Search in sources :

Example 71 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project Libraries-for-Android-Developers by eoecn.

the class XListView method initWithContext.

private void initWithContext(Context context) {
    mScroller = new Scroller(context, new DecelerateInterpolator());
    // XListView need the scroll event, and it will dispatch the event to
    // user's listener (as a proxy).
    super.setOnScrollListener(this);
    // init header view
    mHeaderView = new XListViewHeader(context);
    mHeaderViewContent = (RelativeLayout) mHeaderView.findViewById(R.id.xlistview_header_content);
    mHeaderTimeView = (TextView) mHeaderView.findViewById(R.id.xlistview_header_time);
    addHeaderView(mHeaderView);
    // init footer view
    mFooterView = new XListViewFooter(context);
    // init header height
    mHeaderView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {

        @SuppressWarnings("deprecation")
        @Override
        public void onGlobalLayout() {
            mHeaderViewHeight = mHeaderViewContent.getHeight();
            getViewTreeObserver().removeGlobalOnLayoutListener(this);
        }
    });
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) OnGlobalLayoutListener(android.view.ViewTreeObserver.OnGlobalLayoutListener)

Example 72 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project AndroidTraining by mixi-inc.

the class ActionBarContextView method makeOutAnimation.

private Animator makeOutAnimation() {
    ObjectAnimator buttonAnimator = ObjectAnimator.ofFloat(mClose, "translationX", -mClose.getWidth() - ((MarginLayoutParams) mClose.getLayoutParams()).leftMargin);
    buttonAnimator.setDuration(200);
    buttonAnimator.addListener(this);
    buttonAnimator.setInterpolator(new DecelerateInterpolator());
    AnimatorSet set = new AnimatorSet();
    AnimatorSet.Builder b = set.play(buttonAnimator);
    if (mMenuView != null) {
        final int count = mMenuView.getChildCount();
        if (count > 0) {
            for (int i = 0; i < 0; i++) {
                AnimatorProxy child = AnimatorProxy.wrap(mMenuView.getChildAt(i));
                child.setScaleY(0);
                ObjectAnimator a = ObjectAnimator.ofFloat(child, "scaleY", 0);
                a.setDuration(100);
                a.setStartDelay(i * 70);
                b.with(a);
            }
        }
    }
    return set;
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ObjectAnimator(com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.actionbarsherlock.internal.nineoldandroids.animation.AnimatorSet) AnimatorProxy(com.actionbarsherlock.internal.nineoldandroids.view.animation.AnimatorProxy)

Example 73 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project AndroidTraining by mixi-inc.

the class ActionBarContextView method makeInAnimation.

private Animator makeInAnimation() {
    mClose.setTranslationX(-mClose.getWidth() - ((MarginLayoutParams) mClose.getLayoutParams()).leftMargin);
    ObjectAnimator buttonAnimator = ObjectAnimator.ofFloat(mClose, "translationX", 0);
    buttonAnimator.setDuration(200);
    buttonAnimator.addListener(this);
    buttonAnimator.setInterpolator(new DecelerateInterpolator());
    AnimatorSet set = new AnimatorSet();
    AnimatorSet.Builder b = set.play(buttonAnimator);
    if (mMenuView != null) {
        final int count = mMenuView.getChildCount();
        if (count > 0) {
            for (int i = count - 1, j = 0; i >= 0; i--, j++) {
                AnimatorProxy child = AnimatorProxy.wrap(mMenuView.getChildAt(i));
                child.setScaleY(0);
                ObjectAnimator a = ObjectAnimator.ofFloat(child, "scaleY", 0, 1);
                a.setDuration(100);
                a.setStartDelay(j * 70);
                b.with(a);
            }
        }
    }
    return set;
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ObjectAnimator(com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.actionbarsherlock.internal.nineoldandroids.animation.AnimatorSet) AnimatorProxy(com.actionbarsherlock.internal.nineoldandroids.view.animation.AnimatorProxy)

Example 74 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project nmid-headline by miao1007.

the class Animations method FadeOut.

public static Animation FadeOut() {
    Animation anim = new AlphaAnimation(1, 0);
    anim.setInterpolator(new DecelerateInterpolator());
    anim.setDuration(500);
    return anim;
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 75 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project nmid-headline by miao1007.

the class Animations method FadeIn.

public static Animation FadeIn() {
    Animation anim = new AlphaAnimation(0, 1);
    anim.setInterpolator(new DecelerateInterpolator());
    anim.setDuration(500);
    return anim;
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AlphaAnimation(android.view.animation.AlphaAnimation) Animation(android.view.animation.Animation) AlphaAnimation(android.view.animation.AlphaAnimation)

Aggregations

DecelerateInterpolator (android.view.animation.DecelerateInterpolator)312 ObjectAnimator (android.animation.ObjectAnimator)80 Animator (android.animation.Animator)66 ValueAnimator (android.animation.ValueAnimator)59 View (android.view.View)58 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)55 AnimatorSet (android.animation.AnimatorSet)52 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)36 ImageView (android.widget.ImageView)32 AlphaAnimation (android.view.animation.AlphaAnimation)30 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)29 Animation (android.view.animation.Animation)21 TextView (android.widget.TextView)20 Point (android.graphics.Point)18 ValueAnimator (com.nineoldandroids.animation.ValueAnimator)18 Paint (android.graphics.Paint)14 LinearInterpolator (android.view.animation.LinearInterpolator)14 ScaleAnimation (android.view.animation.ScaleAnimation)14 AnimatorSet (com.actionbarsherlock.internal.nineoldandroids.animation.AnimatorSet)14 ObjectAnimator (com.actionbarsherlock.internal.nineoldandroids.animation.ObjectAnimator)14