From e08fa4bcecdf4e499f41cce9514629ac20a62b22 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Tue, 15 Aug 2017 18:06:38 -0400 Subject: [PATCH] Fix jolting animation after sending a message When we send the nth message, we retain the footer for the n-1th message until the nth message is successfully sent. 1. leave the footer on the n-1th message 2. draw the nth message with the "..." footer 3. update the nth message with the "sent" footer and hide the footer for the n-1th message In the normal case this all happens very quickly, which results in some unpleasant flicker every time you send a message. The concession here is that we'll only print the n-1th footer if the outgoing message *fails*. So until we implement a design more like Android's double-check for sent/delivery, the user will not be able to distinguish between a sent and delivered message *while* their message is outgoing. In my opinion the lack of jank in the normal case makes the app supercedes this use case. // FREEBIE --- .../ViewControllers/ConversationView/MessagesViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m index 6e773a86a..7680d5966 100644 --- a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m +++ b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m @@ -1896,7 +1896,7 @@ typedef enum : NSUInteger { // Or when the next message is *not* an outgoing sent/delivered message. TSOutgoingMessage *nextMessage = [self nextOutgoingMessage:indexPath]; - if (nextMessage && nextMessage.messageState != TSOutgoingMessageStateSentToService) { + if (nextMessage && nextMessage.messageState == TSOutgoingMessageStateUnsent) { [self updateLastDeliveredMessage:message]; return result; }