diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index d47030869..762155537 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -220,9 +220,14 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations UILabel *emptyBoxLabel = [UILabel new]; self.emptyBoxLabel = emptyBoxLabel; [self.view addSubview:emptyBoxLabel]; - [emptyBoxLabel autoPinWidthToSuperview]; - [emptyBoxLabel autoPinToTopLayoutGuideOfViewController:self withInset:0]; - [emptyBoxLabel autoPinToBottomLayoutGuideOfViewController:self withInset:0]; + + // Let the label use as many lines as needed. It will very rarely be more than 2 but may happen for verbose locs. + [emptyBoxLabel setNumberOfLines:0]; + emptyBoxLabel.lineBreakMode = NSLineBreakByWordWrapping; + + [emptyBoxLabel autoPinLeadingToSuperviewMargin]; + [emptyBoxLabel autoPinTrailingToSuperviewMargin]; + [emptyBoxLabel autoAlignAxisToSuperviewAxis:ALAxisHorizontal]; UIRefreshControl *pullToRefreshView = [UIRefreshControl new]; pullToRefreshView.tintColor = [UIColor grayColor]; @@ -1239,23 +1244,23 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations _emptyBoxLabel.textColor = [UIColor grayColor]; _emptyBoxLabel.font = [UIFont ows_regularFontWithSize:18.f]; _emptyBoxLabel.textAlignment = NSTextAlignmentCenter; - _emptyBoxLabel.numberOfLines = 4; NSString *firstLine = @""; NSString *secondLine = @""; if (self.homeViewMode == HomeViewMode_Inbox) { if ([Environment.preferences getHasSentAMessage]) { + // FIXME: This doesn't appear to ever show up as the defaults flag is never set (setHasSentAMessage: is never called). firstLine = NSLocalizedString(@"EMPTY_INBOX_FIRST_TITLE", @""); secondLine = NSLocalizedString(@"EMPTY_INBOX_FIRST_TEXT", @""); } else { - // FIXME This looks wrong. Shouldn't we be showing inbox_title/text here? - firstLine = NSLocalizedString(@"EMPTY_ARCHIVE_FIRST_TITLE", @""); - secondLine = NSLocalizedString(@"EMPTY_ARCHIVE_FIRST_TEXT", @""); + // FIXME: Misleading localizable string key name. + firstLine = NSLocalizedString(@"EMPTY_ARCHIVE_FIRST_TITLE", @"First (bolded) part of the label that shows up when there are neither active nor archived conversations"); + secondLine = NSLocalizedString(@"EMPTY_ARCHIVE_FIRST_TEXT", @"Second part of the label that shows up when there are neither active nor archived conversations"); } } else { if ([Environment.preferences getHasArchivedAMessage]) { - // FIXME This looks wrong. Shouldn't we be showing first_archive_title/text here? + // FIXME: Shows up after the archival tab is cleared up completely by the user, the localizable string key is misleading. firstLine = NSLocalizedString(@"EMPTY_INBOX_TITLE", @""); secondLine = NSLocalizedString(@"EMPTY_INBOX_TEXT", @""); } else { diff --git a/SignalMessaging/categories/UIDevice+featureSupport.swift b/SignalMessaging/categories/UIDevice+featureSupport.swift index 96046e04e..916e026b2 100644 --- a/SignalMessaging/categories/UIDevice+featureSupport.swift +++ b/SignalMessaging/categories/UIDevice+featureSupport.swift @@ -13,6 +13,9 @@ public extension UIDevice { @objc public var isIPhoneX: Bool { switch UIScreen.main.nativeBounds.height { + case 960: + // iPad in iPhone compatibility mode (using old iPhone 4 screen size) + return false case 1136: // iPhone 5 or 5S or 5C return false