use of android.view.RenderNodeAnimator in project android_frameworks_base by AOSPA.
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 AOSPA.
the class LockPatternView method startRtFloatAnimation.
private void startRtFloatAnimation(CanvasProperty<Float> property, float endValue, long delay, long duration, Interpolator interpolator) {
RenderNodeAnimator animator = new RenderNodeAnimator(property, endValue);
animator.setDuration(duration);
animator.setStartDelay(delay);
animator.setInterpolator(interpolator);
animator.setTarget(this);
animator.start();
}
use of android.view.RenderNodeAnimator in project android_frameworks_base by AOSPA.
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();
}
use of android.view.RenderNodeAnimator in project android_packages_apps_DUI by DirtyUnicorns.
the class OpaLayout method getTranslationAnimatorY.
private Animator getTranslationAnimatorY(View v, Interpolator interpolator, int duration) {
RenderNodeAnimator anim = new RenderNodeAnimator(1, 0);
anim.setTarget(v);
anim.setInterpolator(interpolator);
anim.setDuration(duration);
return anim;
}
use of android.view.RenderNodeAnimator in project android_packages_apps_DUI by DirtyUnicorns.
the class OpaLayout method getDeltaAnimatorY.
private Animator getDeltaAnimatorY(View v, Interpolator interpolator, float deltaY, int duration) {
RenderNodeAnimator anim = new RenderNodeAnimator(9, (int) (v.getY() + deltaY));
anim.setTarget(v);
anim.setInterpolator(interpolator);
anim.setDuration(duration);
return anim;
}
Aggregations