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

Commit bee51838 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

Enable PrecomputedText in MessagingLayouts

This CL enables PrecomputedTexts in MessagingLayout when PRECOMPUTED_TEXT flag is enabled.

Bug: 289250881
Test: run atest SystemUITests by enabling PRECOMPUTED_TEXT flag + Manually check if MessagingLayouts are rendered as is. No visual impact is expected.

Change-Id: Ic2b632026b08f9496a910e6d9b34ff3e1efd9309
parent ae679ca7
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -20,7 +20,9 @@ import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.TextView
import com.android.internal.widget.ConversationLayout
import com.android.internal.widget.ImageFloatingTextView
import com.android.internal.widget.MessagingLayout
import javax.inject.Inject

class PrecomputedTextViewFactory @Inject constructor() : NotifRemoteViewsFactory {
@@ -35,6 +37,10 @@ class PrecomputedTextViewFactory @Inject constructor() : NotifRemoteViewsFactory
            TextView::class.java.simpleName -> PrecomputedTextView(context, attrs)
            ImageFloatingTextView::class.java.name ->
                PrecomputedImageFloatingTextView(context, attrs)
            MessagingLayout::class.java.name ->
                MessagingLayout(context, attrs).apply { setPrecomputedTextEnabled(true) }
            ConversationLayout::class.java.name ->
                ConversationLayout(context, attrs).apply { setPrecomputedTextEnabled(true) }
            else -> null
        }
    }