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

Commit 22c518ac authored by Julia Tuttle's avatar Julia Tuttle
Browse files

Fix content margin top on AOD RONs with redesign enabled

Bug: 369151941
Flag: com.android.systemui.aod_ui_rich_ongoing
Test: manual
Change-Id: Ic9507d80c6ec428a1da650bbc6cd50e97e5cd09a
parent 688478cd
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
import android.view.ViewGroup.MarginLayoutParams
import android.view.ViewStub
import android.widget.Chronometer
import android.widget.DateTimeView
@@ -175,12 +176,13 @@ private class AODPromotedNotificationViewUpdater(root: View) {
        root.findViewById(R.id.header_text_secondary_divider)
    private val icon: NotificationRowIconView? = root.findViewById(R.id.icon)
    private val leftIcon: ImageView? = root.findViewById(R.id.left_icon)
    private val rightIcon: ImageView? = root.findViewById(R.id.right_icon)
    private val mainColumn: View? = root.findViewById(R.id.notification_main_column)
    private val notificationProgressEndIcon: CachingIconView? =
        root.findViewById(R.id.notification_progress_end_icon)
    private val notificationProgressStartIcon: CachingIconView? =
        root.findViewById(R.id.notification_progress_start_icon)
    private val profileBadge: ImageView? = root.findViewById(R.id.profile_badge)
    private val rightIcon: ImageView? = root.findViewById(R.id.right_icon)
    private val text: ImageFloatingTextView? = root.findViewById(R.id.text)
    private val time: DateTimeView? = root.findViewById(R.id.time)
    private val timeDivider: View? = root.findViewById(R.id.time_divider)
@@ -209,6 +211,16 @@ private class AODPromotedNotificationViewUpdater(root: View) {
            ?.drawable
            ?.mutate()
            ?.setColorFilter(SecondaryText.colorInt, PorterDuff.Mode.SRC_IN)

        if (Flags.notificationsRedesignTemplates()) {
            (mainColumn?.layoutParams as? MarginLayoutParams)?.let { mainColumnMargins ->
                mainColumnMargins.topMargin =
                    Notification.Builder.getContentMarginTop(
                        root.context,
                        R.dimen.notification_2025_content_margin_top,
                    )
            }
        }
    }

    fun update(content: PromotedNotificationContentModel, audiblyAlertedIconVisible: Boolean) {