| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.view; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.graphics.CanvasProperty; |
| 21 |
import android.graphics.Paint; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
public class RenderNodeAnimator extends android.graphics.animation.RenderNodeAnimator |
| 27 |
implements android.graphics.animation.RenderNodeAnimator.ViewListener { |
| 28 |
|
| 29 |
private View mViewTarget; |
| 30 |
|
| 31 |
public RenderNodeAnimator(int property, float finalValue) { |
| 32 |
super(property, finalValue); |
| 33 |
} |
| 34 |
|
| 35 |
public RenderNodeAnimator(CanvasProperty<Float> property, float finalValue) { |
| 36 |
super(property, finalValue); |
| 37 |
} |
| 38 |
|
| 39 |
public RenderNodeAnimator(CanvasProperty<Paint> property, int paintField, float finalValue) { |
| 40 |
super(property, paintField, finalValue); |
| 41 |
} |
| 42 |
|
| 43 |
public RenderNodeAnimator(int x, int y, float startRadius, float endRadius) { |
| 44 |
super(x, y, startRadius, endRadius); |
| 45 |
} |
| 46 |
|
| 47 |
@Override |
| 48 |
public void onAlphaAnimationStart(float finalAlpha) { |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
mViewTarget.ensureTransformationInfo(); |
| 53 |
mViewTarget.setAlphaInternal(finalAlpha); |
| 54 |
} |
| 55 |
|
| 56 |
@Override |
| 57 |
public void invalidateParent(boolean forceRedraw) { |
| 58 |
mViewTarget.invalidateViewProperty(true, false); |
| 59 |
} |
| 60 |
|
| 61 |
|
| 62 |
public void setTarget(@NonNull View view) { |
| 63 |
mViewTarget = view; |
| 64 |
setViewListener(this); |
| 65 |
setTarget(mViewTarget.mRenderNode); |
| 66 |
} |
| 67 |
} |