Revert from numeric to default keyboard after message send.

// FREEBIE
pull/1/head
Matthew Chen 7 years ago
parent 31941de1bf
commit f28abbc2a1

@ -47,6 +47,8 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setMessageText:(NSString *_Nullable)value; - (void)setMessageText:(NSString *_Nullable)value;
- (void)clearTextMessage; - (void)clearTextMessage;
- (nullable NSString *)textInputPrimaryLanguage;
#pragma mark - Voice Memo #pragma mark - Voice Memo
- (void)showVoiceMemoUI; - (void)showVoiceMemoUI;

@ -762,6 +762,11 @@ static void *kConversationInputTextViewObservingContext = &kConversationInputTex
[self.attachmentView viewWillDisappear:animated]; [self.attachmentView viewWillDisappear:animated];
} }
- (nullable NSString *)textInputPrimaryLanguage
{
return self.inputTextView.textInputMode.primaryLanguage;
}
#pragma mark - Logging #pragma mark - Logging
+ (NSString *)logTag + (NSString *)logTag

@ -1353,19 +1353,18 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
#pragma mark - JSQMessagesViewController method overrides #pragma mark - JSQMessagesViewController method overrides
// TODO: We need to audit all usage of this method.
- (void)toggleDefaultKeyboard - (void)toggleDefaultKeyboard
{ {
// // Primary language is nil for the emoji keyboard & we want to stay on it after sending // Primary language is nil for the emoji keyboard & we want to stay on it after sending
// if (![self.inputToolbar.inputTextView.textInputMode primaryLanguage]) { if (!self.inputToolbar.textInputPrimaryLanguage) {
// return; return;
// } }
//
// // The JSQ event listeners cause a bounce animation, so we temporarily disable them. // The JSQ event listeners cause a bounce animation, so we temporarily disable them.
// [self.keyboardController endListeningForKeyboard]; [self setShouldIgnoreKeyboardChanges:YES];
// [self dismissKeyBoard]; [self dismissKeyBoard];
// [self popKeyBoard]; [self popKeyBoard];
// [self.keyboardController beginListeningForKeyboard]; [self setShouldIgnoreKeyboardChanges:NO];
} }
#pragma mark - Dynamic Text #pragma mark - Dynamic Text

@ -15,6 +15,8 @@ NS_ASSUME_NONNULL_BEGIN
// Use this method in lieu of autoPinToBottomLayoutGuideOfViewController: // Use this method in lieu of autoPinToBottomLayoutGuideOfViewController:
- (void)autoPinViewToBottomGuideOrKeyboard:(UIView *)view; - (void)autoPinViewToBottomGuideOrKeyboard:(UIView *)view;
- (void)setShouldIgnoreKeyboardChanges:(BOOL)value;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak) UIView *bottomLayoutView; @property (nonatomic, weak) UIView *bottomLayoutView;
@property (nonatomic) NSLayoutConstraint *bottomLayoutConstraint; @property (nonatomic) NSLayoutConstraint *bottomLayoutConstraint;
@property (nonatomic) BOOL shouldIgnoreKeyboardChanges;
@end @end
@ -94,6 +95,10 @@ NS_ASSUME_NONNULL_BEGIN
{ {
OWSAssert([NSThread isMainThread]); OWSAssert([NSThread isMainThread]);
if (self.shouldIgnoreKeyboardChanges) {
return;
}
NSDictionary *userInfo = [notification userInfo]; NSDictionary *userInfo = [notification userInfo];
NSValue *_Nullable keyboardEndFrameValue = userInfo[UIKeyboardFrameEndUserInfoKey]; NSValue *_Nullable keyboardEndFrameValue = userInfo[UIKeyboardFrameEndUserInfoKey];

Loading…
Cancel
Save