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

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

Merge "Add setters for solid/faded progress segment heights." into main

parents 63e7ebf3 b53f20ed
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -226,7 +226,9 @@ public final class NotificationProgressBar extends ProgressBar implements
    }
    }


    @NonNull
    @NonNull
    private NotificationProgressDrawable getNotificationProgressDrawable() {
    public NotificationProgressDrawable getNotificationProgressDrawable() {
        if (mNotificationProgressDrawable != null) return mNotificationProgressDrawable;

        final Drawable d = getProgressDrawable();
        final Drawable d = getProgressDrawable();
        if (d == null) {
        if (d == null) {
            throw new IllegalStateException("getProgressDrawable() returns null");
            throw new IllegalStateException("getProgressDrawable() returns null");
+28 −0
Original line number Original line Diff line number Diff line
@@ -90,6 +90,34 @@ public final class NotificationProgressDrawable extends Drawable {
        return mState.mPointRadius;
        return mState.mPointRadius;
    }
    }


    /**
     * <p>Set the segment height for the drawable.</p>
     * <p>Note: changing this property will affect all instances of a drawable loaded from a
     * resource. It is recommended to invoke {@link #mutate()} before changing this property.</p>
     *
     * @param height The height of the segments
     * @see #mutate()
     */
    public void setSegmentHeight(float height) {
        mState.mSegmentHeight = height;

        invalidateSelf();
    }

    /**
     * <p>Set the faded segment height for the drawable.</p>
     * <p>Note: changing this property will affect all instances of a drawable loaded from a
     * resource. It is recommended to invoke {@link #mutate()} before changing this property.</p>
     *
     * @param height The height of the faded segments
     * @see #mutate()
     */
    public void setFadedSegmentHeight(float height) {
        mState.mFadedSegmentHeight = height;

        invalidateSelf();
    }

    /**
    /**
     * Set the segments and points that constitute the drawable.
     * Set the segments and points that constitute the drawable.
     */
     */