diff --git a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift index 8b435fb7d..2cd950d15 100644 --- a/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApprovalViewController.swift @@ -530,6 +530,7 @@ class CaptioningToolbar: UIView, UITextViewDelegate { self.backgroundColor = UIColor.clear textView.delegate = self + textView.keyboardAppearance = Theme.keyboardAppearance textView.backgroundColor = (Theme.isDarkThemeEnabled ? UIColor.ows_dark85 : UIColor.ows_light02) textView.layer.borderColor = (Theme.isDarkThemeEnabled ? Theme.primaryColor.withAlphaComponent(0.06).cgColor diff --git a/SignalMessaging/Views/OWSTextField.m b/SignalMessaging/Views/OWSTextField.m index 4d6168184..ac72508c5 100644 --- a/SignalMessaging/Views/OWSTextField.m +++ b/SignalMessaging/Views/OWSTextField.m @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)ows_applyTheme { - self.keyboardAppearance = (Theme.isDarkThemeEnabled ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault); + self.keyboardAppearance = Theme.keyboardAppearance; } - (BOOL)becomeFirstResponder diff --git a/SignalMessaging/Views/OWSTextView.m b/SignalMessaging/Views/OWSTextView.m index 72072f8cc..a175766d6 100644 --- a/SignalMessaging/Views/OWSTextView.m +++ b/SignalMessaging/Views/OWSTextView.m @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)ows_applyTheme { - self.keyboardAppearance = (Theme.isDarkThemeEnabled ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault); + self.keyboardAppearance = Theme.keyboardAppearance; } @end diff --git a/SignalMessaging/categories/Theme.h b/SignalMessaging/categories/Theme.h index 109e96b4b..b15d3608a 100644 --- a/SignalMessaging/categories/Theme.h +++ b/SignalMessaging/categories/Theme.h @@ -47,6 +47,7 @@ extern NSString *const ThemeDidChangeNotification; #pragma mark - @property (class, readonly, nonatomic) UIBlurEffect *barBlurEffect; +@property (class, readonly, nonatomic) UIKeyboardAppearance keyboardAppearance; #pragma mark - diff --git a/SignalMessaging/categories/Theme.m b/SignalMessaging/categories/Theme.m index b46c20795..4ae3aae87 100644 --- a/SignalMessaging/categories/Theme.m +++ b/SignalMessaging/categories/Theme.m @@ -138,6 +138,11 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled"; : [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; } ++ (UIKeyboardAppearance)keyboardAppearance +{ + return Theme.isDarkThemeEnabled ? UIKeyboardAppearanceDark : UIKeyboardAppearanceDefault; +} + #pragma mark - + (UIColor *)toastForegroundColor