Adapt ConversationViewController to iPhoneX
// FREEBIE
This commit is contained in:
parent
a3153d29d0
commit
8c69e00a3f
@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+ (UIColor *)ows_blackColor;
|
||||
+ (UIColor *)ows_errorMessageBorderColor;
|
||||
+ (UIColor *)ows_infoMessageBorderColor;
|
||||
+ (UIColor *)ows_inputToolbarBackgroundColor;
|
||||
+ (UIColor *)backgroundColorForContact:(NSString *)contactIdentifier;
|
||||
+ (UIColor *)colorWithRGBHex:(unsigned long)value;
|
||||
|
||||
|
||||
@ -86,6 +86,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
return [UIColor colorWithRed:239.f / 255.f green:189.f / 255.f blue:88.f / 255.f alpha:1.0f];
|
||||
}
|
||||
|
||||
+ (UIColor *)ows_inputToolbarBackgroundColor
|
||||
{
|
||||
return [self colorWithWhite:245 / 255.f alpha:1.f];
|
||||
}
|
||||
|
||||
+ (UIColor *)ows_lightBackgroundColor
|
||||
{
|
||||
return [UIColor colorWithRed:242.f / 255.f green:242.f / 255.f blue:242.f / 255.f alpha:1.f];
|
||||
|
||||
@ -72,7 +72,7 @@ static void *kConversationInputTextViewObservingContext = &kConversationInputTex
|
||||
{
|
||||
self.layoutMargins = UIEdgeInsetsZero;
|
||||
|
||||
self.backgroundColor = [UIColor colorWithWhite:245 / 255.f alpha:1.f];
|
||||
self.backgroundColor = [UIColor ows_inputToolbarBackgroundColor];
|
||||
|
||||
UIView *borderView = [UIView new];
|
||||
borderView.backgroundColor = [UIColor colorWithWhite:238 / 255.f alpha:1.f];
|
||||
|
||||
@ -479,6 +479,13 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
||||
[self loadDraftInCompose];
|
||||
}
|
||||
|
||||
- (void)loadView
|
||||
{
|
||||
[super loadView];
|
||||
|
||||
self.view.backgroundColor = [UIColor ows_inputToolbarBackgroundColor];
|
||||
}
|
||||
|
||||
- (void)createContents
|
||||
{
|
||||
_layout = [ConversationViewLayout new];
|
||||
|
||||
@ -75,6 +75,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
{
|
||||
[super loadView];
|
||||
|
||||
self.view.backgroundColor = UIColor.whiteColor;
|
||||
_contactsViewHelper = [[ContactsViewHelper alloc] initWithDelegate:self];
|
||||
_nonContactAccountSet = [NSMutableSet set];
|
||||
_collation = [UILocalizedIndexedCollation currentCollation];
|
||||
|
||||
@ -110,7 +110,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
CGRect keyboardEndFrameConverted = [self.view convertRect:keyboardEndFrame fromView:nil];
|
||||
// Adjust the position of the bottom view to account for the keyboard's
|
||||
// intrusion into the view.
|
||||
CGFloat offset = -MAX(0, (self.view.height - keyboardEndFrameConverted.origin.y));
|
||||
// We offset by the bottomLayoutGuide for iPhoneX users, else there is an unnecessary gap between the keyboard and input bar.
|
||||
CGFloat offset = -MAX(0, (self.view.height - keyboardEndFrameConverted.origin.y - self.bottomLayoutGuide.length));
|
||||
|
||||
// There's no need to use: [UIView animateWithDuration:...].
|
||||
// Any layout changes made during these notifications are
|
||||
|
||||
Loading…
Reference in New Issue
Block a user