Search in sources :

Example 26 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project PhotoNoter by yydcdut.

the class EditTextActivity method startActivityAnimation.

@Override
public void startActivityAnimation() {
    int actionBarHeight = getActionBarSize();
    int screenHeight = Utils.sScreenHeight;
    int contentEditHeight = screenHeight - actionBarHeight * 2;
    AnimatorSet animation = new AnimatorSet();
    animation.setDuration(Const.DURATION_ACTIVITY);
    animation.playTogether(ObjectAnimator.ofFloat(mAppBarLayout, "translationY", -actionBarHeight, 0), ObjectAnimator.ofFloat(mTitleTextInputLayout, "translationY", -actionBarHeight * 3, 0), ObjectAnimator.ofFloat(mContentEdit, "translationY", contentEditHeight, 0), ObjectAnimator.ofFloat(mFabMenuLayout, "translationY", contentEditHeight, 0), ObjectAnimator.ofFloat(mHorizontalEditScrollView, "translationY", contentEditHeight, 0));
    animation.start();
}
Also used : AnimatorSet(com.nineoldandroids.animation.AnimatorSet) Point(android.graphics.Point)

Example 27 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project PhotoNoter by yydcdut.

the class DetailActivity method initAnimationView.

@Override
public void initAnimationView() {
    new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {
            AnimatorSet animatorSet = new AnimatorSet();
            animatorSet.playTogether(ObjectAnimator.ofFloat(mCardView, "translationY", 0, mTranslateHeight));
            animatorSet.addListener(new AnimatorListenerAdapter() {

                @Override
                public void onAnimationEnd(Animator animation) {
                    super.onAnimationEnd(animation);
                    mOverlayView.setVisibility(View.GONE);
                    mIsIgnoreClick = true;
                }

                @Override
                public void onAnimationStart(Animator animation) {
                    super.onAnimationStart(animation);
                    mIsIgnoreClick = true;
                }
            });
            animatorSet.setDuration(400);
            animatorSet.setInterpolator(new DecelerateInterpolator());
            animatorSet.start();
            mAnimationHandler.postDelayed(mDownDelayRunnable, 350);
        }
    }, 500);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) Animator(com.nineoldandroids.animation.Animator) AnimatorListenerAdapter(com.nineoldandroids.animation.AnimatorListenerAdapter) Handler(android.os.Handler) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 28 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project PhotoNoter by yydcdut.

the class PhotoDetailActivity method showWidget.

@Override
public void showWidget(final IPhotoDetailPresenter.OnAnimationAdapter onAnimationAdapter) {
    AnimatorSet animation = new AnimatorSet();
    animation.setDuration(1000);
    animation.playTogether(ObjectAnimator.ofFloat(mAppBarLayout, "Y", -getActionBarSize() - (AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0), AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0), ObjectAnimator.ofFloat(mBottomLayout, "Y", mBottomLayout.getTop() + getActionBarSize(), mBottomLayout.getTop()), ObjectAnimator.ofFloat(mStatusCoverView, "Y", -getActionBarSize(), 0f));
    animation.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationStart(Animator animation) {
            if (onAnimationAdapter != null) {
                onAnimationAdapter.onAnimationStarted(IPhotoDetailPresenter.STATE_SHOW);
            }
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            if (onAnimationAdapter != null) {
                onAnimationAdapter.onAnimationEnded(IPhotoDetailPresenter.STATE_SHOW);
            }
        }
    });
    animation.start();
}
Also used : ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) Animator(com.nineoldandroids.animation.Animator) AnimatorListenerAdapter(com.nineoldandroids.animation.AnimatorListenerAdapter) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 29 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project ride-read-android by Ride-Read.

the class ShowPictureActivity method MoveView.

private void MoveView() {
    ObjectAnimator.ofFloat(mainView, "alpha", 0.8f).setDuration(0).start();
    mainView.setVisibility(View.VISIBLE);
    AnimatorSet set = new AnimatorSet();
    set.playTogether(ObjectAnimator.ofFloat(showImageView, "translationX", tx).setDuration(200), ObjectAnimator.ofFloat(showImageView, "translationY", ty).setDuration(200), ObjectAnimator.ofFloat(mainView, "alpha", 1).setDuration(200));
    set.addListener(new Animator.AnimatorListener() {

        @Override
        public void onAnimationStart(Animator animator) {
        }

        @Override
        public void onAnimationEnd(Animator animator) {
            showImageView.setScaleType(ImageView.ScaleType.FIT_XY);
            spring.setEndValue(1);
        }

        @Override
        public void onAnimationCancel(Animator animator) {
        }

        @Override
        public void onAnimationRepeat(Animator animator) {
        }
    });
    set.start();
}
Also used : Animator(com.nineoldandroids.animation.Animator) ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Example 30 with AnimatorSet

use of com.nineoldandroids.animation.AnimatorSet in project ride-read-android by Ride-Read.

the class ShowPictureActivity method MoveBackView.

private void MoveBackView() {
    AnimatorSet set = new AnimatorSet();
    set.playTogether(ObjectAnimator.ofFloat(showImageView, "translationX", to_x).setDuration(200), ObjectAnimator.ofFloat(showImageView, "translationY", to_y).setDuration(200));
    set.addListener(new Animator.AnimatorListener() {

        @Override
        public void onAnimationStart(Animator animator) {
        }

        @Override
        public void onAnimationEnd(Animator animator) {
            finish();
        }

        @Override
        public void onAnimationCancel(Animator animator) {
        }

        @Override
        public void onAnimationRepeat(Animator animator) {
        }
    });
    set.start();
}
Also used : Animator(com.nineoldandroids.animation.Animator) ObjectAnimator(com.nineoldandroids.animation.ObjectAnimator) AnimatorSet(com.nineoldandroids.animation.AnimatorSet)

Aggregations

AnimatorSet (com.nineoldandroids.animation.AnimatorSet)57 ObjectAnimator (com.nineoldandroids.animation.ObjectAnimator)42 Animator (com.nineoldandroids.animation.Animator)24 AnimatorListenerAdapter (com.nineoldandroids.animation.AnimatorListenerAdapter)11 View (android.view.View)6 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)4 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)4 SuppressLint (android.annotation.SuppressLint)3 Paint (android.graphics.Paint)3 OvershootInterpolator (android.view.animation.OvershootInterpolator)3 Point (android.graphics.Point)2 DisplayMetrics (android.util.DisplayMetrics)2 LinearInterpolator (android.view.animation.LinearInterpolator)2 AdapterView (android.widget.AdapterView)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 ValueAnimator (com.nineoldandroids.animation.ValueAnimator)2 IDetailView (com.yydcdut.note.views.note.IDetailView)2 FontTextView (com.yydcdut.note.widget.FontTextView)2 RevealView (com.yydcdut.note.widget.RevealView)2