use of android.view.ViewPropertyAnimator in project android_frameworks_base by DirtyUnicorns.
the class RecentsView method onBusEvent.
public final void onBusEvent(DraggingInRecentsEndedEvent event) {
ViewPropertyAnimator animator = animate();
if (event.velocity > mFlingAnimationUtils.getMinVelocityPxPerSecond()) {
animator.translationY(getHeight());
animator.withEndAction(new Runnable() {
@Override
public void run() {
WindowManagerProxy.getInstance().maximizeDockedStack();
}
});
mFlingAnimationUtils.apply(animator, getTranslationY(), getHeight(), event.velocity);
} else {
animator.translationY(0f);
animator.setListener(null);
mFlingAnimationUtils.apply(animator, getTranslationY(), 0, event.velocity);
}
animator.start();
}
use of android.view.ViewPropertyAnimator in project LookLook by xinghongfei.
the class Fabbehavior method show.
//显示时的动画
private void show(final View view) {
ViewPropertyAnimator animator = view.animate().translationY(0).setInterpolator(INTERPOLATOR).setDuration(200);
animator.setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
view.setVisibility(View.VISIBLE);
isAnimate = true;
}
@Override
public void onAnimationEnd(Animator animator) {
isAnimate = false;
}
@Override
public void onAnimationCancel(Animator animator) {
hide(view);
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
animator.start();
}
use of android.view.ViewPropertyAnimator in project LookLook by xinghongfei.
the class Fabbehavior method hide.
//隐藏时的动画
private void hide(final View view) {
ViewPropertyAnimator animator = view.animate().translationY(viewY).setInterpolator(INTERPOLATOR).setDuration(200);
animator.setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
isAnimate = true;
}
@Override
public void onAnimationEnd(Animator animator) {
view.setVisibility(View.GONE);
isAnimate = false;
}
@Override
public void onAnimationCancel(Animator animator) {
show(view);
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
animator.start();
}
use of android.view.ViewPropertyAnimator in project GitTest by xiaoxige.
the class TitleChanger method doChange.
private void doChange(final long now, final CalendarDay currentMonth, boolean animate) {
title.animate().cancel();
doTranslation(title, 0);
title.setAlpha(1);
lastAnimTime = now;
final CharSequence newTitle = titleFormatter.format(currentMonth);
if (!animate) {
title.setText(newTitle);
} else {
final int translation = translate * (previousMonth.isBefore(currentMonth) ? 1 : -1);
final ViewPropertyAnimator viewPropertyAnimator = title.animate();
if (orientation == MaterialCalendarView.HORIZONTAL) {
viewPropertyAnimator.translationX(translation * -1);
} else {
viewPropertyAnimator.translationY(translation * -1);
}
viewPropertyAnimator.alpha(0).setDuration(animDuration).setInterpolator(interpolator).setListener(new AnimatorListener() {
@Override
public void onAnimationCancel(Animator animator) {
doTranslation(title, 0);
title.setAlpha(1);
}
@Override
public void onAnimationEnd(Animator animator) {
title.setText(newTitle);
doTranslation(title, translation);
final ViewPropertyAnimator viewPropertyAnimator = title.animate();
if (orientation == MaterialCalendarView.HORIZONTAL) {
viewPropertyAnimator.translationX(0);
} else {
viewPropertyAnimator.translationY(0);
}
viewPropertyAnimator.alpha(1).setDuration(animDuration).setInterpolator(interpolator).setListener(new AnimatorListener()).start();
}
}).start();
}
previousMonth = currentMonth;
}
use of android.view.ViewPropertyAnimator in project MTweaks-KernelAdiutorMOD by morogoku.
the class FrequencyButtonView method rotate.
private void rotate(final View v, boolean reverse) {
ViewPropertyAnimator animator = v.animate().setDuration(500).rotation(reverse ? -360 : 360);
animator.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
v.setRotation(0);
}
});
animator.start();
}
Aggregations