summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/binder/OngoingActivityChipBinder.kt9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/binder/OngoingActivityChipBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/binder/OngoingActivityChipBinder.kt
index 059e69a9275b..69ef09d8bf5e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/binder/OngoingActivityChipBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/binder/OngoingActivityChipBinder.kt
@@ -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(