use of android.view.RenderNodeAnimator in project android_frameworks_base by AOSPA.
the class AppearAnimationUtils method createAnimation.
@Override
public void createAnimation(final View view, long delay, long duration, float translationY, boolean appearing, Interpolator interpolator, final Runnable endRunnable) {
if (view != null) {
view.setAlpha(appearing ? 0f : 1.0f);
view.setTranslationY(appearing ? translationY : 0);
Animator alphaAnim;
float targetAlpha = appearing ? 1f : 0f;
if (view.isHardwareAccelerated()) {
RenderNodeAnimator alphaAnimRt = new RenderNodeAnimator(RenderNodeAnimator.ALPHA, targetAlpha);
alphaAnimRt.setTarget(view);
alphaAnim = alphaAnimRt;
} else {
alphaAnim = ObjectAnimator.ofFloat(view, View.ALPHA, view.getAlpha(), targetAlpha);
}
alphaAnim.setInterpolator(interpolator);
alphaAnim.setDuration(duration);
alphaAnim.setStartDelay(delay);
if (view.hasOverlappingRendering()) {
view.setLayerType(View.LAYER_TYPE_HARDWARE, null);
alphaAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.setLayerType(View.LAYER_TYPE_NONE, null);
}
});
}
if (endRunnable != null) {
alphaAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
endRunnable.run();
}
});
}
alphaAnim.start();
startTranslationYAnimation(view, delay, duration, appearing ? 0 : translationY, interpolator);
}
}
use of android.view.RenderNodeAnimator in project android_frameworks_base by AOSPA.
the class KeyButtonRipple method exitHardware.
private void exitHardware() {
mPaintProp = CanvasProperty.createPaint(getRipplePaint());
final RenderNodeAnimator opacityAnim = new RenderNodeAnimator(mPaintProp, RenderNodeAnimator.PAINT_ALPHA, 0);
opacityAnim.setDuration(ANIMATION_DURATION_FADE);
opacityAnim.setInterpolator(Interpolators.ALPHA_OUT);
opacityAnim.addListener(mAnimatorListener);
opacityAnim.setTarget(mTargetView);
opacityAnim.start();
mRunningAnimations.add(opacityAnim);
invalidateSelf();
}
use of android.view.RenderNodeAnimator in project android_frameworks_base by crdroidandroid.
the class AppearAnimationUtils method startTranslationYAnimation.
public static void startTranslationYAnimation(View view, long delay, long duration, float endTranslationY, Interpolator interpolator) {
Animator translationAnim;
if (view.isHardwareAccelerated()) {
RenderNodeAnimator translationAnimRt = new RenderNodeAnimator(RenderNodeAnimator.TRANSLATION_Y, endTranslationY);
translationAnimRt.setTarget(view);
translationAnim = translationAnimRt;
} else {
translationAnim = ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, view.getTranslationY(), endTranslationY);
}
translationAnim.setInterpolator(interpolator);
translationAnim.setDuration(duration);
translationAnim.setStartDelay(delay);
translationAnim.start();
}
use of android.view.RenderNodeAnimator in project android_frameworks_base by crdroidandroid.
the class KeyguardAffordanceView method getRtAnimatorToRadius.
private Animator getRtAnimatorToRadius(float circleRadius) {
RenderNodeAnimator animator = new RenderNodeAnimator(mHwCircleRadius, circleRadius);
animator.setTarget(this);
return animator;
}
use of android.view.RenderNodeAnimator in project android_frameworks_base by ResurrectionRemix.
the class LockPatternView method startRtAlphaAnimation.
private void startRtAlphaAnimation(CellState cellState, float endAlpha, long delay, long duration, Interpolator interpolator, Animator.AnimatorListener listener) {
RenderNodeAnimator animator = new RenderNodeAnimator(cellState.hwPaint, RenderNodeAnimator.PAINT_ALPHA, (int) (endAlpha * 255));
animator.setDuration(duration);
animator.setStartDelay(delay);
animator.setInterpolator(interpolator);
animator.setTarget(this);
animator.addListener(listener);
animator.start();
}
Aggregations