Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #429 from slackhq/typing-indicator-enhancement
Browse files Browse the repository at this point in the history
Typing Indicator enhancement
  • Loading branch information
sukeban committed Mar 30, 2016
2 parents 7004cda + 23b5202 commit 95e68c4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Source/SLKTextViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ - (BOOL)slk_updateKeyboardStatus:(SLKKeyboardStatus)status
}


#pragma mark - Public & Subclassable Methods
#pragma mark - Public & Subclass Callbacks Methods

- (void)presentKeyboard:(BOOL)animated
{
Expand Down Expand Up @@ -798,12 +798,7 @@ - (void)didCancelTextEditing:(id)sender
- (BOOL)canShowTypingIndicator
{
// Don't show if the text is being edited or auto-completed.
if (_textInputbar.isEditing || self.isAutoCompleting) {
return NO;
}

// Don't show if the content offset is not at top (when inverted) or at bottom (when not inverted)
if ((self.isInverted && ![self.scrollViewProxy slk_isAtTop]) || (!self.isInverted && ![self.scrollViewProxy slk_isAtBottom])) {
if (_textInputbar.isEditing) {
return NO;
}

Expand Down Expand Up @@ -2135,7 +2130,8 @@ - (void)slk_setupViewConstraints
@"textInputbar": self.textInputbar,
};

[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[scrollView(0@750)][typingIndicatorView(0)]-0@999-[textInputbar(0)]|" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[scrollView(0@750)][textInputbar(0)]|" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[typingIndicatorView(0)]-0@999-[textInputbar]|" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(>=0)-[autoCompletionView(0@750)][typingIndicatorView]" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[scrollView]|" options:0 metrics:nil views:views]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[autoCompletionView]|" options:0 metrics:nil views:views]];
Expand Down

0 comments on commit 95e68c4

Please sign in to comment.