private ViewPropertyAnimatorCompat buildAnimation(View view) { ViewPropertyAnimatorCompat animatorCompat = ViewCompat.animate(view); animatorCompat.alpha(0f); animatorCompat.scaleX(0f).scaleY(0f); return animatorCompat; }
private void animateIconScale(float scale) { ViewCompat.animate(iconView) .setDuration(ANIMATION_DURATION) .scaleX(scale) .scaleY(scale) .start(); }
/** * Hides the badge with a neat little scale animation. */ void hide() { isVisible = false; ViewCompat.animate(this) .setDuration(150) .alpha(0) .scaleX(0) .scaleY(0) .start(); }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { ViewCompat.animate(fab) .scaleX(1.0F) .scaleY(1.0F) .alpha(1.0F)
/** * Shows the badge with a neat little scale animation. */ void show() { isVisible = true; ViewCompat.animate(this) .setDuration(150) .alpha(1) .scaleX(1) .scaleY(1) .start(); }
public static void scaleOut(final View fab, long duration, final ScaleCallback callback) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { ViewCompat.animate(fab) .scaleX(0.0F) .scaleY(0.0F).alpha(0.0F) .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
private void animateTitle(int padding, float scale, float alpha) { if (type == Type.TABLET && isTitleless) { return; } setTopPaddingAnimated(iconView.getPaddingTop(), padding); ViewPropertyAnimatorCompat titleAnimator = ViewCompat.animate(titleView) .setDuration(ANIMATION_DURATION) .scaleX(scale) .scaleY(scale); titleAnimator.alpha(alpha); titleAnimator.start(); }
protected void animateRemoveImpl(final RecyclerView.ViewHolder holder) { final View view = holder.itemView; final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view); mRemoveAnimations.add(holder); animation.setDuration(getRemoveDuration()) .scaleX(0) .scaleY(0) .alpha(0) .translationX(+mRecyclerView.getLayoutManager().getWidth()) .setListener(new VpaListenerAdapter() { @Override public void onAnimationStart(View view) { dispatchRemoveStarting(holder); } @Override public void onAnimationEnd(View view) { animation.setListener(null); ViewCompat.setAlpha(view, 1); ViewCompat.setScaleX(view, 0); ViewCompat.setScaleY(view, 0); ViewCompat.setTranslationX(view, +mRecyclerView.getLayoutManager().getWidth()); dispatchRemoveFinished(holder); mRemoveAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start(); }
protected void animateRemoveImpl(final RecyclerView.ViewHolder holder) { final View view = holder.itemView; final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view); mRemoveAnimations.add(holder); animation.setDuration(getRemoveDuration()) .alpha(0) .scaleX(0) .scaleY(0) .setListener(new VpaListenerAdapter() { @Override public void onAnimationStart(View view) { dispatchRemoveStarting(holder); } @Override public void onAnimationEnd(View view) { animation.setListener(null); ViewCompat.setAlpha(view, 1); ViewCompat.setScaleX(view, 0); ViewCompat.setScaleY(view, 0); dispatchRemoveFinished(holder); mRemoveAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start(); }
final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view); mAddAnimations.add(holder); animation.scaleX(1) .scaleY(1) .alpha(1)
.scaleX(1f) .scaleY(1f) .alpha(1f)
public static void scaleShow(View view, ViewPropertyAnimatorListener listener) { ViewCompat.animate(view).scaleX(1.0f).scaleY(1.0f).alpha(1.0f).setDuration(DURATION).setListener(listener).setInterpolator(INTERPOLATOR).withLayer().start(); }
animation.scaleX(1) .scaleY(1) .translationX(0)
public static void scaleHide(View view, ViewPropertyAnimatorListener listener) { ViewCompat.animate(view).scaleX(0f).scaleY(0f).alpha(0f).setDuration(DURATION).setListener(listener).setInterpolator(INTERPOLATOR).withLayer().start(); }
public DurXAnimator scaleX(float scale) { animator.scaleX(scale); return this; }
public DurXAnimator scale(float scale) { animator.scaleX(scale); animator.scaleY(scale); return this; }
public static void scaleShow(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) { view.setVisibility(View.VISIBLE); ViewCompat.animate(view) .scaleX(1.0f) .scaleY(1.0f) .alpha(1.0f) .setDuration(800) .setListener(viewPropertyAnimatorListener) .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR) .start(); }
public static void scaleHide(View view, ViewPropertyAnimatorListener viewPropertyAnimatorListener) { ViewCompat.animate(view) .scaleX(0.0f) .scaleY(0.0f) .alpha(0.0f) .setDuration(800) .setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR) .setListener(viewPropertyAnimatorListener) .start(); }
public void expand() { if (!expanded) { ViewCompat.animate(editText) .alpha(1f) .setDuration(ANIMATION_DURATION); ViewCompat.animate(card) .scaleY(1f) .setDuration(ANIMATION_DURATION); ViewCompat.animate(label) .alpha(0.4f) .scaleX(0.7f) .scaleY(0.7f) .translationY(-labelTopMargin) .setDuration(ANIMATION_DURATION); ViewCompat.animate(image) .alpha(1f) .scaleX(1f) .scaleY(1f) .setDuration(ANIMATION_DURATION); if (editText != null) { editText.requestFocus(); } if (OPEN_KEYBOARD_ON_FOCUS) { inputMethodManager.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT); } expanded = true; } }
ViewCompat.animate(overlayView) .translationX(0) .scaleX(1.0f) .scaleY(1.0f) .translationZ(0.0f)