|
|
|
@ -274,6 +274,18 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[self applyDefaultBackButton];
|
|
|
|
|
|
|
|
|
|
if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)]
|
|
|
|
|
&& (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)) {
|
|
|
|
|
[self registerForPreviewingWithDelegate:self sourceView:self.tableView];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[self updateBarButtonItems];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)applyDefaultBackButton
|
|
|
|
|
{
|
|
|
|
|
// We don't show any text for the back button, so there's no need to localize it. But because we left align the
|
|
|
|
|
// conversation title view, we add a little tappable padding after the back button, by having a title of spaces.
|
|
|
|
|
// Admittedly this is kind of a hack and not super fine grained, but it's simple and results in the interactive pop
|
|
|
|
@ -284,13 +296,15 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
|
|
|
|
|
|
|
|
|
self.navigationItem.backBarButtonItem =
|
|
|
|
|
[[UIBarButtonItem alloc] initWithTitle:paddingString style:UIBarButtonItemStylePlain target:nil action:nil];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)]
|
|
|
|
|
&& (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)) {
|
|
|
|
|
[self registerForPreviewingWithDelegate:self sourceView:self.tableView];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[self updateBarButtonItems];
|
|
|
|
|
- (void)applyArchiveBackButton
|
|
|
|
|
{
|
|
|
|
|
self.navigationItem.backBarButtonItem =
|
|
|
|
|
[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"BACK_BUTTON", @"button text for back button")
|
|
|
|
|
style:UIBarButtonItemStylePlain
|
|
|
|
|
target:nil
|
|
|
|
|
action:nil];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)viewDidAppear:(BOOL)animated
|
|
|
|
@ -298,6 +312,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
|
|
|
|
[super viewDidAppear:animated];
|
|
|
|
|
|
|
|
|
|
[self displayAnyUnseenUpgradeExperience];
|
|
|
|
|
[self applyDefaultBackButton];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)updateBarButtonItems
|
|
|
|
@ -408,6 +423,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
|
|
|
|
- (void)viewWillAppear:(BOOL)animated
|
|
|
|
|
{
|
|
|
|
|
[super viewWillAppear:animated];
|
|
|
|
|
|
|
|
|
|
__block BOOL hasAnyMessages;
|
|
|
|
|
[self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction * _Nonnull transaction) {
|
|
|
|
|
hasAnyMessages = [self hasAnyMessagesWithTransaction:transaction];
|
|
|
|
@ -442,6 +458,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[self checkIfEmptyView];
|
|
|
|
|
[self applyDefaultBackButton];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)viewWillDisappear:(BOOL)animated
|
|
|
|
@ -985,6 +1002,10 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
|
|
|
|
|
{
|
|
|
|
|
OWSAssert(self.homeViewMode == HomeViewMode_Inbox);
|
|
|
|
|
|
|
|
|
|
// When showing archived conversations, we want to use a conventional "back" button
|
|
|
|
|
// to return to the "inbox" home view.
|
|
|
|
|
[self applyArchiveBackButton];
|
|
|
|
|
|
|
|
|
|
// Push a separate instance of this view using "archive" mode.
|
|
|
|
|
HomeViewController *homeView = [HomeViewController new];
|
|
|
|
|
homeView.homeViewMode = HomeViewMode_Archive;
|
|
|
|
|