Fixes for scrolling in conversation view.

This commit is contained in:
Matthew Chen 2017-11-08 15:23:48 -05:00
parent b6ca9a8cef
commit 87b0692af0
4 changed files with 4 additions and 20 deletions

View File

@ -973,6 +973,9 @@ NS_ASSUME_NONNULL_BEGIN
if (self.isIncoming) {
return NO;
}
if (self.cellType == OWSMessageCellType_DownloadingAttachment) {
return NO;
}
if (!self.attachmentStream) {
return NO;
}

View File

@ -10,8 +10,6 @@ NS_ASSUME_NONNULL_BEGIN
- (void)didPasteAttachment:(SignalAttachment *_Nullable)attachment;
- (void)inputTextViewDidBecomeFirstResponder;
- (void)inputTextViewSendMessagePressed;
@end

View File

@ -129,16 +129,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (BOOL)becomeFirstResponder
{
BOOL becameFirstResponder = [super becomeFirstResponder];
if (becameFirstResponder) {
// Intercept to scroll to bottom when text view is tapped.
[self.inputTextViewDelegate inputTextViewDidBecomeFirstResponder];
}
return becameFirstResponder;
}
- (BOOL)pasteboardHasPossibleAttachment
{
// We don't want to load/convert images more than once so we

View File

@ -3507,13 +3507,6 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
#pragma mark - ConversationInputTextViewDelegate
- (void)inputTextViewDidBecomeFirstResponder
{
OWSAssert([NSThread isMainThread]);
[self scrollToBottomAnimated:YES];
}
- (void)inputTextViewSendMessagePressed
{
[self sendButtonPressed];
@ -3632,7 +3625,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
[self updateLastVisibleTimestamp];
[self autoLoadMoreIfNecessary];
if ([self isScrolledAwayFromBottom]) {
if (self.isUserScrolling && [self isScrolledAwayFromBottom]) {
[self.inputToolbar endEditingTextMessage];
}
}