From ac6fc83063991912adc3167bdf65b5c33c71ea86 Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 19 Aug 2020 09:21:56 -0700 Subject: [PATCH] Add missing @FloatRange Test: none Fixes: 121220209 Change-Id: Ifcc090414cd885817dfc88d9c059a1a70c305fe1 --- api/current.txt | 2 +- core/java/android/view/ViewPropertyAnimator.java | 3 ++- non-updatable-api/current.txt | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/current.txt b/api/current.txt index 532c3d9383349..8c118f766718e 100644 --- a/api/current.txt +++ b/api/current.txt @@ -55185,7 +55185,7 @@ package android.view { } public class ViewPropertyAnimator { - method public android.view.ViewPropertyAnimator alpha(float); + method public android.view.ViewPropertyAnimator alpha(@FloatRange(from=0.0f, to=1.0f) float); method public android.view.ViewPropertyAnimator alphaBy(float); method public void cancel(); method public long getDuration(); diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java index 859e9a43f7c27..65cc2f8bcd5af 100644 --- a/core/java/android/view/ViewPropertyAnimator.java +++ b/core/java/android/view/ViewPropertyAnimator.java @@ -19,6 +19,7 @@ package android.view; import android.animation.Animator; import android.animation.TimeInterpolator; import android.animation.ValueAnimator; +import android.annotation.FloatRange; import android.graphics.RenderNode; import java.util.ArrayList; @@ -725,7 +726,7 @@ public class ViewPropertyAnimator { * @see View#setAlpha(float) * @return This object, allowing calls to methods in this class to be chained. */ - public ViewPropertyAnimator alpha(float value) { + public ViewPropertyAnimator alpha(@FloatRange(from = 0.0f, to = 1.0f) float value) { animateProperty(ALPHA, value); return this; } diff --git a/non-updatable-api/current.txt b/non-updatable-api/current.txt index f9d0d14c73356..c18b701a5b912 100644 --- a/non-updatable-api/current.txt +++ b/non-updatable-api/current.txt @@ -53328,7 +53328,7 @@ package android.view { } public class ViewPropertyAnimator { - method public android.view.ViewPropertyAnimator alpha(float); + method public android.view.ViewPropertyAnimator alpha(@FloatRange(from=0.0f, to=1.0f) float); method public android.view.ViewPropertyAnimator alphaBy(float); method public void cancel(); method public long getDuration();