use of android.view.ViewPropertyAnimator in project android_frameworks_base by crdroidandroid.
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 animate by hitherejoe.
the class ViewPropertyAnimatorActivity method buildAndStartAnimation.
private void buildAndStartAnimation(View view) {
ViewPropertyAnimator animator = view.animate();
if (mAnimateAlphaCheck.isChecked() || view.getAlpha() == 0f) {
float animationValue = view.getAlpha() == 0f ? 1f : 0f;
animator.alpha(animationValue);
}
if (mAnimateScaleCheck.isChecked()) {
float animationValue = view.getScaleY() == 0f ? 1f : 0f;
animator.scaleX(animationValue).scaleY(animationValue);
}
if (mAnimateZCheck.isChecked()) {
float animationValue = view.getTranslationZ() != 25f ? 25f : 2f;
animator.translationZ(animationValue);
}
if (mAnimationDurationCheck.isChecked()) {
animator.setDuration(500l);
}
if (mAnimationDelayCheck.isChecked()) {
animator.setStartDelay(500l);
}
animator.setInterpolator(getSelectedInterpolator());
animator.start();
}
use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.
the class GUIUtils method startScaleAnimationFromPivotY.
public static void startScaleAnimationFromPivotY(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).setDuration(SCALE_DELAY);
if (animatorListener != null)
viewPropertyAnimator.setListener(animatorListener);
viewPropertyAnimator.start();
return true;
}
});
}
use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.
the class GUIUtils method hideScaleAnimationFromPivot.
public static void hideScaleAnimationFromPivot(View v, AnimatorListener animatorListener) {
ViewPropertyAnimator viewPropertyAnimator = v.animate().setInterpolator(new AccelerateDecelerateInterpolator()).scaleY(SCALE_START_ANCHOR).setDuration(SCALE_DELAY);
if (animatorListener != null)
viewPropertyAnimator.setListener(animatorListener);
viewPropertyAnimator.start();
}
use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.
the class GUIUtils method showViewByScaleY.
/**
* Shows a view by scaling
*
* @param v the view to be scaled
*
* @return the ViewPropertyAnimation to manage the animation
*/
public static ViewPropertyAnimator showViewByScaleY(View v, AnimatorListener animatorListener) {
ViewPropertyAnimator propertyAnimator = v.animate().setStartDelay(SCALE_DELAY).scaleY(1);
propertyAnimator.setListener(animatorListener);
return propertyAnimator;
}
Aggregations