use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Signal-Android by WhisperSystems.
the class ViewUtil method getAlphaAnimation.
private static Animation getAlphaAnimation(float from, float to, int duration) {
final Animation anim = new AlphaAnimation(from, to);
anim.setInterpolator(new FastOutSlowInInterpolator());
anim.setDuration(duration);
return anim;
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project Signal-Android by WhisperSystems.
the class InviteActivity method loadAnimation.
private Animation loadAnimation(@AnimRes int animResId) {
final Animation animation = AnimationUtils.loadAnimation(this, animResId);
animation.setInterpolator(new FastOutSlowInInterpolator());
return animation;
}
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();
}
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();
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project PreLollipopTransition by takahirom.
the class EndFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_end, container, false);
final ExitFragmentTransition exitFragmentTransition = FragmentTransition.with(this).interpolator(new LinearOutSlowInInterpolator()).to(v.findViewById(R.id.fragment_imageView)).start(savedInstanceState);
exitFragmentTransition.exitListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
Log.d("TAG", "onAnimationStart: ");
}
@Override
public void onAnimationEnd(Animator animation) {
Log.d("TAG", "onAnimationEnd: ");
}
}).interpolator(new FastOutSlowInInterpolator());
exitFragmentTransition.startExitListening();
return v;
}
Aggregations