Search in sources :

Example 31 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project PreLollipopTransition by takahirom.

the class SupportEndFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.support_fragment_end, container, false);
    final ExitFragmentTransition exitFragmentTransition = FragmentTransition.with(this).interpolator(new FastOutSlowInInterpolator()).to(v.findViewById(R.id.fragment_imageview)).start(savedInstanceState);
    exitFragmentTransition.startExitListening();
    return v;
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) View(android.view.View) ExitFragmentTransition(com.kogitune.activity_transition.fragment.ExitFragmentTransition)

Example 32 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Douya by DreaminginCodeZH.

the class NavigationHeaderLayout method beginAvatarTransition.

private void beginAvatarTransition(ImageView moveAvatarOneImage, ImageView moveAvatarTwoImage, ImageView moveAvatarThreeImage) {
    ImageView appearAvatarImage = moveAvatarOneImage;
    ImageView disappearAvatarImage = moveAvatarThreeImage != null ? moveAvatarThreeImage : moveAvatarTwoImage;
    ImageView fadeOutDisappearAvatarImage = disappearAvatarImage == mAvatarImage ? mFadeOutAvatarImage : disappearAvatarImage == mRecentOneAvatarImage ? mFadeOutRecentOneAvatarImage : mFadeOutRecentTwoAvatarImage;
    TransitionSet transitionSet = new TransitionSet();
    int duration = ViewUtils.getLongAnimTime(getContext());
    // Will be set on already added and newly added transitions.
    transitionSet.setDuration(duration);
    // NOTE: TransitionSet.setInterpolator() won't have any effect on platform versions.
    // https://code.google.com/p/android/issues/detail?id=195495
    transitionSet.setInterpolator(new FastOutSlowInInterpolator());
    Fade fadeOutAvatar = new Fade(Fade.OUT);
    setAvatarImageFrom(fadeOutDisappearAvatarImage, disappearAvatarImage);
    fadeOutDisappearAvatarImage.setVisibility(VISIBLE);
    fadeOutAvatar.addTarget(fadeOutDisappearAvatarImage);
    transitionSet.addTransition(fadeOutAvatar);
    // Make it finish before new avatar arrives.
    fadeOutAvatar.setDuration(duration / 2);
    Fade fadeInAvatar = new Fade(Fade.IN);
    appearAvatarImage.setVisibility(INVISIBLE);
    fadeInAvatar.addTarget(appearAvatarImage);
    transitionSet.addTransition(fadeInAvatar);
    ChangeTransform changeAppearAvatarTransform = new ChangeTransform();
    appearAvatarImage.setScaleX(0.8f);
    appearAvatarImage.setScaleY(0.8f);
    changeAppearAvatarTransform.addTarget(appearAvatarImage);
    transitionSet.addTransition(changeAppearAvatarTransform);
    addChangeMoveToAvatarTransformToTransitionSet(moveAvatarOneImage, moveAvatarTwoImage, transitionSet);
    if (moveAvatarThreeImage != null) {
        addChangeMoveToAvatarTransformToTransitionSet(moveAvatarTwoImage, moveAvatarThreeImage, transitionSet);
    }
    CrossfadeText crossfadeText = new CrossfadeText();
    crossfadeText.addTarget(mNameText);
    crossfadeText.addTarget(mDescriptionText);
    transitionSet.addTransition(crossfadeText);
    transitionSet.addListener(new Transition.TransitionListenerAdapter() {

        @Override
        public void onTransitionEnd(Transition transition) {
            mAccountTransitionRunning = false;
            mInfoLayout.setEnabled(true);
            if (mListener != null) {
                mListener.onAccountTransitionEnd();
            }
        }
    });
    mInfoLayout.setEnabled(false);
    TransitionManager.beginDelayedTransition(this, transitionSet);
    mAccountTransitionRunning = true;
    if (mListener != null) {
        mListener.onAccountTransitionStart();
    }
    fadeOutDisappearAvatarImage.setVisibility(INVISIBLE);
    appearAvatarImage.setVisibility(VISIBLE);
    appearAvatarImage.setScaleX(1);
    appearAvatarImage.setScaleY(1);
    resetMoveToAvatarTransform(moveAvatarTwoImage);
    if (moveAvatarThreeImage != null) {
        resetMoveToAvatarTransform(moveAvatarThreeImage);
    }
}
Also used : CrossfadeText(me.zhanghai.android.douya.ui.CrossfadeText) ChangeTransform(com.transitionseverywhere.ChangeTransform) TransitionSet(com.transitionseverywhere.TransitionSet) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) Transition(com.transitionseverywhere.Transition) ImageView(android.widget.ImageView) Fade(com.transitionseverywhere.Fade)

Example 33 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Douya by DreaminginCodeZH.

the class ViewUtils method fadeIn.

public static void fadeIn(View view, int duration) {
    if (view.getVisibility() == View.VISIBLE && view.getAlpha() == 1) {
        // Cancel any starting animation.
        view.animate().alpha(1).setDuration(0).start();
        return;
    }
    view.setAlpha(0);
    view.setVisibility(View.VISIBLE);
    view.animate().alpha(1).setDuration(duration).setInterpolator(new FastOutSlowInInterpolator()).setListener(null).start();
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator)

Example 34 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Douya by DreaminginCodeZH.

the class GalleryActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.gallery_activity);
    ButterKnife.bind(this);
    setSupportActionBar(mToolbar);
    mSystemUiHelper = new SystemUiHelper(this, SystemUiHelper.LEVEL_IMMERSIVE, SystemUiHelper.FLAG_IMMERSIVE_STICKY, new SystemUiHelper.OnVisibilityChangeListener() {

        @Override
        public void onVisibilityChange(boolean visible) {
            if (visible) {
                mToolbar.animate().alpha(1).translationY(0).setDuration(mToolbarHideDuration).setInterpolator(new FastOutSlowInInterpolator()).start();
            } else {
                mToolbar.animate().alpha(0).translationY(-mToolbar.getBottom()).setDuration(mToolbarHideDuration).setInterpolator(new FastOutSlowInInterpolator()).start();
            }
        }
    });
    // This will set up window flags.
    mSystemUiHelper.show();
    ArrayList<String> imageList = getIntent().getStringArrayListExtra(EXTRA_IMAGE_LIST);
    mViewPager.setAdapter(new GalleryAdapter(imageList, new GalleryAdapter.OnTapListener() {

        @Override
        public void onTap() {
            mSystemUiHelper.toggle();
        }
    }));
    int position = getIntent().getIntExtra(EXTRA_POSITION, 0);
    mViewPager.setCurrentItem(position);
    mViewPager.setPageTransformer(true, new ViewPagerTransformers.Depth());
}
Also used : SystemUiHelper(me.zhanghai.android.systemuihelper.SystemUiHelper) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator)

Example 35 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Douya by DreaminginCodeZH.

the class FlexibleSpaceLayout method snapHeaderView.

private void snapHeaderView() {
    ObjectAnimator animator = ObjectAnimator.ofInt(this, SCROLL, mScroll, mHeaderCollapsed ? 0 : mHeaderView.getScrollExtent());
    animator.setDuration(mMediumAnimationTime);
    animator.setInterpolator(new FastOutSlowInInterpolator());
    animator.start();
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator)

Aggregations

FastOutSlowInInterpolator (android.support.v4.view.animation.FastOutSlowInInterpolator)35 View (android.view.View)11 Animator (android.animation.Animator)8 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)6 AnimatorSet (android.animation.AnimatorSet)6 ObjectAnimator (android.animation.ObjectAnimator)6 BindView (butterknife.BindView)6 PropertyValuesHolder (android.animation.PropertyValuesHolder)4 ViewPropertyAnimatorListener (android.support.v4.view.ViewPropertyAnimatorListener)4 RecyclerView (android.support.v7.widget.RecyclerView)4 MotionEvent (android.view.MotionEvent)3 ViewGroup (android.view.ViewGroup)3 TextView (android.widget.TextView)3 ExitFragmentTransition (com.kogitune.activity_transition.fragment.ExitFragmentTransition)3 IEndListener (su.levenetc.android.textsurface.interfaces.IEndListener)3 ISurfaceAnimation (su.levenetc.android.textsurface.interfaces.ISurfaceAnimation)3 TargetApi (android.annotation.TargetApi)2 Rect (android.graphics.Rect)2 Nullable (android.support.annotation.Nullable)2 LinearOutSlowInInterpolator (android.support.v4.view.animation.LinearOutSlowInInterpolator)2