Fix document picker appearance
This commit is contained in:
parent
af0efc325b
commit
a25276b5be
|
@ -240,7 +240,7 @@
|
|||
B849789625D4A2F500D0D0B3 /* LinkPreviewViewV2.swift in Sources */ = {isa = PBXBuildFile; fileRef = B849789525D4A2F500D0D0B3 /* LinkPreviewViewV2.swift */; };
|
||||
B85357BF23A1AE0800AAF6CD /* SeedReminderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85357BE23A1AE0800AAF6CD /* SeedReminderView.swift */; };
|
||||
B85357C323A1BD1200AAF6CD /* SeedVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85357C223A1BD1200AAF6CD /* SeedVC.swift */; };
|
||||
B8544E3323D50E4900299F14 /* AppearanceUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8544E3223D50E4900299F14 /* AppearanceUtilities.swift */; };
|
||||
B8544E3323D50E4900299F14 /* SNAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8544E3223D50E4900299F14 /* SNAppearance.swift */; };
|
||||
B8566C63256F55930045A0B9 /* OWSLinkPreview+Conversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8566C62256F55930045A0B9 /* OWSLinkPreview+Conversion.swift */; };
|
||||
B8566C6C256F60F50045A0B9 /* OWSUserProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2D1255B6DAF007E1867 /* OWSUserProfile.m */; };
|
||||
B8566C7D256F62030045A0B9 /* OWSUserProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = C38EF2D3255B6DAF007E1867 /* OWSUserProfile.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
|
@ -1299,7 +1299,7 @@
|
|||
B85357BE23A1AE0800AAF6CD /* SeedReminderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeedReminderView.swift; sourceTree = "<group>"; };
|
||||
B85357C223A1BD1200AAF6CD /* SeedVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeedVC.swift; sourceTree = "<group>"; };
|
||||
B8544E3023D16CA500299F14 /* DeviceUtilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceUtilities.swift; sourceTree = "<group>"; };
|
||||
B8544E3223D50E4900299F14 /* AppearanceUtilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppearanceUtilities.swift; sourceTree = "<group>"; };
|
||||
B8544E3223D50E4900299F14 /* SNAppearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SNAppearance.swift; sourceTree = "<group>"; };
|
||||
B8566C62256F55930045A0B9 /* OWSLinkPreview+Conversion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OWSLinkPreview+Conversion.swift"; sourceTree = "<group>"; };
|
||||
B8569AC225CB5D2900DBA3DB /* ConversationVC+Interaction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ConversationVC+Interaction.swift"; sourceTree = "<group>"; };
|
||||
B8569AD225CBA13D00DBA3DB /* MediaTextOverlayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaTextOverlayView.swift; sourceTree = "<group>"; };
|
||||
|
@ -2120,7 +2120,7 @@
|
|||
450DF2041E0D74AC003D14BE /* Platform.swift */,
|
||||
4521C3BF1F59F3BA00B4C582 /* TextFieldHelper.swift */,
|
||||
34D1F0BF1F8EC1760066283D /* MessageRecipientStatusUtils.swift */,
|
||||
B8544E3223D50E4900299F14 /* AppearanceUtilities.swift */,
|
||||
B8544E3223D50E4900299F14 /* SNAppearance.swift */,
|
||||
C364535B252467900045C478 /* AudioUtilities.swift */,
|
||||
C3D0972A2510499C00F6E3E4 /* BackgroundPoller.swift */,
|
||||
C31A6C5B247F2CF3001123EF /* CGRect+Utilities.swift */,
|
||||
|
@ -5084,7 +5084,7 @@
|
|||
34B6A903218B3F63007C4606 /* TypingIndicatorView.swift in Sources */,
|
||||
B886B4A72398B23E00211ABE /* QRCodeVC.swift in Sources */,
|
||||
34EA69402194933900702471 /* MediaDownloadView.swift in Sources */,
|
||||
B8544E3323D50E4900299F14 /* AppearanceUtilities.swift in Sources */,
|
||||
B8544E3323D50E4900299F14 /* SNAppearance.swift in Sources */,
|
||||
4C586926224FAB83003FD070 /* AVAudioSession+OWS.m in Sources */,
|
||||
3496744D2076768700080B5F /* OWSMessageBubbleView.m in Sources */,
|
||||
C331FFF42558FF0300070591 /* PNOptionView.swift in Sources */,
|
||||
|
|
|
@ -102,16 +102,16 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc
|
|||
let documentPickerVC = UIDocumentPickerViewController(documentTypes: [ kUTTypeItem as String ], in: UIDocumentPickerMode.import)
|
||||
documentPickerVC.delegate = self
|
||||
documentPickerVC.modalPresentationStyle = .fullScreen
|
||||
AppearanceUtilities.switchToImagePickerAppearance()
|
||||
SNAppearance.switchToDocumentPickerAppearance()
|
||||
present(documentPickerVC, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
|
||||
AppearanceUtilities.switchToSessionAppearance()
|
||||
SNAppearance.switchToSessionAppearance()
|
||||
}
|
||||
|
||||
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
|
||||
AppearanceUtilities.switchToSessionAppearance()
|
||||
SNAppearance.switchToSessionAppearance()
|
||||
guard let url = urls.first else { return } // TODO: Handle multiple?
|
||||
let urlResourceValues: URLResourceValues
|
||||
do {
|
||||
|
|
|
@ -211,7 +211,7 @@ static NSTimeInterval launchStartedAt;
|
|||
|
||||
[SNConfiguration performMainSetup];
|
||||
|
||||
[LKAppearanceUtilities switchToSessionAppearance];
|
||||
[SNAppearance switchToSessionAppearance];
|
||||
|
||||
if (CurrentAppContext().isRunningTests) {
|
||||
return YES;
|
||||
|
|
|
@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
OWSAssertIsOnMainThread();
|
||||
OWSAssertDebug(self.delegate);
|
||||
|
||||
[LKAppearanceUtilities switchToImagePickerAppearance];
|
||||
[SNAppearance switchToImagePickerAppearance];
|
||||
|
||||
[self.delegate.fromViewController ows_askForCameraPermissions:^(BOOL granted) {
|
||||
if (!granted) {
|
||||
|
@ -85,7 +85,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
OWSAssertIsOnMainThread();
|
||||
OWSAssertDebug(self.delegate);
|
||||
|
||||
[LKAppearanceUtilities switchToImagePickerAppearance];
|
||||
[SNAppearance switchToImagePickerAppearance];
|
||||
|
||||
[self.delegate.fromViewController ows_askForMediaLibraryPermissions:^(BOOL granted) {
|
||||
if (!granted) {
|
||||
|
@ -111,7 +111,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
OWSAssertIsOnMainThread();
|
||||
OWSAssertDebug(self.delegate);
|
||||
|
||||
[LKAppearanceUtilities switchToSessionAppearance];
|
||||
[SNAppearance switchToSessionAppearance];
|
||||
|
||||
[self.delegate.fromViewController dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
OWSAssertIsOnMainThread();
|
||||
OWSAssertDebug(self.delegate);
|
||||
|
||||
[LKAppearanceUtilities switchToSessionAppearance];
|
||||
[SNAppearance switchToSessionAppearance];
|
||||
|
||||
UIImage *rawAvatar = [info objectForKey:UIImagePickerControllerOriginalImage];
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
@objc(LKAppearanceUtilities)
|
||||
final class AppearanceUtilities : NSObject {
|
||||
@objc final class SNAppearance : NSObject {
|
||||
|
||||
@objc static func switchToSessionAppearance() {
|
||||
if #available(iOS 13, *) {
|
||||
|
@ -23,4 +22,12 @@ final class AppearanceUtilities : NSObject {
|
|||
UINavigationBar.appearance().titleTextAttributes = [ NSAttributedString.Key.foregroundColor : UIColor.black ]
|
||||
}
|
||||
}
|
||||
|
||||
@objc static func switchToDocumentPickerAppearance() {
|
||||
if #available(iOS 13, *) {
|
||||
let textColor: UIColor = isDarkMode ? .white : .black
|
||||
UINavigationBar.appearance().tintColor = textColor
|
||||
UINavigationBar.appearance().titleTextAttributes = [ NSAttributedString.Key.foregroundColor : textColor ]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue