diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index fe75af3e7..0a58c831c 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -5,7 +5,7 @@ // • Remaining search glitchiness final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversationSettingsViewDelegate, ConversationSearchControllerDelegate, UITableViewDataSource, UITableViewDelegate { - let isUnsendRequestsEnabled = false // Set to true once unsend requests are done on all platforms + let isUnsendRequestsEnabled = true // Set to true once unsend requests are done on all platforms let thread: TSThread let focusedMessageID: String? // This isn't actually used ATM var unreadViewItems: [ConversationViewItem] = [] diff --git a/Session/Conversations/Message Cells/Content Views/MediaTextOverlayView.swift b/Session/Conversations/Message Cells/Content Views/MediaTextOverlayView.swift index 8b152d6a9..9be711311 100644 --- a/Session/Conversations/Message Cells/Content Views/MediaTextOverlayView.swift +++ b/Session/Conversations/Message Cells/Content Views/MediaTextOverlayView.swift @@ -1,19 +1,22 @@ +import UIKit /// Shown over a media message if it has a message body. final class MediaTextOverlayView : UIView { private let viewItem: ConversationViewItem private let albumViewWidth: CGFloat private let delegate: MessageCellDelegate + private let textColor: UIColor var readMoreButton: UIButton? // MARK: Settings private static let maxHeight: CGFloat = 88; // MARK: Lifecycle - init(viewItem: ConversationViewItem, albumViewWidth: CGFloat, delegate: MessageCellDelegate) { + init(viewItem: ConversationViewItem, albumViewWidth: CGFloat, textColor: UIColor, delegate: MessageCellDelegate) { self.viewItem = viewItem self.albumViewWidth = albumViewWidth self.delegate = delegate + self.textColor = textColor super.init(frame: CGRect.zero) setUpViewHierarchy() } @@ -28,29 +31,21 @@ final class MediaTextOverlayView : UIView { private func setUpViewHierarchy() { guard let message = viewItem.interaction as? TSMessage, let body = message.body, body.count > 0 else { return } - // Shadow - let shadowView = GradientView(from: .clear, to: UIColor.black.withAlphaComponent(0.7)) - addSubview(shadowView) - shadowView.pin(to: self) - // Line - let lineView = UIView() - lineView.backgroundColor = Colors.accent - lineView.set(.width, to: Values.accentLineThickness) // Body label let bodyLabel = UILabel() bodyLabel.numberOfLines = 0 bodyLabel.lineBreakMode = .byTruncatingTail bodyLabel.text = given(body) { MentionUtilities.highlightMentions(in: $0, threadID: viewItem.interaction.uniqueThreadId) } - bodyLabel.textColor = .white - bodyLabel.font = .systemFont(ofSize: Values.smallFontSize) + bodyLabel.textColor = self.textColor + bodyLabel.font = .systemFont(ofSize: Values.mediumFontSize) // Content stack view - let contentStackView = UIStackView(arrangedSubviews: [ lineView, bodyLabel ]) + let contentStackView = UIStackView(arrangedSubviews: [ bodyLabel ]) contentStackView.axis = .horizontal contentStackView.spacing = Values.smallSpacing addSubview(contentStackView) - let inset = Values.mediumSpacing + let inset: CGFloat = 12 contentStackView.pin(.left, to: .left, of: self, withInset: inset) - contentStackView.pin(.top, to: .top, of: self, withInset: 3 * inset) + contentStackView.pin(.top, to: .top, of: self) contentStackView.pin(.right, to: .right, of: self, withInset: -inset) // Max height bodyLabel.heightAnchor.constraint(lessThanOrEqualToConstant: MediaTextOverlayView.maxHeight).isActive = true diff --git a/Session/Conversations/Message Cells/VisibleMessageCell.swift b/Session/Conversations/Message Cells/VisibleMessageCell.swift index 5d66f6401..fe529aa51 100644 --- a/Session/Conversations/Message Cells/VisibleMessageCell.swift +++ b/Session/Conversations/Message Cells/VisibleMessageCell.swift @@ -354,6 +354,11 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate { showMediaPlaceholder() } else { guard let cache = delegate?.getMediaCache() else { preconditionFailure() } + // Stack view + let stackView = UIStackView(arrangedSubviews: []) + stackView.axis = .vertical + stackView.spacing = Values.smallSpacing + // Album view let maxMessageWidth = VisibleMessageCell.getMaxWidth(for: viewItem) let albumView = MediaAlbumView(mediaCache: cache, items: viewItem.mediaAlbumItems!, isOutgoing: isOutgoing, maxMessageWidth: maxMessageWidth) self.albumView = albumView @@ -361,17 +366,20 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate { let size = getSize(for: viewItem) albumView.set(.width, to: size.width) albumView.set(.height, to: size.height) - albumView.pin(to: snContentView) albumView.loadMedia() albumView.layer.mask = bubbleViewMaskLayer + stackView.addArrangedSubview(albumView) + // Body text view if let message = viewItem.interaction as? TSMessage, let body = message.body, body.count > 0, let delegate = delegate { // delegate should always be set at this point - let overlayView = MediaTextOverlayView(viewItem: viewItem, albumViewWidth: size.width, delegate: delegate) + let overlayView = MediaTextOverlayView(viewItem: viewItem, albumViewWidth: size.width, textColor: bodyLabelTextColor, delegate: delegate) self.mediaTextOverlayView = overlayView - snContentView.addSubview(overlayView) - overlayView.pin([ UIView.HorizontalEdge.left, UIView.VerticalEdge.bottom, UIView.HorizontalEdge.right ], to: snContentView) + stackView.addArrangedSubview(overlayView) } unloadContent = { albumView.unloadMedia() } + // Constraints + snContentView.addSubview(stackView) + stackView.pin(to: snContentView) } case .audio: if viewItem.interaction is TSIncomingMessage, diff --git a/Session/Meta/AppDelegate.m b/Session/Meta/AppDelegate.m index 29e9e0cda..413f90059 100644 --- a/Session/Meta/AppDelegate.m +++ b/Session/Meta/AppDelegate.m @@ -194,8 +194,8 @@ static NSTimeInterval launchStartedAt; mainWindow.rootViewController = [LoadingViewController new]; [mainWindow makeKeyAndVisible]; - LKAppMode appMode = [self getAppModeOrSystemDefault]; - [self setCurrentAppMode:appMode]; + LKAppMode appMode = [self getCurrentAppMode]; + [self adaptAppMode:appMode]; if (@available(iOS 11, *)) { // This must happen in appDidFinishLaunching or earlier to ensure we don't @@ -246,7 +246,7 @@ static NSTimeInterval launchStartedAt; [self ensureRootViewController]; LKAppMode appMode = [self getCurrentAppMode]; - [self setCurrentAppMode:appMode]; + [self adaptAppMode:appMode]; [AppReadiness runNowOrWhenAppDidBecomeReady:^{ [self handleActivation]; @@ -709,16 +709,10 @@ static NSTimeInterval launchStartedAt; # pragma mark - App Mode -- (LKAppMode)getCurrentAppMode -{ - return [NSUserDefaults.standardUserDefaults integerForKey:@"appMode"]; -} - -- (void)setCurrentAppMode:(LKAppMode)appMode +- (void)adaptAppMode:(LKAppMode)appMode { UIWindow *window = UIApplication.sharedApplication.keyWindow; if (window == nil) { return; } - [NSUserDefaults.standardUserDefaults setInteger:appMode forKey:@"appMode"]; switch (appMode) { case LKAppModeLight: { if (@available(iOS 13.0, *)) { @@ -735,9 +729,34 @@ static NSTimeInterval launchStartedAt; break; } } + if (LKAppModeUtilities.isSystemDefault) { + if (@available(iOS 13.0, *)) { + window.overrideUserInterfaceStyle = UIUserInterfaceStyleUnspecified; + } + } [NSNotificationCenter.defaultCenter postNotificationName:NSNotification.appModeChanged object:nil]; } +- (LKAppMode)getCurrentAppMode +{ + LKAppMode appMode = [self getAppModeOrSystemDefault]; + UIWindow *window = UIApplication.sharedApplication.keyWindow; + return appMode; +} + +- (void)setCurrentAppMode:(LKAppMode)appMode +{ + [NSUserDefaults.standardUserDefaults setInteger:appMode forKey:@"appMode"]; + [self adaptAppMode:appMode]; +} + +- (void)setAppModeToSystemDefault +{ + [NSUserDefaults.standardUserDefaults removeObjectForKey:@"appMode"]; + LKAppMode appMode = [self getCurrentAppMode]; + [self adaptAppMode:appMode]; +} + # pragma mark - Other - (void)handleDataNukeRequested:(NSNotification *)notification diff --git a/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/Contents.json b/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/Contents.json index b61a86768..4d1bdc517 100644 --- a/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/Contents.json +++ b/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/Contents.json @@ -1,23 +1,12 @@ { "images" : [ { - "idiom" : "universal", - "filename" : "dark-theme-off-24@1x.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "dark-theme-off-24@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "dark-theme-off-24@3x.png", - "scale" : "3x" + "filename" : "moon.pdf", + "idiom" : "universal" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/dark-theme-off-24@1x.png b/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/dark-theme-off-24@1x.png deleted file mode 100644 index 78d8d6869..000000000 Binary files a/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/dark-theme-off-24@1x.png and /dev/null differ diff --git a/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/dark-theme-off-24@2x.png b/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/dark-theme-off-24@2x.png deleted file mode 100644 index f63cd9b30..000000000 Binary files a/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/dark-theme-off-24@2x.png and /dev/null differ diff --git a/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/dark-theme-off-24@3x.png b/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/dark-theme-off-24@3x.png deleted file mode 100644 index 10824a121..000000000 Binary files a/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/dark-theme-off-24@3x.png and /dev/null differ diff --git a/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/moon.pdf b/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/moon.pdf new file mode 100644 index 000000000..2e49f3144 Binary files /dev/null and b/Session/Meta/Images.xcassets/ic_dark_theme_off.imageset/moon.pdf differ diff --git a/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/Contents.json b/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/Contents.json index 419eeeb08..c64d93968 100644 --- a/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/Contents.json +++ b/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/Contents.json @@ -1,23 +1,12 @@ { "images" : [ { - "idiom" : "universal", - "filename" : "dark-theme-on-24@1x.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "dark-theme-on-24@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "dark-theme-on-24@3x.png", - "scale" : "3x" + "filename" : "moon_fill.pdf", + "idiom" : "universal" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/dark-theme-on-24@1x.png b/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/dark-theme-on-24@1x.png deleted file mode 100644 index 1ff344e0a..000000000 Binary files a/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/dark-theme-on-24@1x.png and /dev/null differ diff --git a/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/dark-theme-on-24@2x.png b/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/dark-theme-on-24@2x.png deleted file mode 100644 index fbdf614dd..000000000 Binary files a/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/dark-theme-on-24@2x.png and /dev/null differ diff --git a/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/dark-theme-on-24@3x.png b/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/dark-theme-on-24@3x.png deleted file mode 100644 index a82283feb..000000000 Binary files a/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/dark-theme-on-24@3x.png and /dev/null differ diff --git a/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/moon_fill.pdf b/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/moon_fill.pdf new file mode 100644 index 000000000..a483dc690 Binary files /dev/null and b/Session/Meta/Images.xcassets/ic_dark_theme_on.imageset/moon_fill.pdf differ diff --git a/Session/Meta/Images.xcassets/ic_theme_auto.imageset/Contents.json b/Session/Meta/Images.xcassets/ic_theme_auto.imageset/Contents.json new file mode 100644 index 000000000..3c725dec9 --- /dev/null +++ b/Session/Meta/Images.xcassets/ic_theme_auto.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "moon_auto.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Session/Meta/Images.xcassets/ic_theme_auto.imageset/moon_auto.pdf b/Session/Meta/Images.xcassets/ic_theme_auto.imageset/moon_auto.pdf new file mode 100644 index 000000000..f2f6aae2e Binary files /dev/null and b/Session/Meta/Images.xcassets/ic_theme_auto.imageset/moon_auto.pdf differ diff --git a/Session/Meta/Translations/de.lproj/Localizable.strings b/Session/Meta/Translations/de.lproj/Localizable.strings index 75a37c6a9..8652ee572 100644 --- a/Session/Meta/Translations/de.lproj/Localizable.strings +++ b/Session/Meta/Translations/de.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Mitglieder hinzufügen"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/en.lproj/Localizable.strings b/Session/Meta/Translations/en.lproj/Localizable.strings index 86277878a..3e0abe961 100644 --- a/Session/Meta/Translations/en.lproj/Localizable.strings +++ b/Session/Meta/Translations/en.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -572,3 +572,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/es.lproj/Localizable.strings b/Session/Meta/Translations/es.lproj/Localizable.strings index 11726392c..96dcb37e1 100644 --- a/Session/Meta/Translations/es.lproj/Localizable.strings +++ b/Session/Meta/Translations/es.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Añadir Miembros"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/fa.lproj/Localizable.strings b/Session/Meta/Translations/fa.lproj/Localizable.strings index eb1e06929..365e59a13 100644 --- a/Session/Meta/Translations/fa.lproj/Localizable.strings +++ b/Session/Meta/Translations/fa.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/fi.lproj/Localizable.strings b/Session/Meta/Translations/fi.lproj/Localizable.strings index 630a92fc6..e207a79c7 100644 --- a/Session/Meta/Translations/fi.lproj/Localizable.strings +++ b/Session/Meta/Translations/fi.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Lisää jäseniä"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/fr.lproj/Localizable.strings b/Session/Meta/Translations/fr.lproj/Localizable.strings index 3904fc388..0d8755eab 100644 --- a/Session/Meta/Translations/fr.lproj/Localizable.strings +++ b/Session/Meta/Translations/fr.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Ajouter des membres"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/hi.lproj/Localizable.strings b/Session/Meta/Translations/hi.lproj/Localizable.strings index 5fb80be9c..acceed3b6 100644 --- a/Session/Meta/Translations/hi.lproj/Localizable.strings +++ b/Session/Meta/Translations/hi.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "सदस्य जोड़ें"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/hr.lproj/Localizable.strings b/Session/Meta/Translations/hr.lproj/Localizable.strings index f00a6d2b1..56fb5a125 100644 --- a/Session/Meta/Translations/hr.lproj/Localizable.strings +++ b/Session/Meta/Translations/hr.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Dodaj članove"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/id-ID.lproj/Localizable.strings b/Session/Meta/Translations/id-ID.lproj/Localizable.strings index 27f04eb17..98a53450d 100644 --- a/Session/Meta/Translations/id-ID.lproj/Localizable.strings +++ b/Session/Meta/Translations/id-ID.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/it.lproj/Localizable.strings b/Session/Meta/Translations/it.lproj/Localizable.strings index 8d98bbe76..117f44ebb 100644 --- a/Session/Meta/Translations/it.lproj/Localizable.strings +++ b/Session/Meta/Translations/it.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Aggiungi membri"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/ja.lproj/Localizable.strings b/Session/Meta/Translations/ja.lproj/Localizable.strings index aa668b546..f70f9d905 100644 --- a/Session/Meta/Translations/ja.lproj/Localizable.strings +++ b/Session/Meta/Translations/ja.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "メンバーを追加する"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/nl.lproj/Localizable.strings b/Session/Meta/Translations/nl.lproj/Localizable.strings index 256148640..177d55e6a 100644 --- a/Session/Meta/Translations/nl.lproj/Localizable.strings +++ b/Session/Meta/Translations/nl.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Voeg deelnemers toe"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/pl.lproj/Localizable.strings b/Session/Meta/Translations/pl.lproj/Localizable.strings index bcfe6f24f..bb96a0f00 100644 --- a/Session/Meta/Translations/pl.lproj/Localizable.strings +++ b/Session/Meta/Translations/pl.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Dodaj użytkowników"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/pt_BR.lproj/Localizable.strings b/Session/Meta/Translations/pt_BR.lproj/Localizable.strings index d01dc8ae8..55a396153 100644 --- a/Session/Meta/Translations/pt_BR.lproj/Localizable.strings +++ b/Session/Meta/Translations/pt_BR.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Adicionar Membros"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/ru.lproj/Localizable.strings b/Session/Meta/Translations/ru.lproj/Localizable.strings index 7638277bf..fa6bec9f5 100644 --- a/Session/Meta/Translations/ru.lproj/Localizable.strings +++ b/Session/Meta/Translations/ru.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Добавить участников"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/si.lproj/Localizable.strings b/Session/Meta/Translations/si.lproj/Localizable.strings index 86277878a..3e0abe961 100644 --- a/Session/Meta/Translations/si.lproj/Localizable.strings +++ b/Session/Meta/Translations/si.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -572,3 +572,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/sk.lproj/Localizable.strings b/Session/Meta/Translations/sk.lproj/Localizable.strings index a576bf501..f3b6cf878 100644 --- a/Session/Meta/Translations/sk.lproj/Localizable.strings +++ b/Session/Meta/Translations/sk.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Pridať členov"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/sv.lproj/Localizable.strings b/Session/Meta/Translations/sv.lproj/Localizable.strings index 9cb625b39..ac958ab1e 100644 --- a/Session/Meta/Translations/sv.lproj/Localizable.strings +++ b/Session/Meta/Translations/sv.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Lägg till medlemmar"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/th.lproj/Localizable.strings b/Session/Meta/Translations/th.lproj/Localizable.strings index 154ddbf7f..a09a9c805 100644 --- a/Session/Meta/Translations/th.lproj/Localizable.strings +++ b/Session/Meta/Translations/th.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "เพิ่มสมาชิก"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/vi-VN.lproj/Localizable.strings b/Session/Meta/Translations/vi-VN.lproj/Localizable.strings index fe322da91..5ff989a05 100644 --- a/Session/Meta/Translations/vi-VN.lproj/Localizable.strings +++ b/Session/Meta/Translations/vi-VN.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings b/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings index 25e63d471..b44d5dc07 100644 --- a/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "新增成員"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -571,3 +571,7 @@ "DISMISS_BUTTON_TEXT" = "Dismiss"; /* Button text which opens the settings app */ "OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Meta/Translations/zh_CN.lproj/Localizable.strings b/Session/Meta/Translations/zh_CN.lproj/Localizable.strings index 810a534ad..baaa6937c 100644 --- a/Session/Meta/Translations/zh_CN.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh_CN.lproj/Localizable.strings @@ -547,7 +547,7 @@ "vc_conversation_settings_invite_button_title" = "添加成员"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; -"vc_settings_support_button_title" = "Support"; +"vc_settings_support_button_title" = "Debug Log"; "modal_send_seed_title" = "Warning"; "modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; "modal_send_seed_send_button_title" = "Send"; @@ -568,3 +568,10 @@ "accessibility_library_button" = "Photo library"; "accessibility_camera_button" = "Camera"; "accessibility_main_button_collapse" = "Collapse attachment options"; +"DISMISS_BUTTON_TEXT" = "Dismiss"; +/* Button text which opens the settings app */ +"OPEN_SETTINGS_BUTTON" = "Settings"; +"APN_Message" = "You've got a new message"; +"system_mode_theme" = "System"; +"dark_mode_theme" = "Dark"; +"light_mode_theme" = "Light"; diff --git a/Session/Notifications/AppNotifications.swift b/Session/Notifications/AppNotifications.swift index 8199d1b4c..4b3b9f04b 100644 --- a/Session/Notifications/AppNotifications.swift +++ b/Session/Notifications/AppNotifications.swift @@ -184,7 +184,7 @@ public class NotificationPresenter: NSObject, NotificationsProtocol { let previewType = preferences.notificationPreviewType(with: transaction) switch previewType { case .noNameNoPreview: - notificationTitle = nil + notificationTitle = "Session" case .nameNoPreview, .namePreview: switch thread { case is TSContactThread: diff --git a/Session/Settings/SettingsVC.swift b/Session/Settings/SettingsVC.swift index 53febc939..64046bb71 100644 --- a/Session/Settings/SettingsVC.swift +++ b/Session/Settings/SettingsVC.swift @@ -303,7 +303,12 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate { closeButton.isAccessibilityElement = true navigationItem.leftBarButtonItem = closeButton if #available(iOS 13, *) { // Pre iOS 13 the user can't switch actively but the app still responds to system changes - let appModeIcon = isDarkMode ? #imageLiteral(resourceName: "ic_dark_theme_on").withTintColor(.white) : #imageLiteral(resourceName: "ic_dark_theme_off").withTintColor(.black) + let appModeIcon: UIImage + if isSystemDefault { + appModeIcon = isDarkMode ? #imageLiteral(resourceName: "ic_theme_auto").withTintColor(.white) : #imageLiteral(resourceName: "ic_theme_auto").withTintColor(.black) + } else { + appModeIcon = isDarkMode ? #imageLiteral(resourceName: "ic_dark_theme_on").withTintColor(.white) : #imageLiteral(resourceName: "ic_dark_theme_off").withTintColor(.black) + } let appModeButton = UIButton() appModeButton.setImage(appModeIcon, for: UIControl.State.normal) appModeButton.tintColor = Colors.text @@ -404,8 +409,26 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate { } @objc private func switchAppMode() { - let newAppMode: AppMode = isLightMode ? .dark : .light - AppModeManager.shared.setCurrentAppMode(to: newAppMode) + let alertVC = UIAlertController.init(title: nil, message: nil, preferredStyle: .actionSheet) + let systemModeAction = UIAlertAction.init(title: NSLocalizedString("system_mode_theme", comment: ""), style: .default) { _ in + AppModeManager.shared.setAppModeToSystemDefault() + } + alertVC.addAction(systemModeAction) + + let darkModeAction = UIAlertAction.init(title: NSLocalizedString("dark_mode_theme", comment: ""), style: .default) { _ in + AppModeManager.shared.setCurrentAppMode(to: .dark) + } + alertVC.addAction(darkModeAction) + + let lightModeAction = UIAlertAction.init(title: NSLocalizedString("light_mode_theme", comment: ""), style: .default) { _ in + AppModeManager.shared.setCurrentAppMode(to: .light) + } + alertVC.addAction(lightModeAction) + + let cancelAction = UIAlertAction.init(title: NSLocalizedString("TXT_CANCEL_TITLE", comment: ""), style: .cancel) {_ in } + alertVC.addAction(cancelAction) + + self.presentAlert(alertVC) } @objc private func showQRCode() { diff --git a/Session/Shared/BaseVC.swift b/Session/Shared/BaseVC.swift index c13d8ca0b..ff53996b3 100644 --- a/Session/Shared/BaseVC.swift +++ b/Session/Shared/BaseVC.swift @@ -26,6 +26,16 @@ class BaseVC : UIViewController { setNeedsStatusBarAppearanceUpdate() NotificationCenter.default.addObserver(self, selector: #selector(handleAppModeChangedNotification(_:)), name: .appModeChanged, object: nil) } + + internal func ensureWindowBackground() { + let appMode = AppModeManager.shared.currentAppMode + switch appMode { + case .light: + UIApplication.shared.delegate?.window??.backgroundColor = .white + case .dark: + UIApplication.shared.delegate?.window??.backgroundColor = .black + } + } internal func setUpGradientBackground() { hasGradient = true @@ -80,12 +90,13 @@ class BaseVC : UIViewController { } override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { - // TODO: Post an appModeChanged notification? + NotificationCenter.default.post(name: .appModeChanged, object: nil) } @objc internal func handleAppModeChangedNotification(_ notification: Notification) { if hasGradient { setUpGradientBackground() // Re-do the gradient } + ensureWindowBackground() } } diff --git a/SessionNotificationServiceExtension/NotificationServiceExtension.swift b/SessionNotificationServiceExtension/NotificationServiceExtension.swift index d8bd9cd22..8ed9b243a 100644 --- a/SessionNotificationServiceExtension/NotificationServiceExtension.swift +++ b/SessionNotificationServiceExtension/NotificationServiceExtension.swift @@ -104,15 +104,18 @@ public final class NotificationServiceExtension : UNNotificationServiceExtension notificationContent.body = snippet case .nameNoPreview: notificationContent.title = senderDisplayName - notificationContent.body = "You've got a new message" + notificationContent.body = NotificationStrings.incomingMessageBody case .noNameNoPreview: notificationContent.title = "Session" - notificationContent.body = "You've got a new message" + notificationContent.body = NotificationStrings.incomingMessageBody default: break } self.handleSuccess(for: notificationContent) } catch { - self.handleFailure(for: notificationContent) + if let error = error as? MessageReceiver.Error, error.isRetryable { + self.handleFailure(for: notificationContent) + } + self.completeSilenty() } } } diff --git a/SessionShareExtension/ShareVC.swift b/SessionShareExtension/ShareVC.swift index 41cfa31a7..6de48c8d9 100644 --- a/SessionShareExtension/ShareVC.swift +++ b/SessionShareExtension/ShareVC.swift @@ -173,6 +173,10 @@ final class ShareVC : UINavigationController, ShareViewDelegate, AppModeManagerD return // Not applicable to share extensions } + public func setAppModeToSystemDefault() { + return // Not applicable to share extensions + } + // MARK: Updating private func showLockScreenOrMainContent() { if OWSScreenLock.shared.isScreenLockEnabled() { diff --git a/SessionUIKit/Style Guide/AppMode.swift b/SessionUIKit/Style Guide/AppMode.swift index 2da777c2d..01db04682 100644 --- a/SessionUIKit/Style Guide/AppMode.swift +++ b/SessionUIKit/Style Guide/AppMode.swift @@ -25,6 +25,10 @@ public final class AppModeManager : NSObject { public func setCurrentAppMode(to appMode: AppMode) { delegate.setCurrentAppMode(to: appMode) } + + public func setAppModeToSystemDefault() { + delegate.setAppModeToSystemDefault() + } } @objc(LKAppModeManagerDelegate) @@ -33,6 +37,7 @@ public protocol AppModeManagerDelegate { func getCurrentAppMode() -> AppMode @objc(setCurrentAppMode:) func setCurrentAppMode(to appMode: AppMode) + func setAppModeToSystemDefault() } @objc(LKAppMode) @@ -40,6 +45,10 @@ public enum AppMode : Int { case light, dark } +public var isSystemDefault: Bool { + return !UserDefaults.standard.dictionaryRepresentation().keys.contains("appMode") +} + public var isLightMode: Bool { return AppModeManager.shared.currentAppMode == .light } @@ -49,6 +58,10 @@ public var isDarkMode: Bool { } @objc public final class LKAppModeUtilities : NSObject { + + @objc public static var isSystemDefault: Bool { + return !UserDefaults.standard.dictionaryRepresentation().keys.contains("appMode") + } @objc public static var isLightMode: Bool { return AppModeManager.shared.currentAppMode == .light