Revert from numeric to default keyboard after message send.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-10-19 07:10:05 -07:00
parent 31941de1bf
commit f28abbc2a1
5 changed files with 24 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

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