use of android.view.RenderNodeAnimator in project platform_frameworks_base by android.
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 platform_frameworks_base by android.
the class MainActivity method onItemClick.
@Override
public void onItemClick(final AdapterView<?> adapterView, View clickedView, int clickedPosition, long clickedId) {
int topPosition = adapterView.getFirstVisiblePosition();
int dy = adapterView.getHeight();
for (int i = 0; i < adapterView.getChildCount(); i++) {
int pos = topPosition + i;
View child = adapterView.getChildAt(i);
float delta = (pos - clickedPosition) * 1.1f;
if (delta == 0)
delta = -1;
RenderNodeAnimator animator = new RenderNodeAnimator(RenderNodeAnimator.TRANSLATION_Y, dy * delta);
animator.setDuration(DURATION);
if (child == clickedView)
logTranslationY(clickedView);
animator.setTarget(child);
animator.start();
if (child == clickedView)
logTranslationY(clickedView);
}
//mHandler.postDelayed(mLaunchActivity, (long) (DURATION * .4));
mLaunchActivity.run();
}
use of android.view.RenderNodeAnimator in project android_frameworks_base by DirtyUnicorns.
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_frameworks_base by DirtyUnicorns.
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 DirtyUnicorns.
the class RippleForeground method createHardwareExit.
@Override
protected RenderNodeAnimatorSet createHardwareExit(Paint p) {
final int radiusDuration;
final int originDuration;
final int opacityDuration;
if (mIsBounded) {
computeBoundedTargetValues();
radiusDuration = BOUNDED_RADIUS_EXIT_DURATION;
originDuration = BOUNDED_ORIGIN_EXIT_DURATION;
opacityDuration = BOUNDED_OPACITY_EXIT_DURATION;
} else {
radiusDuration = getRadiusExitDuration();
originDuration = radiusDuration;
opacityDuration = getOpacityExitDuration();
}
final float startX = getCurrentX();
final float startY = getCurrentY();
final float startRadius = getCurrentRadius();
p.setAlpha((int) (p.getAlpha() * mOpacity + 0.5f));
mPropPaint = CanvasProperty.createPaint(p);
mPropRadius = CanvasProperty.createFloat(startRadius);
mPropX = CanvasProperty.createFloat(startX);
mPropY = CanvasProperty.createFloat(startY);
final RenderNodeAnimator radius = new RenderNodeAnimator(mPropRadius, mTargetRadius);
radius.setDuration(radiusDuration);
radius.setInterpolator(DECELERATE_INTERPOLATOR);
final RenderNodeAnimator x = new RenderNodeAnimator(mPropX, mTargetX);
x.setDuration(originDuration);
x.setInterpolator(DECELERATE_INTERPOLATOR);
final RenderNodeAnimator y = new RenderNodeAnimator(mPropY, mTargetY);
y.setDuration(originDuration);
y.setInterpolator(DECELERATE_INTERPOLATOR);
final RenderNodeAnimator opacity = new RenderNodeAnimator(mPropPaint, RenderNodeAnimator.PAINT_ALPHA, 0);
opacity.setDuration(opacityDuration);
opacity.setInterpolator(LINEAR_INTERPOLATOR);
opacity.addListener(mAnimationListener);
final RenderNodeAnimatorSet set = new RenderNodeAnimatorSet();
set.add(radius);
set.add(opacity);
set.add(x);
set.add(y);
return set;
}
Aggregations