use of android.view.RenderNodeAnimator in project android_frameworks_base by DirtyUnicorns.
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 DirtyUnicorns.
the class KeyguardAffordanceView method startRtAlphaFadeIn.
/**
* Fades in the Circle on the RenderThread. It's used when finishing the circle when it had
* alpha 0 in the beginning.
*/
private void startRtAlphaFadeIn() {
if (mCircleRadius == 0 && mPreviewView == null) {
Paint modifiedPaint = new Paint(mCirclePaint);
modifiedPaint.setColor(mCircleColor);
modifiedPaint.setAlpha(0);
mHwCirclePaint = CanvasProperty.createPaint(modifiedPaint);
RenderNodeAnimator animator = new RenderNodeAnimator(mHwCirclePaint, RenderNodeAnimator.PAINT_ALPHA, 255);
animator.setTarget(this);
animator.setInterpolator(Interpolators.ALPHA_IN);
animator.setDuration(250);
animator.start();
}
}
use of android.view.RenderNodeAnimator in project android_frameworks_base by DirtyUnicorns.
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 DirtyUnicorns.
the class RippleBackground method createHardwareExit.
@Override
protected RenderNodeAnimatorSet createHardwareExit(Paint p) {
final RenderNodeAnimatorSet set = new RenderNodeAnimatorSet();
final int targetAlpha = p.getAlpha();
final int currentAlpha = (int) (mOpacity * targetAlpha + 0.5f);
p.setAlpha(currentAlpha);
mPropPaint = CanvasProperty.createPaint(p);
mPropRadius = CanvasProperty.createFloat(mTargetRadius);
mPropX = CanvasProperty.createFloat(0);
mPropY = CanvasProperty.createFloat(0);
final int fastEnterDuration = mIsBounded ? (int) ((1 - mOpacity) * OPACITY_ENTER_DURATION_FAST) : 0;
// Linear exit after enter is completed.
final RenderNodeAnimator exit = new RenderNodeAnimator(mPropPaint, RenderNodeAnimator.PAINT_ALPHA, 0);
exit.setInterpolator(LINEAR_INTERPOLATOR);
exit.setDuration(OPACITY_EXIT_DURATION);
if (fastEnterDuration > 0) {
exit.setStartDelay(fastEnterDuration);
exit.setStartValue(targetAlpha);
}
set.add(exit);
// Linear "fast" enter based on current opacity.
if (fastEnterDuration > 0) {
final RenderNodeAnimator enter = new RenderNodeAnimator(mPropPaint, RenderNodeAnimator.PAINT_ALPHA, targetAlpha);
enter.setInterpolator(LINEAR_INTERPOLATOR);
enter.setDuration(fastEnterDuration);
set.add(enter);
}
return set;
}
use of android.view.RenderNodeAnimator in project android_frameworks_base by crdroidandroid.
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();
}
Aggregations