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

Commit 5104717e authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Also add embedded padding when icon is StatusBarNotificationIcon" into main

parents 74c4087d 2fbc08a2
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -242,8 +242,9 @@ object OngoingActivityChipBinder {
        chipTimeView: ChipChronometer,
        chipShortTimeDeltaView: DateTimeView,
    ) {
        if (chipModel.icon != null) {
            if (chipModel.icon is OngoingActivityChipModel.ChipIcon.StatusBarView) {
        val icon = chipModel.icon
        if (icon != null) {
            if (iconRequiresEmbeddedPadding(icon)) {
                // If the icon is a custom [StatusBarIconView], then it should've come from
                // `Notification.smallIcon`, which is required to embed its own paddings. We need to
                // adjust the other paddings to make everything look good :)
@@ -265,6 +266,10 @@ object OngoingActivityChipBinder {
        }
    }

    private fun iconRequiresEmbeddedPadding(icon: OngoingActivityChipModel.ChipIcon) =
        icon is OngoingActivityChipModel.ChipIcon.StatusBarView ||
            icon is OngoingActivityChipModel.ChipIcon.StatusBarNotificationIcon

    private fun View.setTextPaddingForEmbeddedPaddingIcon() {
        val newPaddingEnd =
            context.resources.getDimensionPixelSize(