Example usage for android.support.v4.view.animation FastOutSlowInInterpolator FastOutSlowInInterpolator

List of usage examples for android.support.v4.view.animation FastOutSlowInInterpolator FastOutSlowInInterpolator

Introduction

In this page you can find the example usage for android.support.v4.view.animation FastOutSlowInInterpolator FastOutSlowInInterpolator.

Prototype

public FastOutSlowInInterpolator() 

Source Link

Usage

From source file:org.hawkular.client.android.util.ViewTransformer.java

@UiThread
public void rotate() {
    Animator animator = ObjectAnimator.ofFloat(view, View.ROTATION, view.getRotation(),
            view.getRotation() + 180);/*from  w w  w .j a  va 2  s .  c  o  m*/
    animator.setInterpolator(new FastOutSlowInInterpolator());
    animator.setDuration(Durations.MEDIUM);

    animator.start();
}

From source file:org.adw.library.widgets.discreteseekbar.internal.drawable.MarkerDrawable.java

public MarkerDrawable(@NonNull ColorStateList tintList, int closedSize) {
    super(tintList);
    mInterpolator = new FastOutSlowInInterpolator();
    mClosedStateSize = closedSize;//from  www . j ava2  s  .  co  m
    mStartColor = tintList.getColorForState(
            new int[] { android.R.attr.state_enabled, android.R.attr.state_pressed },
            tintList.getDefaultColor());
    mEndColor = tintList.getDefaultColor();

}

From source file:uk.co.samuelwall.materialtaptargetprompt.sample.EmptyActivity.java

public void showFabPrompt(View view) {
    if (mFabPrompt != null) {
        return;/* ww w  . j av a  2s. c  o  m*/
    }
    mFabPrompt = new MaterialTapTargetPrompt.Builder(EmptyActivity.this).setTarget(findViewById(R.id.fab))
            .setPrimaryText("Send your first email")
            .setSecondaryText("Tap the envelop to start composing your first email")
            .setAnimationInterpolator(new FastOutSlowInInterpolator())
            .setOnHidePromptListener(new MaterialTapTargetPrompt.OnHidePromptListener() {
                @Override
                public void onHidePrompt(MotionEvent event, boolean tappedTarget) {
                    mFabPrompt = null;
                    //Do something such as storing a value so that this prompt is never shown again
                }

                @Override
                public void onHidePromptComplete() {

                }
            }).create();
    mFabPrompt.show();
}

From source file:org.hawkular.client.android.util.ViewTransformer.java

@UiThread
public void show() {
    Animator animator = ObjectAnimator.ofFloat(view, View.ALPHA, 0, 1);
    animator.setInterpolator(new FastOutSlowInInterpolator());
    animator.setDuration(Durations.MEDIUM);

    animator.start();//www .j  av  a  2 s.  co  m
}

From source file:com.imczy.customactivitytransition.transition.ShareElemReturnChangePosition.java

@Override
public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues, TransitionValues endValues) {
    if (null == startValues || null == endValues) {
        return null;
    }//from ww w  .j  a v  a  2s . c  o m

    if (startValues.view.getId() > 0) {
        Rect startRect = (Rect) startValues.values.get(PROPNAME_POSITION);
        Rect endRect = (Rect) endValues.values.get(PROPNAME_POSITION);

        final View view = endValues.view;

        Path changePosPath = getPathMotion().getPath(startRect.centerX(), startRect.centerY(),
                endRect.centerX(), endRect.centerY() - endRect.height() / 2);

        ObjectAnimator objectAnimator = ObjectAnimator.ofObject(view, new PropPosition(PointF.class, "position",
                new PointF(startRect.centerX(), startRect.centerY())), null, changePosPath);
        objectAnimator.setInterpolator(new FastOutSlowInInterpolator());

        return objectAnimator;
    }
    return null;

}

From source file:org.hawkular.client.android.util.ViewTransformer.java

@UiThread
public void hide() {
    Animator animator = ObjectAnimator.ofFloat(view, View.ALPHA, 1, 0);
    animator.setInterpolator(new FastOutSlowInInterpolator());
    animator.setDuration(Durations.MEDIUM);

    animator.start();// www. ja v  a2 s . c  o m
}

From source file:com.imczy.customactivitytransition.transition.ChangePosition.java

@Override
public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues, TransitionValues endValues) {
    if (null == startValues || null == endValues) {
        return null;
    }// w  w w  .  j  a  v  a  2 s .  co m

    if (startValues.view.getId() > 0) {
        Rect startRect = (Rect) startValues.values.get(PROPNAME_POSITION);
        Rect endRect = (Rect) endValues.values.get(PROPNAME_POSITION);

        final View view = endValues.view;

        Path changePosPath = getPathMotion().getPath(startRect.centerX(), startRect.centerY(),
                endRect.centerX(), endRect.centerY());

        int radius = startRect.centerY() - endRect.centerY();

        ObjectAnimator objectAnimator = ObjectAnimator.ofObject(view,
                new PropPosition(PointF.class, "position", new PointF(endRect.centerX(), endRect.centerY())),
                null, changePosPath);
        objectAnimator.setInterpolator(new FastOutSlowInInterpolator());

        return objectAnimator;
    }
    return null;

}

From source file:net.huannguyen.conductorexample.transition.DetailPushTransChangeHandler.java

@NonNull
@Override/*from w  w  w.j a  va  2  s.  c o m*/
protected Transition getTransition(@NonNull ViewGroup container, @Nullable View from, @Nullable View to,
        boolean isPush) {

    if (to == null || !(to instanceof CountryDetailView)) {
        throw new IllegalArgumentException("The to view must be a CountryDetailView");
    }

    final CountryDetailView detailView = (CountryDetailView) to;

    detailView.flagView.setTransitionName(flagViewTransitionName);

    ChangeTransform changeTransform = new ChangeTransform();

    // Shared elements (the flag view in this case) are drawn in the window's view overlay during the transition by default.
    // That causes the favourite fab being drawn behind the flag when it is scaled up.
    // Setting the change transform not using overlay addresses this issue.
    changeTransform.setReparentWithOverlay(false);

    return new TransitionSet()
            .addTransition(new TransitionSet().addTransition(new ChangeBounds())
                    .addTransition(new ChangeClipBounds()).addTransition(changeTransform)
                    .addTransition(new ChangeImageTransform()).setDuration(300))
            .addTransition(new Slide().addTarget(detailView.detailGroup).setStartDelay(150))
            .addTransition(new Scale().addTarget(detailView.favouriteFab).setStartDelay(300))
            .setInterpolator(new FastOutSlowInInterpolator());
}

From source file:com.sinyuk.jianyi.utils.list.SlideInItemAnimator.java

@Override
public void runPendingAnimations() {
    super.runPendingAnimations();
    if (!pendingAdds.isEmpty()) {
        for (int i = pendingAdds.size() - 1; i >= 0; i--) {
            final RecyclerView.ViewHolder holder = pendingAdds.get(i);
            holder.itemView.animate().alpha(1f).translationX(0f).translationY(0f).setDuration(getAddDuration())
                    .setListener(new AnimatorListenerAdapter() {
                        @Override
                        public void onAnimationStart(Animator animation) {
                            dispatchAddStarting(holder);
                        }// w  ww . j  av  a2  s .  c  o  m

                        @Override
                        public void onAnimationEnd(Animator animation) {
                            animation.getListeners().remove(this);
                            dispatchAddFinished(holder);
                            dispatchFinishedWhenDone();
                        }

                        @Override
                        public void onAnimationCancel(Animator animation) {
                            clearAnimatedValues(holder.itemView);
                        }
                    }).setInterpolator(new FastOutSlowInInterpolator());
            pendingAdds.remove(i);
        }
    }
}

From source file:ir.newway.jazzylistview.JazzyHelper.java

public JazzyHelper(Context context, AttributeSet attrs) {
    mInterpolator = new FastOutSlowInInterpolator();
    mAlreadyAnimatedItems = new HashSet<>();
    int transitionEffect = HELIX;
    int maxVelocity = 0;

    if (context != null && attrs != null) {
        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.JazzyListView);
        transitionEffect = a.getInteger(R.styleable.JazzyListView_effect, STANDARD);
        maxVelocity = a.getInteger(R.styleable.JazzyListView_max_velocity, MAX_VELOCITY_OFF);
        mOnlyAnimateNewItems = a.getBoolean(R.styleable.JazzyListView_only_animate_new_items, false);
        mOnlyAnimateOnFling = a.getBoolean(R.styleable.JazzyListView_max_velocity, false);
        mSimulateGridWithList = a.getBoolean(R.styleable.JazzyListView_simulate_grid_with_list, false);
        a.recycle();/*from w  w w  .  j av a 2  s .c om*/
    }

    setTransitionEffect(transitionEffect);
    setMaxAnimationVelocity(maxVelocity);
}