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

Commit a578e93e authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Notif redesign] Include imageMessageContainer in animation" into main

parents 88cb477f 2b309c88
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