Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74f8d6db authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[ProgressStyle] Use IntRange in ProgressStyle

Bug: 414668120
Test: Presubmit
Flag: android.app.api_rich_ongoing
Change-Id: I4b300e3dc4781a1406d4d5d5b2fe67a003b21215
parent 65874ee5
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -6982,16 +6982,16 @@ package android.app {
    ctor public Notification.ProgressStyle();
    method @NonNull public android.app.Notification.ProgressStyle addProgressPoint(@NonNull android.app.Notification.ProgressStyle.Point);
    method @NonNull public android.app.Notification.ProgressStyle addProgressSegment(@NonNull android.app.Notification.ProgressStyle.Segment);
    method public int getProgress();
    method @IntRange(from=0) public int getProgress();
    method @Nullable public android.graphics.drawable.Icon getProgressEndIcon();
    method public int getProgressMax();
    method @IntRange(from=0) public int getProgressMax();
    method @NonNull public java.util.List<android.app.Notification.ProgressStyle.Point> getProgressPoints();
    method @NonNull public java.util.List<android.app.Notification.ProgressStyle.Segment> getProgressSegments();
    method @Nullable public android.graphics.drawable.Icon getProgressStartIcon();
    method @Nullable public android.graphics.drawable.Icon getProgressTrackerIcon();
    method public boolean isProgressIndeterminate();
    method public boolean isStyledByProgress();
    method @NonNull public android.app.Notification.ProgressStyle setProgress(int);
    method @NonNull public android.app.Notification.ProgressStyle setProgress(@IntRange(from=0) int);
    method @NonNull public android.app.Notification.ProgressStyle setProgressEndIcon(@Nullable android.graphics.drawable.Icon);
    method @NonNull public android.app.Notification.ProgressStyle setProgressIndeterminate(boolean);
    method @NonNull public android.app.Notification.ProgressStyle setProgressPoints(@NonNull java.util.List<android.app.Notification.ProgressStyle.Point>);
@@ -7005,7 +7005,7 @@ package android.app {
    ctor public Notification.ProgressStyle.Point(@IntRange(from=1) int);
    method @ColorInt public int getColor();
    method public int getId();
    method public int getPosition();
    method @IntRange(from=1) public int getPosition();
    method @NonNull public android.app.Notification.ProgressStyle.Point setColor(@ColorInt int);
    method @NonNull public android.app.Notification.ProgressStyle.Point setId(int);
  }
@@ -7014,7 +7014,7 @@ package android.app {
    ctor public Notification.ProgressStyle.Segment(@IntRange(from=1) int);
    method @ColorInt public int getColor();
    method public int getId();
    method public int getLength();
    method @IntRange(from=1) public int getLength();
    method @NonNull public android.app.Notification.ProgressStyle.Segment setColor(@ColorInt int);
    method @NonNull public android.app.Notification.ProgressStyle.Segment setId(int);
  }
+5 −1
Original line number Diff line number Diff line
@@ -11675,6 +11675,7 @@ public class Notification implements Parcelable
         * Gets the progress value of the progress bar.
         * @see #setProgress
         */
        @IntRange(from = 0)
        public int getProgress() {
            return mProgress;
        }
@@ -11686,7 +11687,7 @@ public class Notification implements Parcelable
        * The max progress value is the sum of all Segment lengths.
        * The default value is 0.
        */
        public @NonNull ProgressStyle setProgress(int progress) {
        public @NonNull ProgressStyle setProgress(@IntRange(from = 0) int progress) {
            mProgress = progress;
            return this;
        }
@@ -11695,6 +11696,7 @@ public class Notification implements Parcelable
         * Gets the sum of the lengths of all Segments in the style, which
         * defines the maximum progress. Defaults to 100 when segments are omitted.
         */
        @IntRange(from = 0)
        public int getProgressMax() {
            final List<Segment> progressSegment = mProgressSegments;
            if (progressSegment == null || progressSegment.isEmpty()) {
@@ -12275,6 +12277,7 @@ public class Notification implements Parcelable
             * This value has no units, it is just relative to the length of other segments,
             * and the value provided to {@link ProgressStyle#setProgress}.
             */
            @IntRange(from = 1)
            public int getLength() {
                return mLength;
            }
@@ -12361,6 +12364,7 @@ public class Notification implements Parcelable
             * The position of this point on the progress bar
             * relative to {@link ProgressStyle#getProgressMax}.
             */
            @IntRange(from = 1)
            public int getPosition() {
                return mPosition;
            }