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

Commit 2b309c88 authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

[Notif redesign] Include imageMessageContainer in animation

A redesign change accidentally excluded the imageMessageContainer from the list of drawables used in the conversation animation. While it's true that it's now nullable where previously it was not (since it doesn't exist in the collapsed layout), we should still include it when not null.

Change-Id: Ia0e780f8de71e7dea6921bc3a9dcfa99e8fa9cb6
Fix: 397900637
Flag: android.app.notifications_redesign_templates
Test: NotificationConversationTemplateViewWrapperTest
parent b3bd93da
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -75,9 +75,10 @@ class NotificationConversationTemplateViewWrapperTest : SysuiTestCase() {
        // Creates a mocked out NotificationEntry of ConversationLayout type,
        // with a mock imageMessage.drawable embedded in its MessagingImageMessages
        // (both top level, and in a group).
        val mockDrawable = mock<AnimatedImageDrawable>()
        val mockDrawable2 = mock<AnimatedImageDrawable>()
        val mockLayoutView: View = fakeConversationLayout(mockDrawable, mockDrawable2)
        val mockDrawableGroupMessage = mock<AnimatedImageDrawable>()
        val mockDrawableImageMessage = mock<AnimatedImageDrawable>()
        val mockLayoutView: View =
            fakeConversationLayout(mockDrawableGroupMessage, mockDrawableImageMessage)

        val wrapper: NotificationViewWrapper =
            NotificationConversationTemplateViewWrapper(mContext, mockLayoutView, mRow)
@@ -85,8 +86,8 @@ class NotificationConversationTemplateViewWrapperTest : SysuiTestCase() {
        wrapper.setAnimationsRunning(false)

        // Verifies that each AnimatedImageDrawable is started animating.
        verify(mockDrawable).stop()
        verify(mockDrawable2).stop()
        verify(mockDrawableGroupMessage).stop()
        verify(mockDrawableImageMessage).stop()
    }

    private fun fakeConversationLayout(
+2 −1
Original line number Diff line number Diff line
@@ -174,7 +174,8 @@ class NotificationConversationTemplateViewWrapper(
        // and the top level image message container.
        val containers =
            messageContainers.asSequence().map { it.messageContainer } +
                if (notificationsRedesignTemplates()) emptySequence()
                if (notificationsRedesignTemplates() && imageMessageContainer == null)
                    emptySequence()
                else sequenceOf(imageMessageContainer!!)
        val drawables =
            containers