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();
}
}
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 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;
}
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);
}
Aggregations