use of android.support.v4.view.animation.FastOutSlowInInterpolator in project TextSurface by elevenetc.
the class Slide method start.
@Override
public void start(@Nullable final IEndListener listener) {
text.setAlpha(255);
PropertyValuesHolder hHolder = null;
PropertyValuesHolder vHolder = null;
float fromX = 0;
float toX = 0;
float fromY = 0;
float toY = 0;
if ((side & Side.LEFT) == side) {
if (toShow) {
fromX = -text.getWidth();
} else {
toX = -text.getWidth();
}
hHolder = PropertyValuesHolder.ofFloat("xOffset", fromX, toX);
} else if ((side & Side.RIGHT) == side) {
if (toShow) {
fromX = text.getWidth();
} else {
toX = text.getWidth();
}
hHolder = PropertyValuesHolder.ofFloat("xOffset", fromX, toX);
}
if ((side & Side.TOP) == side) {
if (toShow) {
fromY = -text.getHeight();
} else {
toY = -text.getHeight();
}
vHolder = PropertyValuesHolder.ofFloat("yOffset", fromY, toY);
} else if ((side & Side.BOTTOM) == side) {
if (toShow) {
fromY = text.getHeight();
} else {
toY = text.getHeight();
}
vHolder = PropertyValuesHolder.ofFloat("yOffset", fromY, toY);
}
if (hHolder != null && vHolder != null) {
animator = ObjectAnimator.ofPropertyValuesHolder(this, hHolder, vHolder);
} else if (hHolder != null) {
animator = ObjectAnimator.ofPropertyValuesHolder(this, hHolder);
} else {
animator = ObjectAnimator.ofPropertyValuesHolder(this, vHolder);
}
animator.setInterpolator(new FastOutSlowInInterpolator());
Utils.addEndListener(this, animator, new IEndListener() {
@Override
public void onAnimationEnd(ISurfaceAnimation animation) {
text.removeEffect(Slide.this);
if (!toShow)
text.setAlpha(0);
if (listener != null)
listener.onAnimationEnd(Slide.this);
}
});
animator.setDuration(duration);
animator.addUpdateListener(this);
animator.start();
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project TextSurface by elevenetc.
the class TransSurface method start.
@Override
public void start(@Nullable final IEndListener listener) {
float fromX = camera.getTransX();
float fromY = camera.getTransY();
float toX;
float toY;
if (textPivot == null) {
toX = camera.getTransX() + dx;
toY = camera.getTransY() + dy;
} else {
toX = textPivot.getPosition().getRelativeX(pivot, textPivot, true) * camera.getScale() * -1;
toY = textPivot.getPosition().getRelativeY(pivot, textPivot, true) * camera.getScale() * -1;
}
debugTranslation(fromX, fromY, toX, toY);
PropertyValuesHolder dxHolder = PropertyValuesHolder.ofFloat("transX", fromX, toX);
PropertyValuesHolder dyHolder = PropertyValuesHolder.ofFloat("transY", fromY, toY);
animator = ObjectAnimator.ofPropertyValuesHolder(camera, dxHolder, dyHolder);
animator.setInterpolator(new FastOutSlowInInterpolator());
Utils.addEndListener(this, animator, listener);
animator.setDuration(duration);
animator.addUpdateListener(this);
animator.start();
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project ListenerMusicPlayer by hefuyicoder.
the class RotationFabBehavior method hide.
private void hide(final FloatingActionButton floatingActionButton) {
AnimatorSet fabAnimation = (AnimatorSet) AnimatorInflater.loadAnimator(floatingActionButton.getContext(), R.animator.float_button_out);
fabAnimation.setTarget(floatingActionButton);
fabAnimation.setInterpolator(new FastOutSlowInInterpolator());
fabAnimation.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
isAnimate = true;
}
@Override
public void onAnimationEnd(Animator animation) {
floatingActionButton.setVisibility(View.GONE);
isAnimate = false;
}
@Override
public void onAnimationCancel(Animator animation) {
show(floatingActionButton);
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
fabAnimation.start();
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Transitions-Everywhere by andkulikov.
the class InterpolatorDurationStartDelaySample method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_interpolator, container, false);
final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
final View button = transitionsContainer.findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
boolean mToRightAnimation;
@Override
public void onClick(View v) {
mToRightAnimation = !mToRightAnimation;
Transition transition = new ChangeBounds();
transition.setDuration(mToRightAnimation ? 700 : 300);
transition.setInterpolator(mToRightAnimation ? new FastOutSlowInInterpolator() : new AccelerateInterpolator());
transition.setStartDelay(mToRightAnimation ? 0 : 500);
TransitionManager.beginDelayedTransition(transitionsContainer, transition);
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) button.getLayoutParams();
params.gravity = mToRightAnimation ? (Gravity.RIGHT | Gravity.TOP) : (Gravity.LEFT | Gravity.TOP);
button.setLayoutParams(params);
}
});
return view;
}
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;
}
Aggregations