resize bar after send

pull/1/head
Michael Kirk 7 years ago
parent 1d0a25dba9
commit 94a23e63b6

@ -47,8 +47,8 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setInputTextViewDelegate:(id<ConversationInputTextViewDelegate>)value; - (void)setInputTextViewDelegate:(id<ConversationInputTextViewDelegate>)value;
- (NSString *)messageText; - (NSString *)messageText;
- (void)setMessageText:(NSString *_Nullable)value; - (void)setMessageText:(NSString *_Nullable)value animated:(BOOL)isAnimated;
- (void)clearTextMessage; - (void)clearTextMessageAnimated:(BOOL)isAnimated;
- (void)toggleDefaultKeyboard; - (void)toggleDefaultKeyboard;
- (void)updateFontSizes; - (void)updateFontSizes;

@ -192,18 +192,19 @@ const CGFloat kMaxTextViewHeight = 98;
return self.inputTextView.trimmedText; return self.inputTextView.trimmedText;
} }
- (void)setMessageText:(NSString *_Nullable)value - (void)setMessageText:(NSString *_Nullable)value animated:(BOOL)isAnimated
{ {
OWSAssert(self.inputTextView); OWSAssert(self.inputTextView);
self.inputTextView.text = value; self.inputTextView.text = value;
[self ensureShouldShowVoiceMemoButtonAnimated:NO]; [self ensureShouldShowVoiceMemoButtonAnimated:isAnimated];
[self updateHeightWithTextView:self.inputTextView];
} }
- (void)clearTextMessage - (void)clearTextMessageAnimated:(BOOL)isAnimated
{ {
[self setMessageText:nil]; [self setMessageText:nil animated:isAnimated];
[self.inputTextView.undoManager removeAllActions]; [self.inputTextView.undoManager removeAllActions];
} }
@ -578,22 +579,6 @@ const CGFloat kMaxTextViewHeight = 98;
#pragma mark - Event Handlers #pragma mark - Event Handlers
//- (void)leftButtonTapped:(UIGestureRecognizer *)sender
//{
// if (sender.state == UIGestureRecognizerStateRecognized) {
// [self attachmentButtonPressed];
// }
//}
//- (void)rightButtonTapped:(UIGestureRecognizer *)sender
//{
// if (sender.state == UIGestureRecognizerStateRecognized) {
// if (!self.shouldShowVoiceMemoButton) {
// [self sendButtonPressed];
// }
// }
//}
- (void)sendButtonPressed - (void)sendButtonPressed
{ {
OWSAssert(self.inputToolbarDelegate); OWSAssert(self.inputToolbarDelegate);

@ -3980,7 +3980,7 @@ typedef enum : NSUInteger {
[self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) { [self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
draft = [_thread currentDraftWithTransaction:transaction]; draft = [_thread currentDraftWithTransaction:transaction];
}]; }];
[self.inputToolbar setMessageText:draft]; [self.inputToolbar setMessageText:draft animated:NO];
} }
- (void)saveDraft - (void)saveDraft
@ -4417,7 +4417,7 @@ typedef enum : NSUInteger {
if (updateKeyboardState) { if (updateKeyboardState) {
[self.inputToolbar toggleDefaultKeyboard]; [self.inputToolbar toggleDefaultKeyboard];
} }
[self.inputToolbar clearTextMessage]; [self.inputToolbar clearTextMessageAnimated:YES];
[self clearDraft]; [self clearDraft];
if (didAddToProfileWhitelist) { if (didAddToProfileWhitelist) {
[self ensureDynamicInteractions]; [self ensureDynamicInteractions];

Loading…
Cancel
Save