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

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

Merge "[Burn-in] Reduce progressbar height for ProgressStyle Notification" into main

parents 5d8036d4 a924ce95
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -880,6 +880,12 @@
    <!-- Border width for avatars in the face pile shown on one-line (children of a group) conversation notifications -->
    <dimen name="conversation_single_line_face_pile_protection_width">1dp</dimen>

    <!-- The height/thickness of progress of the progress bar in ProgressStyle Notification -->
    <dimen name="notification_aod_progress_style_progress_thickness">2dp</dimen>

    <!-- The height/thickness of ahead progress of the progress bar in ProgressStyle Notification -->
    <dimen name="notification_aod_progress_style_ahead_progress_thickness">1dp</dimen>

    <!-- The minimum amount of top overscroll to go to the quick settings. -->
    <dimen name="min_top_overscroll_to_qs">36dp</dimen>

+15 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ import com.android.internal.widget.CachingIconView
import com.android.internal.widget.ImageFloatingTextView
import com.android.internal.widget.NotificationExpandButton
import com.android.internal.widget.NotificationProgressBar
import com.android.internal.widget.NotificationProgressDrawable
import com.android.internal.widget.NotificationProgressModel
import com.android.systemui.FontStyles
import com.android.systemui.lifecycle.rememberViewModel
@@ -333,6 +334,15 @@ private class AODPromotedNotificationViewUpdater(root: View) {
            )
        }

    private val progressStyleProgressThickness: Float =
        root.context.resources.getDimension(
            systemuiR.dimen.notification_aod_progress_style_progress_thickness
        )
    private val progressStyleProgressAheadThickness: Float =
        root.context.resources.getDimension(
            systemuiR.dimen.notification_aod_progress_style_ahead_progress_thickness
        )

    private data class SmallIconSavedState(val background: Drawable?, val padding: Rect)

    private var smallIconSavedState: SmallIconSavedState? = null
@@ -449,6 +459,11 @@ private class AODPromotedNotificationViewUpdater(root: View) {
    private fun updateNewProgressBar(content: PromotedNotificationContentModel) {
        val newProgressBar = newProgressBar ?: return

        (newProgressBar.notificationProgressDrawable.mutate() as? NotificationProgressDrawable)
            ?.setSegmentHeight(progressStyleProgressThickness)
        (newProgressBar.notificationProgressDrawable.mutate() as? NotificationProgressDrawable)
            ?.setFadedSegmentHeight(progressStyleProgressAheadThickness)

        if (content.newProgress != null && !content.newProgress.isIndeterminate) {
            newProgressBar.setProgressModel(content.newProgress.toSkeleton().toBundle())
            newProgressBar.visibility = VISIBLE