use of android.view.animation.AccelerateDecelerateInterpolator in project react-native-navigation by wix.
the class TitleBar method show.
public void show(@Nullable final Runnable onDisplayed) {
setAlpha(0);
animate().alpha(1).setDuration(200).setInterpolator(new AccelerateDecelerateInterpolator()).setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (onDisplayed != null) {
onDisplayed.run();
}
}
});
}
use of android.view.animation.AccelerateDecelerateInterpolator in project PersistentSearch by KieronQuinn.
the class SearchBox method revealFrom.
private void revealFrom(float x, float y, Activity a, SearchBox s) {
FrameLayout layout = (FrameLayout) a.getWindow().getDecorView().findViewById(android.R.id.content);
RelativeLayout root = (RelativeLayout) s.findViewById(R.id.search_root);
Resources r = getResources();
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 96, r.getDisplayMetrics());
int finalRadius = (int) Math.max(layout.getWidth(), px);
SupportAnimator animator = ViewAnimationUtils.createCircularReveal(root, (int) x, (int) y, 0, finalRadius);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.setDuration(500);
animator.addListener(new SupportAnimator.AnimatorListener() {
@Override
public void onAnimationCancel() {
}
@Override
public void onAnimationEnd() {
toggleSearch();
}
@Override
public void onAnimationRepeat() {
}
@Override
public void onAnimationStart() {
}
});
animator.start();
}
use of android.view.animation.AccelerateDecelerateInterpolator in project PersistentSearch by KieronQuinn.
the class ViewAnimationUtils method liftingFromBottom.
/**
* Lifting view
*
* @param view The animation target
* @param baseRotation initial Rotation X in 3D space
* @param duration aniamtion duration
*/
public static void liftingFromBottom(View view, float baseRotation, int duration) {
ViewHelper.setRotationX(view, baseRotation);
ViewHelper.setTranslationY(view, view.getHeight() / 3);
ViewPropertyAnimator.animate(view).setInterpolator(new AccelerateDecelerateInterpolator()).setDuration(duration).rotationX(0).translationY(0).start();
}
use of android.view.animation.AccelerateDecelerateInterpolator in project SpotiQ by ZinoKader.
the class StartupActivity method prepareCircularRevealAnimation.
private Animator prepareCircularRevealAnimation() {
Animator circularRevealAnimation;
//calculate bounds
int x = binding.root.getWidth() / 2;
int y = binding.root.getHeight() / 2;
int startRadius = binding.logInButton.getWidth();
int endRadius = (int) Math.hypot(binding.root.getWidth(), binding.root.getHeight());
//hide unwanted views
binding.root.setVisibility(View.GONE);
binding.logInButton.setVisibility(View.GONE);
binding.spotiqLogo.setVisibility(View.GONE);
//prepare root view color
binding.root.setBackgroundColor(ContextCompat.getColor(this, R.color.colorAccent));
binding.root.setVisibility(View.VISIBLE);
circularRevealAnimation = ViewAnimationUtils.createCircularReveal(binding.root, x, y, startRadius, endRadius);
circularRevealAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
return circularRevealAnimation;
}
use of android.view.animation.AccelerateDecelerateInterpolator in project Material-Movies by saulmm.
the class GUIUtils method startScaleAnimationFromPivot.
public static void startScaleAnimationFromPivot(int pivotX, int pivotY, final View v, final AnimatorListener animatorListener) {
final AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
v.setScaleY(SCALE_START_ANCHOR);
v.setPivotX(pivotX);
v.setPivotY(pivotY);
v.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
v.getViewTreeObserver().removeOnPreDrawListener(this);
ViewPropertyAnimator viewPropertyAnimator = v.animate().setInterpolator(interpolator).scaleY(1).scaleX(1).setDuration(SCALE_DELAY);
if (animatorListener != null)
viewPropertyAnimator.setListener(animatorListener);
viewPropertyAnimator.start();
return true;
}
});
}
Aggregations