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();
}
use of android.view.RenderNodeAnimator in project android_frameworks_base by crdroidandroid.
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();
}
Aggregations