Search in sources :

Example 41 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project ViewAnimator by florent37.

the class MainActivity method animateSequentially.

protected void animateSequentially() {
    ViewAnimator.animate(image).dp().width(100f, 150f).alpha(1, 0.1f).interpolator(new DecelerateInterpolator()).duration(800).thenAnimate(image).dp().width(150f, 100f).alpha(0.1f, 1f).interpolator(new AccelerateInterpolator()).duration(1200).start();
    ViewAnimator.animate(image).scaleX(0, 1).scaleY(0, 1).alpha(0, 1).decelerate().duration(500).thenAnimate(image).scaleX(1, 0).scaleY(1, 0).alpha(1, 0).accelerate().duration(500);
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator)

Example 42 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project cardslib by gabrielemariotti.

the class BaseActivity method onActionBarAutoShowOrHide.

protected void onActionBarAutoShowOrHide(boolean shown) {
    if (mStatusBarColorAnimator != null) {
        mStatusBarColorAnimator.cancel();
    }
    mStatusBarColorAnimator = ObjectAnimator.ofInt((mDrawerLayout != null) ? mDrawerLayout : mLPreviewUtils, (mDrawerLayout != null) ? "statusBarBackgroundColor" : "statusBarColor", shown ? Color.BLACK : mNormalStatusBarColor, shown ? mNormalStatusBarColor : Color.BLACK).setDuration(250);
    if (mDrawerLayout != null) {
        mStatusBarColorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                ViewCompat.postInvalidateOnAnimation(mDrawerLayout);
            }
        });
    }
    mStatusBarColorAnimator.setEvaluator(ARGB_EVALUATOR);
    mStatusBarColorAnimator.start();
    for (View view : mHideableHeaderViews) {
        if (shown) {
            view.animate().translationY(0).alpha(1).setDuration(HEADER_HIDE_ANIM_DURATION).setInterpolator(new DecelerateInterpolator());
        } else {
            view.animate().translationY(-view.getBottom()).alpha(0).setDuration(HEADER_HIDE_ANIM_DURATION).setInterpolator(new DecelerateInterpolator());
        }
    }
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ValueAnimator(android.animation.ValueAnimator) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 43 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project xUtils3 by wyouflf.

the class ImageAnimationHelper method fadeInDisplay.

public static void fadeInDisplay(final ImageView imageView, Drawable drawable) {
    AlphaAnimation fadeAnimation = new AlphaAnimation(0F, 1F);
    fadeAnimation.setDuration(300);
    fadeAnimation.setInterpolator(new DecelerateInterpolator());
    imageView.setImageDrawable(drawable);
    imageView.startAnimation(fadeAnimation);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 44 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project XobotOS by xamarin.

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++) {
                View child = 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(android.animation.ObjectAnimator) AnimatorSet(android.animation.AnimatorSet) ActionMenuView(com.android.internal.view.menu.ActionMenuView) TextView(android.widget.TextView) View(android.view.View)

Example 45 with DecelerateInterpolator

use of android.view.animation.DecelerateInterpolator in project ViewInspector by xfumihiro.

the class ViewInspectorToolbar method onAttachedToWindow.

@Override
protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    mToolbar = findViewById(R.id.toolbar);
    mToggleButton = (ImageButton) findViewById(R.id.toggle_menu);
    ImageButton buttonBoundaryMenu = (ImageButton) findViewById(R.id.outline_menu);
    ImageButton buttonLayerMenu = (ImageButton) findViewById(R.id.layer_menu);
    ImageButton buttonEventMenu = (ImageButton) findViewById(R.id.event_menu);
    ImageButton buttonSettingsMenu = (ImageButton) findViewById(R.id.settings_menu);
    mToolbar.setTranslationX(mToolbarWidth);
    ObjectAnimator animator = ObjectAnimator.ofFloat(mToolbar, "translationX", mToolbarWidth, mToolbarWidth - mToolbarClosedWidth);
    animator.setInterpolator(new DecelerateInterpolator());
    animator.start();
    mToggleButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            closeMenu();
            toggleToolbar();
        }
    });
    buttonBoundaryMenu.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!(mMenu instanceof BoundaryMenu)) {
                closeMenu();
                mMenu = new BoundaryMenu(mContext);
                windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
            } else {
                closeMenu();
            }
        }
    });
    buttonLayerMenu.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!(mMenu instanceof LayerMenu)) {
                closeMenu();
                mMenu = new LayerMenu(mContext);
                windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
            } else {
                closeMenu();
            }
        }
    });
    buttonEventMenu.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!(mMenu instanceof EventMenu)) {
                closeMenu();
                mMenu = new EventMenu(mContext);
                windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
            } else {
                closeMenu();
            }
        }
    });
    buttonSettingsMenu.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!(mMenu instanceof SettingsMenu)) {
                closeMenu();
                mMenu = new SettingsMenu(mContext);
                windowManager.addView(mMenu, BaseMenu.createLayoutParams(mContext));
            } else {
                closeMenu();
            }
        }
    });
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ImageButton(android.widget.ImageButton) SettingsMenu(view_inspector.ui.menu.SettingsMenu) ObjectAnimator(android.animation.ObjectAnimator) EventMenu(view_inspector.ui.menu.EventMenu) LayerMenu(view_inspector.ui.menu.LayerMenu) View(android.view.View) BoundaryMenu(view_inspector.ui.menu.BoundaryMenu)

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