diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java index 4146a941c025..f3bb82802468 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapper.java @@ -211,11 +211,19 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp rightIconLP.setMarginEnd(horizontalMargin); mRightIcon.setLayoutParams(rightIconLP); + // if there is no title and topline view, there is nothing to adjust. + if (mNotificationTopLine == null && mTitle == null) { + return; + } + // align top line view to start of the right icon. final int iconSize = mView.getResources().getDimensionPixelSize( com.android.internal.R.dimen.notification_right_icon_size); final int marginEnd = 2 * horizontalMargin + iconSize; - mNotificationTopLine.setHeaderTextMarginEnd(marginEnd); + // set margin end for the top line view if it exists + if (mNotificationTopLine != null) { + mNotificationTopLine.setHeaderTextMarginEnd(marginEnd); + } // title has too much margin on the right, so we need to reduce it if (mTitle != null) { |