diff --git a/Signal/src/ViewControllers/ConversationView/Cells/ConversationViewCell.m b/Signal/src/ViewControllers/ConversationView/Cells/ConversationViewCell.m index fe1df0749..9b7fd5fce 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/ConversationViewCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/ConversationViewCell.m @@ -31,15 +31,6 @@ NS_ASSUME_NONNULL_BEGIN return CGSizeZero; } -- (void)setIsCellVisible:(BOOL)isCellVisible -{ - _isCellVisible = isCellVisible; - - if (isCellVisible) { - [self layoutIfNeeded]; - } -} - // For perf reasons, skip the default implementation which is only relevant for self-sizing cells. - (UICollectionViewLayoutAttributes *)preferredLayoutAttributesFittingAttributes: (UICollectionViewLayoutAttributes *)layoutAttributes diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m index 74c5df40a..a58049906 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m @@ -164,7 +164,7 @@ const CGFloat kMaxTextViewHeight = 98; [self addSubview:self.contentRows]; [self.contentRows autoPinEdgesToSuperviewEdges]; - [self ensureShouldShowVoiceMemoButtonAnimated:NO]; + [self ensureShouldShowVoiceMemoButtonAnimated:NO doLayout:NO]; } - (void)updateFontSizes @@ -193,7 +193,7 @@ const CGFloat kMaxTextViewHeight = 98; self.inputTextView.text = value; - [self ensureShouldShowVoiceMemoButtonAnimated:isAnimated]; + [self ensureShouldShowVoiceMemoButtonAnimated:isAnimated doLayout:YES]; [self ensureTextViewHeight]; } @@ -289,7 +289,7 @@ const CGFloat kMaxTextViewHeight = 98; return self.inputTextView.isFirstResponder; } -- (void)ensureShouldShowVoiceMemoButtonAnimated:(BOOL)isAnimated +- (void)ensureShouldShowVoiceMemoButtonAnimated:(BOOL)isAnimated doLayout:(BOOL)doLayout { void (^updateBlock)(void) = ^{ if (self.inputTextView.trimmedText.length > 0) { @@ -309,7 +309,9 @@ const CGFloat kMaxTextViewHeight = 98; self.sendButton.hidden = YES; } } - [self layoutIfNeeded]; + if (doLayout) { + [self layoutIfNeeded]; + } }; if (isAnimated) { @@ -598,7 +600,7 @@ const CGFloat kMaxTextViewHeight = 98; - (void)textViewDidChange:(UITextView *)textView { OWSAssertDebug(self.inputToolbarDelegate); - [self ensureShouldShowVoiceMemoButtonAnimated:YES]; + [self ensureShouldShowVoiceMemoButtonAnimated:YES doLayout:YES]; [self updateHeightWithTextView:textView]; } diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m b/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m index 2a46afc19..31ec67170 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m @@ -382,7 +382,9 @@ static const int kYapDatabaseRangeMinLength = 0; { BOOL hasEarlierUnseenMessages = self.dynamicInteractions.unreadIndicator.hasMoreUnseenMessages; - [self loadNMoreMessages:kYapDatabasePageSize]; + // Now that we're using a "minimal" page size, we should + // increase the load window by 2 pages at a time. + [self loadNMoreMessages:kYapDatabasePageSize * 2]; // Don’t auto-scroll after “loading more messages” unless we have “more unseen messages”. //