summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-01-06 05:59:26 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-01-06 05:59:26 -0800
commit5104717ef833736c3f3bebd366fd79b67d109e9c (patch)
treece6d513da22c5211226f4ae959b1fd43a8a48c1a
parent74c4087d601ede801e705748155669e4df8b49ad (diff)
parent2fbc08a27d2b3ad0e30b70733876a799745cfdf1 (diff)
Merge "Also add embedded padding when icon is StatusBarNotificationIcon" into main
-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(