Merge branch 'charlesmchen/saeRefinements'
This commit is contained in:
commit
ebb778cf52
@ -1452,9 +1452,6 @@
|
||||
/* Label for the send button in the conversation view. */
|
||||
"SEND_BUTTON_TITLE" = "Send";
|
||||
|
||||
/* Title for the 'send external file' view. */
|
||||
"SEND_EXTERNAL_FILE_VIEW_TITLE" = "Send File";
|
||||
|
||||
/* Alert body after invite failed */
|
||||
"SEND_INVITE_FAILURE" = "Sending invite failed, please try again later.";
|
||||
|
||||
@ -1641,6 +1638,9 @@
|
||||
/* Shown when trying to share content to a Signal user for the share extension. Followed by failure details. */
|
||||
"SHARE_EXTENSION_UNABLE_TO_BUILD_ATTACHMENT_ALERT_TITLE" = "Unable to Prepare Attachment";
|
||||
|
||||
/* Title for the 'share extension' view. */
|
||||
"SHARE_EXTENSION_VIEW_TITLE" = "Share to Signal";
|
||||
|
||||
/* Action sheet item */
|
||||
"SHOW_SAFETY_NUMBER_ACTION" = "Show New Safety Number";
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
|
||||
_messageSender = [Environment current].messageSender;
|
||||
|
||||
_progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
|
||||
self.title = NSLocalizedString(@"SEND_EXTERNAL_FILE_VIEW_TITLE", @"Title for the 'send external file' view.");
|
||||
self.title = NSLocalizedString(@"SHARE_EXTENSION_VIEW_TITLE", @"Title for the 'share extension' view.");
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
@ -149,6 +149,12 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
|
||||
|
||||
NSString *_Nullable messageText = [self convertAttachmentToMessageTextIfPossible];
|
||||
|
||||
// Hide the navigation bar before presenting the approval view.
|
||||
//
|
||||
// Note that cancelling in the approval views will dismiss the entire
|
||||
// share extension, so there is no "back" button.
|
||||
self.navigationController.navigationBarHidden = YES;
|
||||
|
||||
if (messageText) {
|
||||
MessageApprovalViewController *approvalVC =
|
||||
[[MessageApprovalViewController alloc] initWithMessageText:messageText
|
||||
|
||||
@ -21,4 +21,6 @@
|
||||
|
||||
@property (nonatomic, weak) id<CountryCodeViewControllerDelegate> countryCodeDelegate;
|
||||
|
||||
@property (nonatomic) BOOL isPresentedInNavigationController;
|
||||
|
||||
@end
|
||||
|
||||
@ -31,10 +31,12 @@
|
||||
|
||||
self.countryCodes = [PhoneNumberUtil countryCodesForSearchTerm:nil];
|
||||
|
||||
self.navigationItem.leftBarButtonItem =
|
||||
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
|
||||
target:self
|
||||
action:@selector(dismissWasPressed:)];
|
||||
if (!self.isPresentedInNavigationController) {
|
||||
self.navigationItem.leftBarButtonItem =
|
||||
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
|
||||
target:self
|
||||
action:@selector(dismissWasPressed:)];
|
||||
}
|
||||
|
||||
[self createViews];
|
||||
}
|
||||
|
||||
@ -40,6 +40,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@property (nonatomic, readonly) ContactsViewHelper *contactsViewHelper;
|
||||
|
||||
@property (nonatomic) BOOL isPresentedInNavigationController;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@ -238,10 +238,10 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
|
||||
callingCode:(NSString *)callingCode
|
||||
countryCode:(NSString *)countryCode
|
||||
{
|
||||
|
||||
_callingCode = callingCode;
|
||||
|
||||
NSString *title = [NSString stringWithFormat:@"%@ (%@)", callingCode, countryCode.uppercaseString];
|
||||
NSString *titleFormat = ([UIView new].isRTL ? @"(%2$@) %1$@" : @"%1$@ (%2$@)");
|
||||
NSString *title = [NSString stringWithFormat:titleFormat, callingCode, countryCode.uppercaseString];
|
||||
[self.countryCodeButton setTitle:title forState:UIControlStateNormal];
|
||||
[self.countryCodeButton layoutSubviews];
|
||||
|
||||
@ -263,9 +263,14 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
|
||||
{
|
||||
CountryCodeViewController *countryCodeController = [CountryCodeViewController new];
|
||||
countryCodeController.countryCodeDelegate = self;
|
||||
UINavigationController *navigationController =
|
||||
[[UINavigationController alloc] initWithRootViewController:countryCodeController];
|
||||
[self presentViewController:navigationController animated:YES completion:[UIUtil modalCompletionBlock]];
|
||||
countryCodeController.isPresentedInNavigationController = self.isPresentedInNavigationController;
|
||||
if (self.isPresentedInNavigationController) {
|
||||
[self.navigationController pushViewController:countryCodeController animated:YES];
|
||||
} else {
|
||||
UINavigationController *navigationController =
|
||||
[[UINavigationController alloc] initWithRootViewController:countryCodeController];
|
||||
[self presentViewController:navigationController animated:YES completion:[UIUtil modalCompletionBlock]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)phoneNumberButtonPressed
|
||||
|
||||
@ -181,6 +181,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
NewNonContactConversationViewController *viewController =
|
||||
[NewNonContactConversationViewController new];
|
||||
viewController.nonContactConversationDelegate = weakSelf;
|
||||
viewController.isPresentedInNavigationController = YES;
|
||||
[weakSelf.navigationController pushViewController:viewController
|
||||
animated:YES];
|
||||
}]];
|
||||
|
||||
@ -10,7 +10,7 @@ import SignalServiceKit
|
||||
import PromiseKit
|
||||
|
||||
@objc
|
||||
public class ShareViewController: UINavigationController, ShareViewDelegate, SAEFailedViewDelegate {
|
||||
public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailedViewDelegate {
|
||||
|
||||
enum ShareViewControllerError: Error {
|
||||
case assertionError(description: String)
|
||||
@ -105,8 +105,6 @@ public class ShareViewController: UINavigationController, ShareViewDelegate, SAE
|
||||
self.versionMigrationsDidComplete()
|
||||
})
|
||||
|
||||
self.isNavigationBarHidden = true
|
||||
|
||||
// We don't need to use "screen protection" in the SAE.
|
||||
|
||||
// Ensure OWSContactsSyncing is instantiated.
|
||||
@ -470,7 +468,6 @@ public class ShareViewController: UINavigationController, ShareViewDelegate, SAE
|
||||
self.buildAttachment().then { attachment -> Void in
|
||||
let conversationPicker = SharingThreadPickerViewController(shareViewDelegate: self)
|
||||
conversationPicker.attachment = attachment
|
||||
self.shareViewNavigationController.isNavigationBarHidden = true
|
||||
self.progressPoller = nil
|
||||
self.loadViewController = nil
|
||||
self.showPrimaryViewController(conversationPicker)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user