Search in sources :

Example 41 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Reader by TheKeeperOfPie.

the class FragmentComments method showLayoutActions.

private void showLayoutActions() {
    for (int index = layoutActions.getChildCount() - 1; index >= 0; index--) {
        final View view = layoutActions.getChildAt(index);
        view.setVisibility(View.VISIBLE);
        final int finalIndex = index;
        ViewCompat.animate(view).alpha(1f).scaleX(1f).scaleY(1f).setInterpolator(fastOutSlowInInterpolator).setDuration(DURATION_ACTIONS_FADE).setStartDelay((long) ((layoutActions.getChildCount() - 1 - index) * DURATION_ACTIONS_FADE * OFFSET_MODIFIER)).setListener(new ViewPropertyAnimatorListener() {

            @Override
            public void onAnimationStart(View view) {
                if (finalIndex == 0) {
                    buttonExpandActions.setImageResource(android.R.color.transparent);
                }
            }

            @Override
            public void onAnimationEnd(View view) {
            }

            @Override
            public void onAnimationCancel(View view) {
            }
        }).start();
    }
}
Also used : ViewPropertyAnimatorListener(android.support.v4.view.ViewPropertyAnimatorListener) BindView(butterknife.BindView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView)

Example 42 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project CircularReveal by ozodrukh.

the class MainActivity method resetUi.

@OnClick(R.id.reset)
void resetUi(View resetCard) {
    cardsLine.setVisibility(View.INVISIBLE);
    final View target = ButterKnife.findById(this, R.id.activator);
    // Coordinates of circle initial point
    final ViewGroup parent = (ViewGroup) activatorMask.getParent();
    final Rect bounds = new Rect();
    final Rect maskBounds = new Rect();
    target.getDrawingRect(bounds);
    activatorMask.getDrawingRect(maskBounds);
    parent.offsetDescendantRectToMyCoords(target, bounds);
    parent.offsetDescendantRectToMyCoords(activatorMask, maskBounds);
    maskElevation = activatorMask.getCardElevation();
    activatorMask.setCardElevation(0);
    final int cX = maskBounds.centerX();
    final int cY = maskBounds.centerY();
    final Animator circularReveal = ViewAnimationUtils.createCircularReveal(activatorMask, cX, cY, (float) Math.hypot(maskBounds.width() * .5f, maskBounds.height() * .5f), target.getWidth() / 2f, View.LAYER_TYPE_HARDWARE);
    final float c0X = bounds.centerX() - maskBounds.centerX();
    final float c0Y = bounds.centerY() - maskBounds.centerY();
    AnimatorPath path = new AnimatorPath();
    path.moveTo(0, 0);
    path.curveTo(0, 0, 0, c0Y, c0X, c0Y);
    ObjectAnimator pathAnimator = ObjectAnimator.ofObject(this, "maskLocation", new PathEvaluator(), path.getPoints().toArray());
    AnimatorSet set = new AnimatorSet();
    set.playTogether(circularReveal, pathAnimator);
    set.setInterpolator(new FastOutSlowInInterpolator());
    set.setDuration(SLOW_DURATION);
    set.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            activatorMask.setCardElevation(maskElevation);
            activatorMask.setVisibility(View.INVISIBLE);
            circlesLine.setVisibility(View.VISIBLE);
            executeCirclesDropDown();
            target.setEnabled(true);
        }
    });
    set.start();
}
Also used : Rect(android.graphics.Rect) RevealViewGroup(io.codetail.animation.RevealViewGroup) ViewGroup(android.view.ViewGroup) ObjectAnimator(android.animation.ObjectAnimator) AnimatorSet(android.animation.AnimatorSet) BindView(butterknife.BindView) View(android.view.View) CardView(android.support.v7.widget.CardView) Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) OnClick(butterknife.OnClick)

Example 43 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project CircularReveal by ozodrukh.

the class MainActivity method activateAwareMotion.

@OnClick(R.id.activator)
void activateAwareMotion(View target) {
    // Cancel all concurrent events on view
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        target.cancelPendingInputEvents();
    }
    target.setEnabled(false);
    // Coordinates of circle initial point
    final ViewGroup parent = (ViewGroup) activatorMask.getParent();
    final Rect bounds = new Rect();
    final Rect maskBounds = new Rect();
    target.getDrawingRect(bounds);
    activatorMask.getDrawingRect(maskBounds);
    parent.offsetDescendantRectToMyCoords(target, bounds);
    parent.offsetDescendantRectToMyCoords(activatorMask, maskBounds);
    // Put Mask view at circle 8initial points
    maskElevation = activatorMask.getCardElevation();
    activatorMask.setCardElevation(0);
    activatorMask.setVisibility(View.VISIBLE);
    activatorMask.setX(bounds.left - maskBounds.centerX());
    activatorMask.setY(bounds.top - maskBounds.centerY());
    circlesLine.setVisibility(View.INVISIBLE);
    final int cX = maskBounds.centerX();
    final int cY = maskBounds.centerY();
    final float endRadius = (float) Math.hypot(maskBounds.width() * .5f, maskBounds.height() * .5f);
    Animator circularReveal = ViewAnimationUtils.createCircularReveal(activatorMask, cX, cY, target.getWidth() / 2, endRadius, View.LAYER_TYPE_HARDWARE);
    final float c0X = bounds.centerX() - maskBounds.centerX();
    final float c0Y = bounds.centerY() - maskBounds.centerY();
    AnimatorPath path = new AnimatorPath();
    path.moveTo(c0X, c0Y);
    path.curveTo(c0X, c0Y, 0, c0Y, 0, 0);
    ObjectAnimator pathAnimator = ObjectAnimator.ofObject(this, "maskLocation", new PathEvaluator(), path.getPoints().toArray());
    AnimatorSet set = new AnimatorSet();
    set.playTogether(circularReveal, pathAnimator);
    set.setInterpolator(new FastOutSlowInInterpolator());
    set.setDuration(SLOW_DURATION);
    set.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            executeCardsSequentialAnimation();
            activatorMask.setCardElevation(maskElevation);
        }
    });
    set.start();
}
Also used : Rect(android.graphics.Rect) Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) RevealViewGroup(io.codetail.animation.RevealViewGroup) ViewGroup(android.view.ViewGroup) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) AnimatorSet(android.animation.AnimatorSet) OnClick(butterknife.OnClick)

Example 44 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project native-navigation by airbnb.

the class AutoSharedElementCallback method getDefaultTransition.

@TargetApi(TARGET_API)
private Transition getDefaultTransition() {
    TransitionSet set = new TransitionSet();
    set.addTransition(new ChangeBounds());
    set.addTransition(new Fade());
    set.addTransition(new ChangeImageTransform());
    set.setInterpolator(new FastOutSlowInInterpolator());
    return set;
}
Also used : TransitionSet(android.transition.TransitionSet) ChangeBounds(android.transition.ChangeBounds) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) Fade(android.transition.Fade) ChangeImageTransform(android.transition.ChangeImageTransform) TargetApi(android.annotation.TargetApi)

Example 45 with FastOutSlowInInterpolator

use of android.support.v4.view.animation.FastOutSlowInInterpolator in project TeamCityApp by vase4kin.

the class RootDrawerViewImpl method showNavigationDrawerPrompt.

/**
 * {@inheritDoc}
 */
@Override
public void showNavigationDrawerPrompt(final OnboardingManager.OnPromptShownListener listener) {
    // Creating prompt
    int color = ContextCompat.getColor(mActivity, mDefaultColor);
    final MaterialTapTargetPrompt.Builder navigationDrawerPrompt = new MaterialTapTargetPrompt.Builder(mActivity).setPrimaryText(R.string.title_onboarding_navigation_drawer).setSecondaryText(R.string.text_onboarding_navigation_drawer).setAnimationInterpolator(new FastOutSlowInInterpolator()).setIcon(R.drawable.ic_menu_black_24dp).setIconDrawableTintList(ColorStateList.valueOf(color)).setBackgroundColour(color).setCaptureTouchEventOutsidePrompt(true).setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener() {

        @Override
        public void onPromptStateChanged(MaterialTapTargetPrompt prompt, int state) {
            listener.onPromptShown();
        }
    });
    // Show prompt
    new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {

        @Override
        public void run() {
            navigationDrawerPrompt.setTarget(mToolbar.getChildAt(1));
            navigationDrawerPrompt.show();
        }
    }, TIME_NAVIGATION_DRAWER_PROMPT);
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) Handler(android.os.Handler) MaterialTapTargetPrompt(uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt)

Aggregations

FastOutSlowInInterpolator (android.support.v4.view.animation.FastOutSlowInInterpolator)53 Animator (android.animation.Animator)20 ValueAnimator (android.animation.ValueAnimator)17 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)16 View (android.view.View)14 ObjectAnimator (android.animation.ObjectAnimator)11 AnimatorSet (android.animation.AnimatorSet)9 BindView (butterknife.BindView)8 RecyclerView (android.support.v7.widget.RecyclerView)5 TextView (android.widget.TextView)5 MaterialTapTargetPrompt (uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt)5 ViewPropertyAnimatorListener (android.support.v4.view.ViewPropertyAnimatorListener)4 LinearOutSlowInInterpolator (android.support.v4.view.animation.LinearOutSlowInInterpolator)4 ExitFragmentTransition (com.kogitune.activity_transition.fragment.ExitFragmentTransition)3 ValueAnimator (com.nineoldandroids.animation.ValueAnimator)3 ArgbEvaluator (android.animation.ArgbEvaluator)2 TargetApi (android.annotation.TargetApi)2 Rect (android.graphics.Rect)2 Handler (android.os.Handler)2 FastOutLinearInInterpolator (android.support.v4.view.animation.FastOutLinearInInterpolator)2