summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt1
-rw-r--r--core/java/android/view/View.java37
2 files changed, 32 insertions, 6 deletions
diff --git a/api/current.txt b/api/current.txt
index 6da1a5dee47c..9328f3b039d4 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -29319,6 +29319,7 @@ package android.view {
method protected int computeVerticalScrollRange();
method public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo();
method public void createContextMenu(android.view.ContextMenu);
+ method public final android.animation.ValueAnimator createRevealAnimator(int, int, float, float);
method public void destroyDrawingCache();
method public android.view.WindowInsets dispatchApplyWindowInsets(android.view.WindowInsets);
method public void dispatchConfigurationChanged(android.content.res.Configuration);
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 22ca41898833..9e18a1a91f93 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -10812,15 +10812,40 @@ 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.
+ * Returns a ValueAnimator which can animate a clipping circle.
+ * <p>
+ * The View will be clipped to the animating circle.
+ * <p>
+ * Any shadow cast by the View will respect the circular clip from this animator.
+ *
+ * @param centerX The x coordinate of the center of the animating circle.
+ * @param centerY The y coordinate of the center of the animating circle.
+ * @param startRadius The starting radius of the animating circle.
+ * @param endRadius The ending radius of the animating circle.
+ */
+ public final ValueAnimator createRevealAnimator(int centerX, int centerY,
+ float startRadius, float endRadius) {
+ return RevealAnimator.ofRevealCircle(this, centerX, centerY,
+ startRadius, endRadius, false);
+ }
+
+ /**
+ * Returns a ValueAnimator which can animate a clearing circle.
+ * <p>
+ * The View is prevented from drawing within the circle, so the content
+ * behind the View shows through.
+ *
+ * @param centerX The x coordinate of the center of the animating circle.
+ * @param centerY The y coordinate of the center of the animating circle.
+ * @param startRadius The starting radius of the animating circle.
+ * @param endRadius The ending radius of the animating 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);
+ public final ValueAnimator createClearCircleAnimator(int centerX, int centerY,
+ float startRadius, float endRadius) {
+ return RevealAnimator.ofRevealCircle(this, centerX, centerY,
+ startRadius, endRadius, true);
}
/**