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

Commit 542b26c3 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz Committed by Android (Google) Code Review
Browse files

Merge changes I58c0024d,I4b300e3d into main

* changes:
  [ProgressStyle] Document the default value for ID
  [ProgressStyle] Use IntRange in ProgressStyle
parents 14d4ea8a 2883db9f
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);
  }
+8 −2
Original line number Diff line number Diff line
@@ -11674,6 +11674,7 @@ public class Notification implements Parcelable
         * Gets the progress value of the progress bar.
         * @see #setProgress
         */
        @IntRange(from = 0)
        public int getProgress() {
            return mProgress;
        }
@@ -11685,7 +11686,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;
        }
@@ -11694,6 +11695,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()) {
@@ -12274,6 +12276,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;
            }
@@ -12289,6 +12292,7 @@ public class Notification implements Parcelable
            /**
             * Optional ID used to uniquely identify the element across updates.
             * The default is 0.
             */
            public @NonNull Segment setId(int id) {
                mId = id;
@@ -12340,7 +12344,7 @@ public class Notification implements Parcelable
        public static final class Point {
            private int mPosition;
            private int mId;
            private int mId = 0;
            @ColorInt
            private int mColor = Notification.COLOR_DEFAULT;
@@ -12360,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;
            }
@@ -12374,6 +12379,7 @@ public class Notification implements Parcelable
            /**
             * Optional ID used to uniquely identify the element across updates.
             * The default is 0.
             */
            public @NonNull Point setId(int id) {
                mId = id;