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

Commit 3171e569 authored by Xiaowen Lei's avatar Xiaowen Lei Committed by Android (Google) Code Review
Browse files

Merge changes Ieb551182,I4778dfee,Ifc09326c,Ic513aef1 into main

* changes:
  Stretch and rescale segments to satisfy minimum width requirement.
  Move segment splitting by process after converting to drawable segments.
  Refactor to precalculate start/end positions for drawing Segment/Point.
  Fix documentation comments for NotificationProgressDrawable attributes.
parents a85e73c3 ef7cce26
Loading
Loading
Loading
Loading
+540 −65

File changed.

Preview size limit exceeded, changes collapsed.

+145 −227

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
            android:segPointGap="@dimen/notification_progress_segPoint_gap">
            <segments
                android:color="?attr/colorProgressBackgroundNormal"
                android:minWidth="@dimen/notification_progress_segments_min_width"
                android:height="@dimen/notification_progress_segments_height"
                android:fadedHeight="@dimen/notification_progress_segments_faded_height"
                android:cornerRadius="@dimen/notification_progress_segments_corner_radius"/>
+13 −9
Original line number Diff line number Diff line
@@ -7572,25 +7572,31 @@
    <!-- NotificationProgressDrawable class -->
    <!-- ================================== -->
    <!-- Drawable used to render a segmented bar, with segments and points. -->
    <!-- Drawable used to render a notification progress bar, with segments and points. -->
    <!-- @hide internal use only -->
    <declare-styleable name="NotificationProgressDrawable">
        <!-- Default color for the parts. -->
        <!-- The gap between two segments. -->
        <attr name="segSegGap" format="dimension" />
        <!-- The gap between a segment and a point. -->
        <attr name="segPointGap" format="dimension" />
    </declare-styleable>
    <!-- Used to config the segments of a NotificationProgressDrawable. -->
    <!-- @hide internal use only -->
    <declare-styleable name="NotificationProgressDrawableSegments">
        <!-- Height of the solid segments -->
        <!-- TODO: b/372908709 - maybe move this to NotificationProgressBar, because that's the only
         place this is used actually. Same for NotificationProgressDrawable.segSegGap/segPointGap
         above. -->
        <!-- Minimum required drawing width. The drawing width refers to the width after
         the original segments have been adjusted for the neighboring Points and gaps. This is
         enforced by stretching the segments that are too short. -->
        <attr name="minWidth" format="dimension" />
        <!-- Height of the solid segments. -->
        <attr name="height" />
        <!-- Height of the faded segments -->
        <!-- Height of the faded segments. -->
        <attr name="fadedHeight" format="dimension" />
        <!-- Corner radius of the segment rect. -->
        <attr name="cornerRadius" format="dimension" />
        <!-- Default color of the segment. -->
        <attr name="color" />
    </declare-styleable>
    <!-- Used to config the points of a NotificationProgressDrawable. -->
@@ -7602,8 +7608,6 @@
        <attr name="inset" />
        <!-- Corner radius of the point rect. -->
        <attr name="cornerRadius"/>
        <!-- Default color of the point rect. -->
        <attr name="color" />
    </declare-styleable>
    <!-- ========================== -->
+2 −0
Original line number Diff line number Diff line
@@ -899,6 +899,8 @@
    <dimen name="notification_progress_segSeg_gap">4dp</dimen>
    <!-- The gap between a segment and a point in the notification progress bar -->
    <dimen name="notification_progress_segPoint_gap">4dp</dimen>
    <!-- The minimum required drawing width of the notification progress bar segments -->
    <dimen name="notification_progress_segments_min_width">16dp</dimen>
    <!-- The height of the notification progress bar segments -->
    <dimen name="notification_progress_segments_height">6dp</dimen>
    <!-- The height of the notification progress bar faded segments -->
Loading