mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
On iOS11 doc picker requires system appearance.
Otherwise nav items are illegible. // FREEBIE
This commit is contained in:
parent
b6c9a2a67f
commit
0cd56d4bcc
2 changed files with 13 additions and 4 deletions
|
@ -737,7 +737,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
||||||
|
|
||||||
[super viewWillAppear:animated];
|
[super viewWillAppear:animated];
|
||||||
|
|
||||||
// In case we're dismissing a CNContactViewController which requires default system appearance
|
// In case we're dismissing a CNContactViewController, or DocumentPicker which requires default system appearance
|
||||||
[UIUtil applySignalAppearence];
|
[UIUtil applySignalAppearence];
|
||||||
|
|
||||||
[self addVisibleListeners];
|
[self addVisibleListeners];
|
||||||
|
@ -3199,7 +3199,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
||||||
|
|
||||||
#pragma mark - Attachment Picking: Documents
|
#pragma mark - Attachment Picking: Documents
|
||||||
|
|
||||||
- (void)showAttachmentDocumentPicker
|
- (void)showAttachmentDocumentPickerMenu
|
||||||
{
|
{
|
||||||
NSString *allItems = (__bridge NSString *)kUTTypeItem;
|
NSString *allItems = (__bridge NSString *)kUTTypeItem;
|
||||||
NSArray<NSString *> *documentTypes = @[ allItems ];
|
NSArray<NSString *> *documentTypes = @[ allItems ];
|
||||||
|
@ -3209,6 +3209,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
||||||
UIDocumentMenuViewController *menuController =
|
UIDocumentMenuViewController *menuController =
|
||||||
[[UIDocumentMenuViewController alloc] initWithDocumentTypes:documentTypes inMode:pickerMode];
|
[[UIDocumentMenuViewController alloc] initWithDocumentTypes:documentTypes inMode:pickerMode];
|
||||||
menuController.delegate = self;
|
menuController.delegate = self;
|
||||||
|
|
||||||
[self presentViewController:menuController animated:YES completion:nil];
|
[self presentViewController:menuController animated:YES completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3257,6 +3258,10 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
||||||
didPickDocumentPicker:(UIDocumentPickerViewController *)documentPicker
|
didPickDocumentPicker:(UIDocumentPickerViewController *)documentPicker
|
||||||
{
|
{
|
||||||
documentPicker.delegate = self;
|
documentPicker.delegate = self;
|
||||||
|
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 0)) {
|
||||||
|
// post iOS11, document picker has no blue header.
|
||||||
|
[UIUtil applyDefaultSystemAppearence];
|
||||||
|
}
|
||||||
[self presentViewController:documentPicker animated:YES completion:nil];
|
[self presentViewController:documentPicker animated:YES completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3266,6 +3271,11 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
||||||
{
|
{
|
||||||
DDLogDebug(@"%@ Picked document at url: %@", self.tag, url);
|
DDLogDebug(@"%@ Picked document at url: %@", self.tag, url);
|
||||||
|
|
||||||
|
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(11, 0)) {
|
||||||
|
// post iOS11, document picker has no blue header.
|
||||||
|
[UIUtil applySignalAppearence];
|
||||||
|
}
|
||||||
|
|
||||||
NSString *type;
|
NSString *type;
|
||||||
NSError *typeError;
|
NSError *typeError;
|
||||||
[url getResourceValue:&type forKey:NSURLTypeIdentifierKey error:&typeError];
|
[url getResourceValue:&type forKey:NSURLTypeIdentifierKey error:&typeError];
|
||||||
|
@ -4086,7 +4096,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
||||||
@"action sheet button title when choosing attachment type")
|
@"action sheet button title when choosing attachment type")
|
||||||
style:UIAlertActionStyleDefault
|
style:UIAlertActionStyleDefault
|
||||||
handler:^(UIAlertAction *_Nonnull action) {
|
handler:^(UIAlertAction *_Nonnull action) {
|
||||||
[self showAttachmentDocumentPicker];
|
[self showAttachmentDocumentPickerMenu];
|
||||||
}];
|
}];
|
||||||
UIImage *chooseDocumentImage = [UIImage imageNamed:@"actionsheet_document_black"];
|
UIImage *chooseDocumentImage = [UIImage imageNamed:@"actionsheet_document_black"];
|
||||||
OWSAssert(chooseDocumentImage);
|
OWSAssert(chooseDocumentImage);
|
||||||
|
|
|
@ -80,7 +80,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
} else if ([phoneNumberField.label isEqualToString:CNLabelPhoneNumberiPhone]) {
|
} else if ([phoneNumberField.label isEqualToString:CNLabelPhoneNumberiPhone]) {
|
||||||
phoneNumberNameMap[phoneNumber.stringValue]
|
phoneNumberNameMap[phoneNumber.stringValue]
|
||||||
= NSLocalizedString(@"PHONE_NUMBER_TYPE_IPHONE", @"Label for 'IPhone' phone numbers.");
|
= NSLocalizedString(@"PHONE_NUMBER_TYPE_IPHONE", @"Label for 'IPhone' phone numbers.");
|
||||||
;
|
|
||||||
} else if ([phoneNumberField.label isEqualToString:CNLabelPhoneNumberMobile]) {
|
} else if ([phoneNumberField.label isEqualToString:CNLabelPhoneNumberMobile]) {
|
||||||
phoneNumberNameMap[phoneNumber.stringValue]
|
phoneNumberNameMap[phoneNumber.stringValue]
|
||||||
= NSLocalizedString(@"PHONE_NUMBER_TYPE_MOBILE", @"Label for 'Mobile' phone numbers.");
|
= NSLocalizedString(@"PHONE_NUMBER_TYPE_MOBILE", @"Label for 'Mobile' phone numbers.");
|
||||||
|
|
Loading…
Reference in a new issue