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

Commit 32f15f05 authored by Julia Tuttle's avatar Julia Tuttle
Browse files

Don't show title twice in AOD RONs

Bug: 369151941
Flag: com.android.systemui.aod_ui_rich_ongoing
Test: manual
Change-Id: Ibc6f5c67495e08925f3333df6856c72f2ed0d106
parent 149ae017
Loading
Loading
Loading
Loading
+20 −10
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ private class AODPromotedNotificationViewUpdater(root: View) {
        textView: ImageFloatingTextView? = null,
        showOldProgress: Boolean = true,
    ) {
        updateHeader(content)
        updateHeader(content, hideTitle = true)

        updateTitle(title, content)
        updateText(textView ?: text, content)
@@ -282,19 +282,27 @@ private class AODPromotedNotificationViewUpdater(root: View) {
        }
    }

    private fun updateHeader(content: PromotedNotificationContentModel) {
    private fun updateHeader(
        content: PromotedNotificationContentModel,
        hideTitle: Boolean = false,
    ) {
        updateAppName(content)
        updateTextView(headerTextSecondary, content.subText)
        if (!hideTitle) {
            updateTitle(headerText, content)
        }
        updateTimeAndChronometer(content)

        updateHeaderDividers(content)
        updateHeaderDividers(content, hideTitle = hideTitle)
    }

    private fun updateHeaderDividers(content: PromotedNotificationContentModel) {
    private fun updateHeaderDividers(
        content: PromotedNotificationContentModel,
        hideTitle: Boolean = false,
    ) {
        val hasAppName = content.appName != null && content.appName.isNotEmpty()
        val hasSubText = content.subText != null && content.subText.isNotEmpty()
        val hasHeader = content.title != null && content.title.isNotEmpty()
        val hasHeader = content.title != null && content.title.isNotEmpty() && !hideTitle
        val hasTimeOrChronometer = content.time != null

        val hasTextBeforeSubText = hasAppName
@@ -314,14 +322,16 @@ private class AODPromotedNotificationViewUpdater(root: View) {
        updateTitle(conversationText, content)
        updateAppName(content)
        updateTimeAndChronometer(content)

        updateConversationHeaderDividers(content)
        updateConversationHeaderDividers(content, hideTitle = true)

        updateTextView(verificationText, content.verificationText)
    }

    private fun updateConversationHeaderDividers(content: PromotedNotificationContentModel) {
        val hasTitle = content.title != null
    private fun updateConversationHeaderDividers(
        content: PromotedNotificationContentModel,
        hideTitle: Boolean = false,
    ) {
        val hasTitle = content.title != null && !hideTitle
        val hasAppName = content.appName != null
        val hasTimeOrChronometer = content.time != null
        val hasVerification = content.verificationIcon != null || content.verificationText != null