Search in sources :

Example 66 with OvershootInterpolator

use of android.view.animation.OvershootInterpolator in project mosby by sockeqwe.

the class MailsFragment method showContent.

@Override
public void showContent() {
    super.showContent();
    if (createMailButton.getVisibility() != View.VISIBLE) {
        createMailButton.setVisibility(View.VISIBLE);
        if (!isRestoringViewState()) {
            PropertyValuesHolder holderX = PropertyValuesHolder.ofFloat("scaleX", 0, 1);
            PropertyValuesHolder holderY = PropertyValuesHolder.ofFloat("scaleY", 0, 1);
            ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(createMailButton, holderX, holderY);
            animator.setInterpolator(new OvershootInterpolator());
            animator.start();
        }
    }
}
Also used : OvershootInterpolator(android.view.animation.OvershootInterpolator) ObjectAnimator(android.animation.ObjectAnimator) PropertyValuesHolder(android.animation.PropertyValuesHolder)

Example 67 with OvershootInterpolator

use of android.view.animation.OvershootInterpolator in project FlowingDrawer by mxn21.

the class ElasticDrawer method flowDown.

private void flowDown(final int finalX) {
    ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1);
    valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            mMenuView.setUpDownFraction(animation.getAnimatedFraction());
        }
    });
    valueAnimator.addListener(new FlowingAnimationListener() {

        @Override
        public void onAnimationEnd(Animator animation) {
            if (mDrawerState == STATE_OPENING) {
                mMenuVisible = finalX != 0;
                setOffsetPixels(finalX, 0, FlowingMenuLayout.TYPE_NONE);
                setDrawerState(finalX == 0 ? STATE_CLOSED : STATE_OPEN);
                stopLayerTranslation();
            }
        }
    });
    valueAnimator.setDuration(300);
    valueAnimator.setInterpolator(new OvershootInterpolator(4f));
    valueAnimator.start();
}
Also used : ValueAnimator(com.nineoldandroids.animation.ValueAnimator) Animator(com.nineoldandroids.animation.Animator) OvershootInterpolator(android.view.animation.OvershootInterpolator) ValueAnimator(com.nineoldandroids.animation.ValueAnimator)

Example 68 with OvershootInterpolator

use of android.view.animation.OvershootInterpolator in project PhotoNoter by yydcdut.

the class DetailActivity method upAnimation.

@Override
public void upAnimation() {
    View adapterPositionView = mDetailPagerAdapter.getItemView(mViewPager.getCurrentItem());
    View blurView;
    if (adapterPositionView != null) {
        blurView = adapterPositionView.findViewById(R.id.img_blur);
    } else {
        blurView = mOverlayView;
    }
    final View finalBlurView = blurView;
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.playTogether(ObjectAnimator.ofFloat(mCardView, "translationY", mTranslateHeight, 0), ObjectAnimator.ofFloat(mViewPager, "scaleX", 1f, 1.1f), ObjectAnimator.ofFloat(mViewPager, "scaleY", 1f, 1.1f), ObjectAnimator.ofFloat(finalBlurView, "alpha", 0f, 1f));
    animatorSet.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationStart(Animator animation) {
            super.onAnimationStart(animation);
            finalBlurView.setVisibility(View.VISIBLE);
            mOverlayView.setVisibility(View.VISIBLE);
            mIsIgnoreClick = true;
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            mIsIgnoreClick = false;
        }
    });
    animatorSet.setDuration(400);
    animatorSet.setInterpolator(new OvershootInterpolator());
    animatorSet.start();
    mAnimationHandler.postDelayed(mUpDelayRunnable, 500);
}
Also used : ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) Animator(com.nineoldandroids.animation.Animator) OvershootInterpolator(android.view.animation.OvershootInterpolator) AnimatorListenerAdapter(com.nineoldandroids.animation.AnimatorListenerAdapter) AnimatorSet(com.nineoldandroids.animation.AnimatorSet) IDetailView(com.yydcdut.note.views.note.IDetailView) RevealView(com.yydcdut.note.widget.RevealView) View(android.view.View) FontTextView(com.yydcdut.note.widget.FontTextView) TextView(android.widget.TextView)

Example 69 with OvershootInterpolator

use of android.view.animation.OvershootInterpolator in project PhotoNoter by yydcdut.

the class FloatingActionsMenu method createAddButton.

private void createAddButton(Context context) {
    mAddButton = new AddFloatingActionButton(context) {

        @Override
        void updateBackground() {
            mPlusColor = mAddButtonPlusColor;
            mColorNormal = mAddButtonColorNormal;
            mColorPressed = mAddButtonColorPressed;
            mStrokeVisible = mAddButtonStrokeVisible;
            super.updateBackground();
        }

        @Override
        Drawable getIconDrawable() {
            final RotatingDrawable rotatingDrawable = new RotatingDrawable(super.getIconDrawable());
            mRotatingDrawable = rotatingDrawable;
            final OvershootInterpolator interpolator = new OvershootInterpolator();
            final ObjectAnimator collapseAnimator = ObjectAnimator.ofFloat(rotatingDrawable, "rotation", EXPANDED_PLUS_ROTATION, COLLAPSED_PLUS_ROTATION);
            final ObjectAnimator expandAnimator = ObjectAnimator.ofFloat(rotatingDrawable, "rotation", COLLAPSED_PLUS_ROTATION, EXPANDED_PLUS_ROTATION);
            collapseAnimator.setInterpolator(interpolator);
            expandAnimator.setInterpolator(interpolator);
            mExpandAnimation.play(expandAnimator);
            mCollapseAnimation.play(collapseAnimator);
            return rotatingDrawable;
        }
    };
    mAddButton.setId(R.id.fab_expand_menu_button);
    mAddButton.setSize(mAddButtonSize);
    mAddButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            toggle();
        }
    });
    addView(mAddButton, super.generateDefaultLayoutParams());
}
Also used : OvershootInterpolator(android.view.animation.OvershootInterpolator) ObjectAnimator(android.animation.ObjectAnimator) LayerDrawable(android.graphics.drawable.LayerDrawable) Drawable(android.graphics.drawable.Drawable) TextView(android.widget.TextView) View(android.view.View)

Example 70 with OvershootInterpolator

use of android.view.animation.OvershootInterpolator in project AndroidSweetSheet by zzz40500.

the class SweetView method duang.

public void duang() {
    mStatus = Status.STATUS_DOWN;
    ValueAnimator valueAnimator = ValueAnimator.ofInt(mMaxArcHeight, 0);
    valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            mArcHeight = (int) animation.getAnimatedValue();
            invalidate();
        }
    });
    valueAnimator.addListener(new SimpleAnimationListener() {

        @Override
        public void onAnimationEnd(Animator animation) {
            if (mAnimationListener != null) {
                mAnimationListener.onEnd();
            }
        }
    });
    valueAnimator.setDuration(500);
    valueAnimator.setInterpolator(new OvershootInterpolator(4f));
    valueAnimator.start();
}
Also used : ValueAnimator(com.nineoldandroids.animation.ValueAnimator) Animator(com.nineoldandroids.animation.Animator) OvershootInterpolator(android.view.animation.OvershootInterpolator) SimpleAnimationListener(com.mingle.SimpleAnimationListener) ValueAnimator(com.nineoldandroids.animation.ValueAnimator)

Aggregations

OvershootInterpolator (android.view.animation.OvershootInterpolator)85 ObjectAnimator (android.animation.ObjectAnimator)32 Animator (android.animation.Animator)21 View (android.view.View)21 AnimatorSet (android.animation.AnimatorSet)15 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)14 TextView (android.widget.TextView)14 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)13 Handler (android.os.Handler)12 ValueAnimator (android.animation.ValueAnimator)10 LinearInterpolator (android.view.animation.LinearInterpolator)10 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)8 Drawable (android.graphics.drawable.Drawable)7 RecyclerView (android.support.v7.widget.RecyclerView)7 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)7 LayerDrawable (android.graphics.drawable.LayerDrawable)6 PropertyValuesHolder (android.animation.PropertyValuesHolder)5 Rect (android.graphics.Rect)5 Interpolator (android.view.animation.Interpolator)5 Point (android.graphics.Point)4