diff options
| author | ztenghui <ztenghui@google.com> | 2014-03-28 17:19:07 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-03-28 17:19:07 +0000 |
| commit | 1c97a5266a2cae8177721cab83c62436321e3b41 (patch) | |
| tree | 44ceb06654d02b7040eb65218088514ab13a45c0 /core/java/android/view | |
| parent | 0e14f2d45557527242f27ce7de9027e6ccaa45d6 (diff) | |
| parent | 4dc16b370ca633d6937c8e0ebf9f5aca46baa9a4 (diff) | |
| download | frameworks_base-1c97a5266a2cae8177721cab83c62436321e3b41.zip frameworks_base-1c97a5266a2cae8177721cab83c62436321e3b41.tar.gz frameworks_base-1c97a5266a2cae8177721cab83c62436321e3b41.tar.bz2 | |
Merge "Add RevealAnimator"
Diffstat (limited to 'core/java/android/view')
| -rw-r--r-- | core/java/android/view/View.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index f2b9b96..22ca418 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -16,6 +16,8 @@ package android.view; +import android.animation.RevealAnimator; +import android.animation.ValueAnimator; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; @@ -10810,6 +10812,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** + * Returns a ValueAnimator which can be used to run a reveal animation, + * clipping the content of the view to a circle. + * + * TODO: Make this a public API. + * @hide + */ + public final ValueAnimator createRevealAnimator(int x, int y, + float startRadius, float endRadius, boolean inverseClip) { + return RevealAnimator.ofRevealCircle(this, x, y, startRadius, endRadius, inverseClip); + } + + /** * Sets the outline of the view, which defines the shape of the shadow it * casts, and can used for clipping. * <p> @@ -10891,6 +10905,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, float x, float y, float radius) { if (mDisplayList != null) { mDisplayList.setRevealClip(shouldClip, inverseClip, x, y, radius); + // TODO: Handle this invalidate in a better way, or purely in native. + invalidate(); } } |
