diff --git a/Signal/src/Loki/OnboardingAccountDetailsViewController.swift b/Signal/src/Loki/OnboardingAccountDetailsViewController.swift index 38d894d12..a6b3546cf 100644 --- a/Signal/src/Loki/OnboardingAccountDetailsViewController.swift +++ b/Signal/src/Loki/OnboardingAccountDetailsViewController.swift @@ -6,8 +6,12 @@ final class OnboardingAccountDetailsViewController : OnboardingBaseViewControlle result.textColor = Theme.primaryColor result.font = UIFont.ows_dynamicTypeBodyClamped result.textAlignment = .center - result.placeholder = NSLocalizedString("Display Name (Optional)", comment: "") + let placeholder = NSMutableAttributedString(string: NSLocalizedString("Display Name (Optional)", comment: "")) + placeholder.addAttribute(.foregroundColor, value: Theme.placeholderColor, range: NSRange(location: 0, length: placeholder.length)) + result.attributedPlaceholder = placeholder + result.tintColor = UIColor.lokiGreen() result.accessibilityIdentifier = "onboarding.accountDetailsStep.userNameTextField" + result.keyboardAppearance = .dark return result }() diff --git a/Signal/src/Loki/OnboardingKeyPairViewController.swift b/Signal/src/Loki/OnboardingKeyPairViewController.swift index 41e8afe92..45e49c835 100644 --- a/Signal/src/Loki/OnboardingKeyPairViewController.swift +++ b/Signal/src/Loki/OnboardingKeyPairViewController.swift @@ -36,12 +36,14 @@ final class OnboardingKeyPairViewController : OnboardingBaseViewController { private lazy var copyButton: OWSFlatButton = { let result = createLinkButton(title: NSLocalizedString("Copy", comment: ""), selector: #selector(copyMnemonic)) result.accessibilityIdentifier = "onboarding.keyPairStep.copyButton" + result.setBackgroundColors(upColor: .clear, downColor: .clear) return result }() private lazy var restoreButton: OWSFlatButton = { let result = createLinkButton(title: NSLocalizedString("Restore Using Mnemonic", comment: ""), selector: #selector(switchMode)) result.accessibilityIdentifier = "onboarding.keyPairStep.restoreButton" + result.setBackgroundColors(upColor: .clear, downColor: .clear) return result }() @@ -64,15 +66,22 @@ final class OnboardingKeyPairViewController : OnboardingBaseViewController { private lazy var mnemonicTextField: UITextField = { let result = UITextField(frame: CGRect.zero) - result.accessibilityIdentifier = "onboarding.keyPairStep.mnemonicTextField" + result.textColor = Theme.primaryColor + result.font = UIFont.ows_dynamicTypeBodyClamped result.textAlignment = .center - result.placeholder = NSLocalizedString("Enter Your Mnemonic", comment: "") + let placeholder = NSMutableAttributedString(string: NSLocalizedString("Enter Your Mnemonic", comment: "")) + placeholder.addAttribute(.foregroundColor, value: Theme.placeholderColor, range: NSRange(location: 0, length: placeholder.length)) + result.attributedPlaceholder = placeholder + result.tintColor = UIColor.lokiGreen() + result.accessibilityIdentifier = "onboarding.keyPairStep.mnemonicTextField" + result.keyboardAppearance = .dark return result }() private lazy var registerButton: OWSFlatButton = { let result = createLinkButton(title: NSLocalizedString("Register a New Account", comment: ""), selector: #selector(switchMode)) result.accessibilityIdentifier = "onboarding.keyPairStep.registerButton" + result.setBackgroundColors(upColor: .clear, downColor: .clear) return result }() @@ -147,6 +156,7 @@ final class OnboardingKeyPairViewController : OnboardingBaseViewController { UIView.transition(with: registerOrRestoreButton, duration: 0.25, options: .transitionCrossDissolve, animations: { self.registerOrRestoreButton.setTitle(registerOrRestoreButtonTitle) }, completion: nil) + if mode == .register { mnemonicTextField.resignFirstResponder() } } private func updateKeyPair() { diff --git a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m index ae5b3aae8..2a4130fa3 100644 --- a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m +++ b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m @@ -84,7 +84,7 @@ [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop target:self action:@selector(dismissWasPressed:)]; - [self updateRightBarButtonForTheme]; + // [self updateRightBarButtonForTheme]; [self observeNotifications]; self.title = NSLocalizedString(@"SETTINGS_NAV_BAR_TITLE", @"Title for settings activity"); @@ -174,12 +174,15 @@ // ======== } - [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_INVITE_TITLE", - @"Settings table view cell label") - accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"invite") - actionBlock:^{ - [weakSelf showInviteFlow]; - }]]; + // Loki: Original code + // ======== +// [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_INVITE_TITLE", +// @"Settings table view cell label") +// accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"invite") +// actionBlock:^{ +// [weakSelf showInviteFlow]; +// }]]; + // ======== [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_TITLE", @"Settings table view cell label") accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"privacy") @@ -191,17 +194,20 @@ actionBlock:^{ [weakSelf showNotifications]; }]]; - [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"LINKED_DEVICES_TITLE", - @"Menu item and navbar title for the device manager") - accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"linked_devices") - actionBlock:^{ - [weakSelf showLinkedDevices]; - }]]; - [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_TITLE", @"") - accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"advanced") - actionBlock:^{ - [weakSelf showAdvanced]; - }]]; + // Loki: Original code + // ======== +// [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"LINKED_DEVICES_TITLE", +// @"Menu item and navbar title for the device manager") +// accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"linked_devices") +// actionBlock:^{ +// [weakSelf showLinkedDevices]; +// }]]; +// [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_TITLE", @"") +// accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"advanced") +// actionBlock:^{ +// [weakSelf showAdvanced]; +// }]]; + // ======== BOOL isBackupEnabled = [OWSBackup.sharedManager isBackupEnabled]; BOOL showBackup = (OWSBackup.isFeatureEnabled && isBackupEnabled); if (showBackup) { @@ -212,18 +218,24 @@ [weakSelf showBackup]; }]]; } - [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_ABOUT", @"") - accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"about") - actionBlock:^{ - [weakSelf showAbout]; - }]]; + // Loki: Original code + // ======== +// [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_ABOUT", @"") +// accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"about") +// actionBlock:^{ +// [weakSelf showAbout]; +// }]]; + // ======== #ifdef USE_DEBUG_UI - [section addItem:[OWSTableItem disclosureItemWithText:@"Debug UI" - accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"debugui") - actionBlock:^{ - [weakSelf showDebugUI]; - }]]; + // Loki: Original code + // ======== +// [section addItem:[OWSTableItem disclosureItemWithText:@"Debug UI" +// accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"debugui") +// actionBlock:^{ +// [weakSelf showDebugUI]; +// }]]; + // ======== #endif [section diff --git a/Signal/src/ViewControllers/AppSettings/NotificationSettingsOptionsViewController.m b/Signal/src/ViewControllers/AppSettings/NotificationSettingsOptionsViewController.m index 6db89971b..8a7731e91 100644 --- a/Signal/src/ViewControllers/AppSettings/NotificationSettingsOptionsViewController.m +++ b/Signal/src/ViewControllers/AppSettings/NotificationSettingsOptionsViewController.m @@ -25,7 +25,7 @@ __weak NotificationSettingsOptionsViewController *weakSelf = self; OWSTableSection *section = [OWSTableSection new]; - section.footerTitle = NSLocalizedString(@"NOTIFICATIONS_FOOTER_WARNING", nil); + // section.footerTitle = NSLocalizedString(@"NOTIFICATIONS_FOOTER_WARNING", nil); OWSPreferences *prefs = Environment.shared.preferences; NotificationType selectedNotifType = [prefs notificationPreviewType]; diff --git a/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m b/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m index 58ef207e1..793970be5 100644 --- a/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m +++ b/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m @@ -82,36 +82,39 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s __weak PrivacySettingsTableViewController *weakSelf = self; - OWSTableSection *blocklistSection = [OWSTableSection new]; - blocklistSection.headerTitle - = NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", @"Label for the block list section of the settings view"); - [blocklistSection - addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", - @"Label for the block list section of the settings view") - accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"blocklist"] - actionBlock:^{ - [weakSelf showBlocklist]; - }]]; - [contents addSection:blocklistSection]; - - OWSTableSection *readReceiptsSection = [OWSTableSection new]; - readReceiptsSection.headerTitle - = NSLocalizedString(@"SETTINGS_READ_RECEIPT", @"Label for the 'read receipts' setting."); - readReceiptsSection.footerTitle = NSLocalizedString( - @"SETTINGS_READ_RECEIPTS_SECTION_FOOTER", @"An explanation of the 'read receipts' setting."); - [readReceiptsSection - addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_READ_RECEIPT", - @"Label for the 'read receipts' setting.") - accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"read_receipts"] - isOnBlock:^{ - return [OWSReadReceiptManager.sharedManager areReadReceiptsEnabled]; - } - isEnabledBlock:^{ - return YES; - } - target:weakSelf - selector:@selector(didToggleReadReceiptsSwitch:)]]; - [contents addSection:readReceiptsSection]; + // Loki: Original code + // ======== +// OWSTableSection *blocklistSection = [OWSTableSection new]; +// blocklistSection.headerTitle +// = NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", @"Label for the block list section of the settings view"); +// [blocklistSection +// addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", +// @"Label for the block list section of the settings view") +// accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"blocklist"] +// actionBlock:^{ +// [weakSelf showBlocklist]; +// }]]; +// [contents addSection:blocklistSection]; +// +// OWSTableSection *readReceiptsSection = [OWSTableSection new]; +// readReceiptsSection.headerTitle +// = NSLocalizedString(@"SETTINGS_READ_RECEIPT", @"Label for the 'read receipts' setting."); +// readReceiptsSection.footerTitle = NSLocalizedString( +// @"SETTINGS_READ_RECEIPTS_SECTION_FOOTER", @"An explanation of the 'read receipts' setting."); +// [readReceiptsSection +// addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_READ_RECEIPT", +// @"Label for the 'read receipts' setting.") +// accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"read_receipts"] +// isOnBlock:^{ +// return [OWSReadReceiptManager.sharedManager areReadReceiptsEnabled]; +// } +// isEnabledBlock:^{ +// return YES; +// } +// target:weakSelf +// selector:@selector(didToggleReadReceiptsSwitch:)]]; +// [contents addSection:readReceiptsSection]; +// ======== OWSTableSection *typingIndicatorsSection = [OWSTableSection new]; typingIndicatorsSection.headerTitle @@ -135,8 +138,7 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s OWSTableSection *screenLockSection = [OWSTableSection new]; screenLockSection.headerTitle = NSLocalizedString( @"SETTINGS_SCREEN_LOCK_SECTION_TITLE", @"Title for the 'screen lock' section of the privacy settings."); - screenLockSection.footerTitle = NSLocalizedString( - @"SETTINGS_SCREEN_LOCK_SECTION_FOOTER", @"Footer for the 'screen lock' section of the privacy settings."); + screenLockSection.footerTitle = NSLocalizedString(@"Unlock Loki Messenger's screen using Touch ID, Face ID, or your iOS device passcode. You can still answer incoming calls and receive message notifications while Screen Lock is enabled. Loki Messenger's notification settings allow you to customize the information that is displayed.", @""); [screenLockSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_SCREEN_LOCK_SWITCH_LABEL", @@ -172,7 +174,7 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s OWSTableSection *screenSecuritySection = [OWSTableSection new]; screenSecuritySection.headerTitle = NSLocalizedString(@"SETTINGS_SECURITY_TITLE", @"Section header"); - screenSecuritySection.footerTitle = NSLocalizedString(@"SETTINGS_SCREEN_SECURITY_DETAIL", nil); + screenSecuritySection.footerTitle = NSLocalizedString(@"Prevent Loki Messenger previews from appearing in the app switcher.", nil); [screenSecuritySection addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_SCREEN_SECURITY", @"") accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"screen_security"] @@ -186,100 +188,103 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s selector:@selector(didToggleScreenSecuritySwitch:)]]; [contents addSection:screenSecuritySection]; - // Allow calls to connect directly vs. using TURN exclusively - OWSTableSection *callingSection = [OWSTableSection new]; - callingSection.headerTitle - = NSLocalizedString(@"SETTINGS_SECTION_TITLE_CALLING", @"settings topic header for table section"); - callingSection.footerTitle = NSLocalizedString(@"SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE_DETAIL", - @"User settings section footer, a detailed explanation"); - [callingSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString( - @"SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE", - @"Table cell label") - accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", - @"calling_hide_ip_address"] - isOnBlock:^{ - return [Environment.shared.preferences doCallsHideIPAddress]; - } - isEnabledBlock:^{ - return YES; - } - target:weakSelf - selector:@selector(didToggleCallsHideIPAddressSwitch:)]]; - [contents addSection:callingSection]; - - if (CallUIAdapter.isCallkitDisabledForLocale) { - // Hide all CallKit-related prefs; CallKit is disabled. - } else if (@available(iOS 11, *)) { - OWSTableSection *callKitSection = [OWSTableSection new]; - [callKitSection - addItem:[OWSTableItem switchItemWithText:NSLocalizedString( - @"SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_TITLE", - @"Short table cell label") - accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"callkit_history"] - isOnBlock:^{ - return [Environment.shared.preferences isSystemCallLogEnabled]; - } - isEnabledBlock:^{ - return YES; - } - target:weakSelf - selector:@selector(didToggleEnableSystemCallLogSwitch:)]]; - callKitSection.footerTitle = NSLocalizedString( - @"SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_DESCRIPTION", @"Settings table section footer."); - [contents addSection:callKitSection]; - } else if (@available(iOS 10, *)) { - OWSTableSection *callKitSection = [OWSTableSection new]; - callKitSection.footerTitle - = NSLocalizedString(@"SETTINGS_SECTION_CALL_KIT_DESCRIPTION", @"Settings table section footer."); - [callKitSection - addItem:[OWSTableItem switchItemWithText:NSLocalizedString( - @"SETTINGS_PRIVACY_CALLKIT_TITLE", @"Short table cell label") - accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"callkit"] - isOnBlock:^{ - return [Environment.shared.preferences isCallKitEnabled]; - } - isEnabledBlock:^{ - return YES; - } - target:weakSelf - selector:@selector(didToggleEnableCallKitSwitch:)]]; - if (self.preferences.isCallKitEnabled) { - [callKitSection - addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_CALLKIT_PRIVACY_TITLE", - @"Label for 'CallKit privacy' preference") - accessibilityIdentifier:[NSString - stringWithFormat:@"settings.privacy.%@", @"callkit_privacy"] - isOnBlock:^{ - return (BOOL) ![Environment.shared.preferences isCallKitPrivacyEnabled]; - } - isEnabledBlock:^{ - return YES; - } - target:weakSelf - selector:@selector(didToggleEnableCallKitPrivacySwitch:)]]; - } - [contents addSection:callKitSection]; - } - - OWSTableSection *twoFactorAuthSection = [OWSTableSection new]; - twoFactorAuthSection.headerTitle = NSLocalizedString( - @"SETTINGS_TWO_FACTOR_AUTH_TITLE", @"Title for the 'two factor auth' section of the privacy settings."); - [twoFactorAuthSection - addItem: - [OWSTableItem - disclosureItemWithText:NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_ITEM", - @"Label for the 'two factor auth' item of the privacy settings.") - detailText: - ([OWS2FAManager.sharedManager is2FAEnabled] - ? NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_ENABLED", - @"Indicates that 'two factor auth' is enabled in the privacy settings.") - : NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_DISABLED", - @"Indicates that 'two factor auth' is disabled in the privacy settings.")) - accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"2fa"] - actionBlock:^{ - [weakSelf show2FASettings]; - }]]; - [contents addSection:twoFactorAuthSection]; + // Loki: Original code + // ======== +// // Allow calls to connect directly vs. using TURN exclusively +// OWSTableSection *callingSection = [OWSTableSection new]; +// callingSection.headerTitle +// = NSLocalizedString(@"SETTINGS_SECTION_TITLE_CALLING", @"settings topic header for table section"); +// callingSection.footerTitle = NSLocalizedString(@"SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE_DETAIL", +// @"User settings section footer, a detailed explanation"); +// [callingSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString( +// @"SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE", +// @"Table cell label") +// accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", +// @"calling_hide_ip_address"] +// isOnBlock:^{ +// return [Environment.shared.preferences doCallsHideIPAddress]; +// } +// isEnabledBlock:^{ +// return YES; +// } +// target:weakSelf +// selector:@selector(didToggleCallsHideIPAddressSwitch:)]]; +// [contents addSection:callingSection]; +// +// if (CallUIAdapter.isCallkitDisabledForLocale) { +// // Hide all CallKit-related prefs; CallKit is disabled. +// } else if (@available(iOS 11, *)) { +// OWSTableSection *callKitSection = [OWSTableSection new]; +// [callKitSection +// addItem:[OWSTableItem switchItemWithText:NSLocalizedString( +// @"SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_TITLE", +// @"Short table cell label") +// accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"callkit_history"] +// isOnBlock:^{ +// return [Environment.shared.preferences isSystemCallLogEnabled]; +// } +// isEnabledBlock:^{ +// return YES; +// } +// target:weakSelf +// selector:@selector(didToggleEnableSystemCallLogSwitch:)]]; +// callKitSection.footerTitle = NSLocalizedString( +// @"SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_DESCRIPTION", @"Settings table section footer."); +// [contents addSection:callKitSection]; +// } else if (@available(iOS 10, *)) { +// OWSTableSection *callKitSection = [OWSTableSection new]; +// callKitSection.footerTitle +// = NSLocalizedString(@"SETTINGS_SECTION_CALL_KIT_DESCRIPTION", @"Settings table section footer."); +// [callKitSection +// addItem:[OWSTableItem switchItemWithText:NSLocalizedString( +// @"SETTINGS_PRIVACY_CALLKIT_TITLE", @"Short table cell label") +// accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"callkit"] +// isOnBlock:^{ +// return [Environment.shared.preferences isCallKitEnabled]; +// } +// isEnabledBlock:^{ +// return YES; +// } +// target:weakSelf +// selector:@selector(didToggleEnableCallKitSwitch:)]]; +// if (self.preferences.isCallKitEnabled) { +// [callKitSection +// addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_CALLKIT_PRIVACY_TITLE", +// @"Label for 'CallKit privacy' preference") +// accessibilityIdentifier:[NSString +// stringWithFormat:@"settings.privacy.%@", @"callkit_privacy"] +// isOnBlock:^{ +// return (BOOL) ![Environment.shared.preferences isCallKitPrivacyEnabled]; +// } +// isEnabledBlock:^{ +// return YES; +// } +// target:weakSelf +// selector:@selector(didToggleEnableCallKitPrivacySwitch:)]]; +// } +// [contents addSection:callKitSection]; +// } +// +// OWSTableSection *twoFactorAuthSection = [OWSTableSection new]; +// twoFactorAuthSection.headerTitle = NSLocalizedString( +// @"SETTINGS_TWO_FACTOR_AUTH_TITLE", @"Title for the 'two factor auth' section of the privacy settings."); +// [twoFactorAuthSection +// addItem: +// [OWSTableItem +// disclosureItemWithText:NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_ITEM", +// @"Label for the 'two factor auth' item of the privacy settings.") +// detailText: +// ([OWS2FAManager.sharedManager is2FAEnabled] +// ? NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_ENABLED", +// @"Indicates that 'two factor auth' is enabled in the privacy settings.") +// : NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_DISABLED", +// @"Indicates that 'two factor auth' is disabled in the privacy settings.")) +// accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"2fa"] +// actionBlock:^{ +// [weakSelf show2FASettings]; +// }]]; +// [contents addSection:twoFactorAuthSection]; +// ======== OWSTableSection *historyLogsSection = [OWSTableSection new]; historyLogsSection.headerTitle = NSLocalizedString(@"SETTINGS_HISTORYLOG_TITLE", @"Section header"); @@ -291,95 +296,98 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s }]]; [contents addSection:historyLogsSection]; - OWSTableSection *unidentifiedDeliveryIndicatorsSection = [OWSTableSection new]; - unidentifiedDeliveryIndicatorsSection.headerTitle - = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SECTION_TITLE", @"table section label"); - [unidentifiedDeliveryIndicatorsSection - addItem:[OWSTableItem - itemWithCustomCellBlock:^UITableViewCell * { - UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 - reuseIdentifier:@"UITableViewCellStyleValue1"]; - [OWSTableItem configureCell:cell]; - cell.preservesSuperviewLayoutMargins = YES; - cell.contentView.preservesSuperviewLayoutMargins = YES; - cell.selectionStyle = UITableViewCellSelectionStyleNone; - - UILabel *label = [UILabel new]; - label.text - = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SHOW_INDICATORS", @"switch label"); - label.font = [UIFont ows_regularFontWithSize:18.f]; - label.textColor = [Theme primaryColor]; - [label setContentHuggingHorizontalHigh]; - - UIImage *icon = [UIImage imageNamed:@"ic_secret_sender_indicator"]; - UIImageView *iconView = [[UIImageView alloc] - initWithImage:[icon imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]]; - iconView.tintColor = Theme.secondaryColor; - [iconView setContentHuggingHorizontalHigh]; - - UIView *spacer = [UIView new]; - [spacer setContentHuggingHorizontalLow]; - - UISwitch *cellSwitch = [UISwitch new]; - cell.accessoryView = cellSwitch; - [cellSwitch setOn:Environment.shared.preferences.shouldShowUnidentifiedDeliveryIndicators]; - [cellSwitch addTarget:weakSelf - action:@selector(didToggleUDShowIndicatorsSwitch:) - forControlEvents:UIControlEventValueChanged]; - [cellSwitch setContentHuggingHorizontalHigh]; - cellSwitch.accessibilityIdentifier = - [NSString stringWithFormat:@"settings.privacy.%@", @"sealed_sender"]; - - UIStackView *stackView = - [[UIStackView alloc] initWithArrangedSubviews:@[ label, iconView, spacer, cellSwitch ]]; - stackView.axis = UILayoutConstraintAxisHorizontal; - stackView.spacing = 10; - stackView.alignment = UIStackViewAlignmentCenter; - - [cell.contentView addSubview:stackView]; - [stackView ows_autoPinToSuperviewMargins]; - return cell; - } - customRowHeight:UITableViewAutomaticDimension - actionBlock:^{ - NSURL *url = [NSURL URLWithString:kSealedSenderInfoURL]; - OWSCAssertDebug(url); - [UIApplication.sharedApplication openURL:url]; - }]]; - - unidentifiedDeliveryIndicatorsSection.footerTitle - = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SHOW_INDICATORS_FOOTER", @"table section footer"); - [contents addSection:unidentifiedDeliveryIndicatorsSection]; - - OWSTableSection *unidentifiedDeliveryUnrestrictedSection = [OWSTableSection new]; - OWSTableItem *unrestrictedAccessItem = [OWSTableItem - switchItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS", @"switch label") - accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"sealed_sender_unrestricted"] - isOnBlock:^{ - return [SSKEnvironment.shared.udManager shouldAllowUnrestrictedAccessLocal]; - } - isEnabledBlock:^{ - return YES; - } - target:weakSelf - selector:@selector(didToggleUDUnrestrictedAccessSwitch:)]; - [unidentifiedDeliveryUnrestrictedSection addItem:unrestrictedAccessItem]; - unidentifiedDeliveryUnrestrictedSection.footerTitle - = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS_FOOTER", @"table section footer"); - [contents addSection:unidentifiedDeliveryUnrestrictedSection]; - - OWSTableSection *unidentifiedDeliveryLearnMoreSection = [OWSTableSection new]; - [unidentifiedDeliveryLearnMoreSection - addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_LEARN_MORE", - @"Label for a link to more info about unidentified delivery.") - accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", - @"sealed_sender_learn_more"] - actionBlock:^{ - NSURL *url = [NSURL URLWithString:kSealedSenderInfoURL]; - OWSCAssertDebug(url); - [UIApplication.sharedApplication openURL:url]; - }]]; - [contents addSection:unidentifiedDeliveryLearnMoreSection]; +// Loki: Original code +// ======== +// OWSTableSection *unidentifiedDeliveryIndicatorsSection = [OWSTableSection new]; +// unidentifiedDeliveryIndicatorsSection.headerTitle +// = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SECTION_TITLE", @"table section label"); +// [unidentifiedDeliveryIndicatorsSection +// addItem:[OWSTableItem +// itemWithCustomCellBlock:^UITableViewCell * { +// UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 +// reuseIdentifier:@"UITableViewCellStyleValue1"]; +// [OWSTableItem configureCell:cell]; +// cell.preservesSuperviewLayoutMargins = YES; +// cell.contentView.preservesSuperviewLayoutMargins = YES; +// cell.selectionStyle = UITableViewCellSelectionStyleNone; +// +// UILabel *label = [UILabel new]; +// label.text +// = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SHOW_INDICATORS", @"switch label"); +// label.font = [UIFont ows_regularFontWithSize:18.f]; +// label.textColor = [Theme primaryColor]; +// [label setContentHuggingHorizontalHigh]; +// +// UIImage *icon = [UIImage imageNamed:@"ic_secret_sender_indicator"]; +// UIImageView *iconView = [[UIImageView alloc] +// initWithImage:[icon imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]]; +// iconView.tintColor = Theme.secondaryColor; +// [iconView setContentHuggingHorizontalHigh]; +// +// UIView *spacer = [UIView new]; +// [spacer setContentHuggingHorizontalLow]; +// +// UISwitch *cellSwitch = [UISwitch new]; +// cell.accessoryView = cellSwitch; +// [cellSwitch setOn:Environment.shared.preferences.shouldShowUnidentifiedDeliveryIndicators]; +// [cellSwitch addTarget:weakSelf +// action:@selector(didToggleUDShowIndicatorsSwitch:) +// forControlEvents:UIControlEventValueChanged]; +// [cellSwitch setContentHuggingHorizontalHigh]; +// cellSwitch.accessibilityIdentifier = +// [NSString stringWithFormat:@"settings.privacy.%@", @"sealed_sender"]; +// +// UIStackView *stackView = +// [[UIStackView alloc] initWithArrangedSubviews:@[ label, iconView, spacer, cellSwitch ]]; +// stackView.axis = UILayoutConstraintAxisHorizontal; +// stackView.spacing = 10; +// stackView.alignment = UIStackViewAlignmentCenter; +// +// [cell.contentView addSubview:stackView]; +// [stackView ows_autoPinToSuperviewMargins]; +// return cell; +// } +// customRowHeight:UITableViewAutomaticDimension +// actionBlock:^{ +// NSURL *url = [NSURL URLWithString:kSealedSenderInfoURL]; +// OWSCAssertDebug(url); +// [UIApplication.sharedApplication openURL:url]; +// }]]; +// +// unidentifiedDeliveryIndicatorsSection.footerTitle +// = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SHOW_INDICATORS_FOOTER", @"table section footer"); +// [contents addSection:unidentifiedDeliveryIndicatorsSection]; +// +// OWSTableSection *unidentifiedDeliveryUnrestrictedSection = [OWSTableSection new]; +// OWSTableItem *unrestrictedAccessItem = [OWSTableItem +// switchItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS", @"switch label") +// accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"sealed_sender_unrestricted"] +// isOnBlock:^{ +// return [SSKEnvironment.shared.udManager shouldAllowUnrestrictedAccessLocal]; +// } +// isEnabledBlock:^{ +// return YES; +// } +// target:weakSelf +// selector:@selector(didToggleUDUnrestrictedAccessSwitch:)]; +// [unidentifiedDeliveryUnrestrictedSection addItem:unrestrictedAccessItem]; +// unidentifiedDeliveryUnrestrictedSection.footerTitle +// = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS_FOOTER", @"table section footer"); +// [contents addSection:unidentifiedDeliveryUnrestrictedSection]; +// +// OWSTableSection *unidentifiedDeliveryLearnMoreSection = [OWSTableSection new]; +// [unidentifiedDeliveryLearnMoreSection +// addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_LEARN_MORE", +// @"Label for a link to more info about unidentified delivery.") +// accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", +// @"sealed_sender_learn_more"] +// actionBlock:^{ +// NSURL *url = [NSURL URLWithString:kSealedSenderInfoURL]; +// OWSCAssertDebug(url); +// [UIApplication.sharedApplication openURL:url]; +// }]]; +// [contents addSection:unidentifiedDeliveryLearnMoreSection]; +// ======== OWSTableSection *linkPreviewsSection = [OWSTableSection new]; [linkPreviewsSection diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m b/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m index fbb12624b..48607b7d1 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputTextView.m @@ -37,6 +37,7 @@ NS_ASSUME_NONNULL_BEGIN self.font = [UIFont ows_dynamicTypeBodyFont]; self.textColor = Theme.primaryColor; self.textAlignment = NSTextAlignmentNatural; + self.tintColor = UIColor.lokiGreen; self.contentMode = UIViewContentModeRedraw; self.dataDetectorTypes = UIDataDetectorTypeNone; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m index d2da6ef54..622b7e262 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m @@ -120,7 +120,7 @@ const CGFloat kMaxTextViewHeight = 98; self.backgroundColor = Theme.toolbarBackgroundColor; } else { CGFloat alpha = OWSNavigationBar.backgroundBlurMutingFactor; - self.backgroundColor = [Theme.toolbarBackgroundColor colorWithAlphaComponent:alpha]; + self.backgroundColor = UIColor.lokiDarkerGray; UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:Theme.barBlurEffect]; blurEffectView.layer.zPosition = -1; @@ -157,7 +157,7 @@ const CGFloat kMaxTextViewHeight = 98; _sendButton = [UIButton buttonWithType:UIButtonTypeCustom]; [self.sendButton setTitle:MessageStrings.sendButton forState:UIControlStateNormal]; - [self.sendButton setTitleColor:UIColor.ows_signalBlueColor forState:UIControlStateNormal]; + [self.sendButton setTitleColor:UIColor.lokiGreen forState:UIControlStateNormal]; self.sendButton.titleLabel.textAlignment = NSTextAlignmentCenter; self.sendButton.titleLabel.font = [UIFont ows_mediumFontWithSize:17.f]; self.sendButton.contentEdgeInsets = UIEdgeInsetsMake(0, 4, 0, 4); @@ -220,7 +220,7 @@ const CGFloat kMaxTextViewHeight = 98; // H Stack _hStack = [[UIStackView alloc] - initWithArrangedSubviews:@[ self.attachmentButton, vStackWrapper, self.voiceMemoButton, self.sendButton ]]; + initWithArrangedSubviews:@[ /*self.attachmentButton,*/ vStackWrapper, /*self.voiceMemoButton,*/ self.sendButton ]]; self.hStack.axis = UILayoutConstraintAxisHorizontal; self.hStack.layoutMarginsRelativeArrangement = YES; self.hStack.layoutMargins = UIEdgeInsetsMake(6, 6, 6, 6); diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index a4b4e03e4..1868f83fc 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -1518,9 +1518,12 @@ typedef enum : NSUInteger { 0, round(image.size.width + imageEdgeInsets.left + imageEdgeInsets.right), round(image.size.height + imageEdgeInsets.top + imageEdgeInsets.bottom)); - [barButtons - addObject:[[UIBarButtonItem alloc] initWithCustomView:callButton - accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"call")]]; + // Loki: Original code + // ======== +// [barButtons +// addObject:[[UIBarButtonItem alloc] initWithCustomView:callButton +// accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"call")]]; + // ======== } if (self.disappearingMessagesConfiguration.isEnabled) { diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m b/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m index 8ebec14da..b5527d2d0 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m @@ -1256,10 +1256,7 @@ static const int kYapDatabaseRangeMaxLength = 25000; [interactionIds addObject:interaction.uniqueId]; } - OWSContactOffersInteraction *_Nullable offers = - [self tryToBuildContactOffersInteractionWithTransaction:transaction - loadedInteractions:interactions - canLoadMoreItems:canLoadMoreItems]; + OWSContactOffersInteraction *_Nullable offers = nil; if (offers && [interactionIds containsObject:offers.beforeInteractionId]) { id offersItem = tryToAddViewItem(offers, transaction); if ([offersItem.interaction isKindOfClass:[OWSContactOffersInteraction class]]) { diff --git a/Signal/src/ViewControllers/HomeView/HomeViewCell.m b/Signal/src/ViewControllers/HomeView/HomeViewCell.m index ff96a11ad..99e67e6da 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewCell.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewCell.m @@ -536,7 +536,7 @@ NS_ASSUME_NONNULL_BEGIN if (hasCheckmark) { NSMutableAttributedString *checkmark = [[NSMutableAttributedString alloc] initWithString:@"✓"]; [checkmark beginEditing]; - [checkmark addAttribute:NSForegroundColorAttributeName value:UIColor.ows_greenColor range:NSMakeRange(0, 1)]; + [checkmark addAttribute:NSForegroundColorAttributeName value:UIColor.lokiGreen range:NSMakeRange(0, 1)]; [checkmark endEditing]; NSMutableAttributedString *mutableName = [name mutableCopy]; [mutableName appendAttributedString:[[NSAttributedString alloc] initWithString:@" "]]; diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index 6f8a794a9..59b588d25 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -619,7 +619,7 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) { switch (self.homeViewMode) { case HomeViewMode_Inbox: // TODO: Should our app name be translated? Probably not. - self.title = NSLocalizedString(@"Signal", @"Title for the home view's default mode."); + self.title = NSLocalizedString(@"Loki Messenger", @""); break; case HomeViewMode_Archive: self.title = NSLocalizedString(@"HOME_VIEW_TITLE_ARCHIVE", @"Title for the home view's 'archive' mode."); diff --git a/Signal/src/ViewControllers/NewContactThreadViewController.m b/Signal/src/ViewControllers/NewContactThreadViewController.m index 6ddac4f8a..9fdb22e2b 100644 --- a/Signal/src/ViewControllers/NewContactThreadViewController.m +++ b/Signal/src/ViewControllers/NewContactThreadViewController.m @@ -127,7 +127,7 @@ NS_ASSUME_NONNULL_BEGIN UISearchBar *searchBar = [OWSSearchBar new]; _searchBar = searchBar; searchBar.delegate = self; - searchBar.placeholder = NSLocalizedString(@"Search by name or public key", @""); + searchBar.placeholder = NSLocalizedString(@"Search by public key", @""); searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone; [searchBar sizeToFit]; SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, searchBar); @@ -479,11 +479,16 @@ NS_ASSUME_NONNULL_BEGIN // ======== if (self.contactsViewHelper.hasUpdatedContactsAtLeastOnce) { + /** + * Loki: Original code + * ======== [contactsSection addItem:[OWSTableItem softCenterLabelItemWithText: NSLocalizedString(@"SETTINGS_BLOCK_LIST_NO_CONTACTS", @"A label that indicates the user has no Signal contacts.") customRowHeight:UITableViewAutomaticDimension]]; + * ======== + */ } else { UITableViewCell *loadingCell = [OWSTableItem newCell]; OWSAssertDebug(loadingCell.contentView); @@ -736,12 +741,9 @@ NS_ASSUME_NONNULL_BEGIN [sections addObject:inviteeSection]; } - // Loki: - // ======== - NSString *publicKey = self.searchBar.text; - BOOL isValidPublicKey = [ECKeyPair isValidHexEncodedPublicKeyWithCandidate:publicKey]; - // ======== - + /** + * Loki: Original code + * ======== if (isValidPublicKey && !hasSearchResults) { // No Search Results OWSTableSection *noResultsSection = [OWSTableSection new]; @@ -753,6 +755,8 @@ NS_ASSUME_NONNULL_BEGIN [sections addObject:noResultsSection]; } + * ======== + */ return [sections copy]; } @@ -812,17 +816,17 @@ NS_ASSUME_NONNULL_BEGIN return; } - _isNoContactsModeActive = isNoContactsModeActive; + _isNoContactsModeActive = NO; - if (isNoContactsModeActive) { - self.tableViewController.tableView.hidden = YES; - self.searchBar.hidden = YES; - self.noSignalContactsView.hidden = NO; - } else { +// if (isNoContactsModeActive) { +// self.tableViewController.tableView.hidden = YES; +// self.searchBar.hidden = YES; +// self.noSignalContactsView.hidden = NO; +// } else { self.tableViewController.tableView.hidden = NO; self.searchBar.hidden = NO; self.noSignalContactsView.hidden = YES; - } +// } [self updateTableContents]; } diff --git a/Signal/src/ViewControllers/ProfileViewController.m b/Signal/src/ViewControllers/ProfileViewController.m index 6b4f3dc79..5c6195988 100644 --- a/Signal/src/ViewControllers/ProfileViewController.m +++ b/Signal/src/ViewControllers/ProfileViewController.m @@ -95,7 +95,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat - (void)createViews { - self.view.backgroundColor = Theme.offBackgroundColor; + self.view.backgroundColor = Theme.backgroundColor; UIView *contentView = [UIView containerView]; contentView.backgroundColor = Theme.backgroundColor; @@ -116,8 +116,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat [rows addObject:nameRow]; UILabel *nameLabel = [UILabel new]; - nameLabel.text = NSLocalizedString( - @"PROFILE_VIEW_PROFILE_NAME_FIELD", @"Label for the profile name field of the profile view."); + nameLabel.text = NSLocalizedString(@"Display Name", @""); nameLabel.textColor = Theme.primaryColor; nameLabel.font = [UIFont ows_mediumFontWithSize:fontSizePoints]; [nameRow addSubview:nameLabel]; @@ -187,39 +186,42 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat // Information - UIView *infoRow = [UIView containerView]; - infoRow.userInteractionEnabled = YES; - [infoRow - addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(infoRowTapped:)]]; - infoRow.accessibilityIdentifier = ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"infoRow"); - [rows addObject:infoRow]; - - UILabel *infoLabel = [UILabel new]; - infoLabel.textColor = Theme.secondaryColor; - infoLabel.font = [UIFont ows_regularFontWithSize:11.f]; - infoLabel.textAlignment = NSTextAlignmentCenter; - NSMutableAttributedString *text = [NSMutableAttributedString new]; - [text appendAttributedString:[[NSAttributedString alloc] - initWithString:NSLocalizedString(@"PROFILE_VIEW_PROFILE_DESCRIPTION", - @"Description of the user profile.") - attributes:@{}]]; - [text appendAttributedString:[[NSAttributedString alloc] initWithString:@" " attributes:@{}]]; - [text appendAttributedString:[[NSAttributedString alloc] - initWithString:NSLocalizedString(@"PROFILE_VIEW_PROFILE_DESCRIPTION_LINK", - @"Link to more information about the user profile.") - attributes:@{ - NSUnderlineStyleAttributeName : - @(NSUnderlineStyleSingle | NSUnderlinePatternSolid), - NSForegroundColorAttributeName : [UIColor ows_materialBlueColor], - }]]; - infoLabel.attributedText = text; - infoLabel.numberOfLines = 0; - infoLabel.lineBreakMode = NSLineBreakByWordWrapping; - [infoRow addSubview:infoLabel]; - [infoLabel autoPinLeadingToSuperviewMargin]; - [infoLabel autoPinTrailingToSuperviewMargin]; - [infoLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:10.f]; - [infoLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:10.f]; +// Loki: Original code +// ======== +// UIView *infoRow = [UIView containerView]; +// infoRow.userInteractionEnabled = YES; +// [infoRow +// addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(infoRowTapped:)]]; +// infoRow.accessibilityIdentifier = ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"infoRow"); +// [rows addObject:infoRow]; +// +// UILabel *infoLabel = [UILabel new]; +// infoLabel.textColor = Theme.secondaryColor; +// infoLabel.font = [UIFont ows_regularFontWithSize:11.f]; +// infoLabel.textAlignment = NSTextAlignmentCenter; +// NSMutableAttributedString *text = [NSMutableAttributedString new]; +// [text appendAttributedString:[[NSAttributedString alloc] +// initWithString:NSLocalizedString(@"PROFILE_VIEW_PROFILE_DESCRIPTION", +// @"Description of the user profile.") +// attributes:@{}]]; +// [text appendAttributedString:[[NSAttributedString alloc] initWithString:@" " attributes:@{}]]; +// [text appendAttributedString:[[NSAttributedString alloc] +// initWithString:NSLocalizedString(@"PROFILE_VIEW_PROFILE_DESCRIPTION_LINK", +// @"Link to more information about the user profile.") +// attributes:@{ +// NSUnderlineStyleAttributeName : +// @(NSUnderlineStyleSingle | NSUnderlinePatternSolid), +// NSForegroundColorAttributeName : [UIColor ows_materialBlueColor], +// }]]; +// infoLabel.attributedText = text; +// infoLabel.numberOfLines = 0; +// infoLabel.lineBreakMode = NSLineBreakByWordWrapping; +// [infoRow addSubview:infoLabel]; +// [infoLabel autoPinLeadingToSuperviewMargin]; +// [infoLabel autoPinTrailingToSuperviewMargin]; +// [infoLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:10.f]; +// [infoLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:10.f]; +// ======== // Big Button diff --git a/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m b/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m index 7b666cb00..f80b9a945 100644 --- a/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m +++ b/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m @@ -324,6 +324,9 @@ const CGFloat kIconViewLength = 24; mainSection.customHeaderView = [self mainSectionHeader]; mainSection.customHeaderHeight = @(100.f); + /** + * Loki: Original code + * ======== if ([self.thread isKindOfClass:[TSContactThread class]] && self.contactsManager.supportsContactEditing && !self.hasExistingContact) { [mainSection @@ -455,6 +458,8 @@ const CGFloat kIconViewLength = 24; [weakSelf showShareProfileAlert]; }]]; } + * ======= + */ [mainSection addItem:[OWSTableItem itemWithCustomCellBlock:^{ @@ -770,6 +775,9 @@ const CGFloat kIconViewLength = 24; } // Block Conversation section. + /** + * Loki: Original code + * ======== if (!isNoteToSelf) { OWSTableSection *section = [OWSTableSection new]; if (self.thread.isGroupThread) { @@ -816,6 +824,8 @@ const CGFloat kIconViewLength = 24; actionBlock:nil]]; [contents addSection:section]; } + * ======== + */ self.contents = contents; } diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 5ade5fcb4..2b4ebae94 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -2564,7 +2564,7 @@ "You seem to be missing the last word of your mnemonic. Please check what you entered and try again." = "You seem to be missing the last word of your mnemonic. Please check what you entered and try again."; "There appears to be an invalid word in your mnemonic. Please check what you entered and try again." = "There appears to be an invalid word in your mnemonic. Please check what you entered and try again."; "Your mnemonic couldn't be verified. Please check what you entered and try again." = "Your mnemonic couldn't be verified. Please check what you entered and try again."; -"Search by name or public key" = "Search by name or public key"; +"Search by public key" = "Search by public key"; "Start a Conversation" = "Start a Conversation"; "Invalid public key" = "Invalid public key"; "No search results" = "No search results"; @@ -2587,3 +2587,7 @@ "Your friend request to %@ has expired" = "Your friend request to %@ has expired"; "Show Seed" = "Show Seed"; "Your Seed" = "Your Seed"; +"Unlock Loki Messenger's screen using Touch ID, Face ID, or your iOS device passcode. You can still answer incoming calls and receive message notifications while Screen Lock is enabled. Loki Messenger's notification settings allow you to customize the information that is displayed." = "Unlock Loki Messenger's screen using Touch ID, Face ID, or your iOS device passcode. You can still answer incoming calls and receive message notifications while Screen Lock is enabled. Loki Messenger's notification settings allow you to customize the information that is displayed."; +"Prevent Loki Messenger previews from appearing in the app switcher." = "Prevent Loki Messenger previews from appearing in the app switcher."; +"Display Name" = "Display Name"; +"Loki Messenger" = "Loki Messenger"; diff --git a/SignalMessaging/ViewControllers/SelectThreadViewController.m b/SignalMessaging/ViewControllers/SelectThreadViewController.m index bf8e5d5f9..90c0f4551 100644 --- a/SignalMessaging/ViewControllers/SelectThreadViewController.m +++ b/SignalMessaging/ViewControllers/SelectThreadViewController.m @@ -90,7 +90,7 @@ NS_ASSUME_NONNULL_BEGIN UISearchBar *searchBar = [OWSSearchBar new]; _searchBar = searchBar; searchBar.delegate = self; - searchBar.placeholder = NSLocalizedString(@"Search by name or public key", @""); + searchBar.placeholder = NSLocalizedString(@"Search by public key", @""); [searchBar sizeToFit]; UIView *header = [self.selectThreadViewDelegate createHeaderWithSearchBar:searchBar]; diff --git a/SignalMessaging/Views/AvatarImageView.swift b/SignalMessaging/Views/AvatarImageView.swift index e7187afe3..68f2f3109 100644 --- a/SignalMessaging/Views/AvatarImageView.swift +++ b/SignalMessaging/Views/AvatarImageView.swift @@ -31,7 +31,7 @@ public class AvatarImageView: UIImageView { func initialize() { // Loki: Used to indicate a contact's online status - layer.borderWidth = 3 + layer.borderWidth = 4 // Loki: Observe online status changes NotificationCenter.default.addObserver(self, selector: #selector(handleContactOnlineStatusChangedNotification), name: .contactOnlineStatusChanged, object: nil) @@ -87,7 +87,7 @@ public class AvatarImageView: UIImageView { @objc func updateOnlineStatusIndicator() { let peerInfo = LokiP2PAPI.getInfo(for: contactID) let isOnline = peerInfo?.isOnline ?? false - let color: UIColor = isOnline ? .ows_green : .ows_gray75 + let color: UIColor = isOnline ? .lokiGreen() : .lokiDarkGray() let currentUserID = OWSIdentityManager.shared().identityKeyPair()!.hexEncodedPublicKey let isCurrentUser = (contactID == currentUserID) layer.borderColor = isCurrentUser ? UIColor.clear.cgColor : color.cgColor diff --git a/SignalMessaging/Views/OWSNavigationBar.swift b/SignalMessaging/Views/OWSNavigationBar.swift index ac2eaa3aa..f855ccfa1 100644 --- a/SignalMessaging/Views/OWSNavigationBar.swift +++ b/SignalMessaging/Views/OWSNavigationBar.swift @@ -83,7 +83,7 @@ public class OWSNavigationBar: UINavigationBar { } else { // Make navbar more translucent than default. Navbars remove alpha from any assigned backgroundColor, so // to achieve transparency, we have to assign a transparent image. - let color = Theme.navbarBackgroundColor.withAlphaComponent(OWSNavigationBar.backgroundBlurMutingFactor) + let color = Theme.navbarBackgroundColor let backgroundImage = UIImage(color: color) self.setBackgroundImage(backgroundImage, for: .default) diff --git a/SignalMessaging/Views/OWSSearchBar.m b/SignalMessaging/Views/OWSSearchBar.m index 2d00089af..a24794d79 100644 --- a/SignalMessaging/Views/OWSSearchBar.m +++ b/SignalMessaging/Views/OWSSearchBar.m @@ -65,6 +65,7 @@ NS_ASSUME_NONNULL_BEGIN UIColor *foregroundColor = Theme.placeholderColor; searchBar.barTintColor = Theme.backgroundColor; searchBar.barStyle = Theme.barStyle; + searchBar.tintColor = UIColor.lokiGreen; // Hide searchBar border. // Alternatively we could hide the border by using `UISearchBarStyleMinimal`, but that causes an issue when toggling diff --git a/SignalMessaging/appearance/Theme.m b/SignalMessaging/appearance/Theme.m index 24c3bd54b..0351f9c11 100644 --- a/SignalMessaging/appearance/Theme.m +++ b/SignalMessaging/appearance/Theme.m @@ -38,7 +38,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled"; + (BOOL)isDarkThemeEnabled { - return [self.sharedInstance isDarkThemeEnabled]; + return YES; } - (BOOL)isDarkThemeEnabled @@ -83,18 +83,17 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled"; + (UIColor *)backgroundColor { - return (Theme.isDarkThemeEnabled ? Theme.darkThemeBackgroundColor : UIColor.ows_whiteColor); + return UIColor.lokiDarkestGray; } + (UIColor *)offBackgroundColor { - return ( - Theme.isDarkThemeEnabled ? [UIColor colorWithWhite:0.2f alpha:1.f] : [UIColor colorWithWhite:0.94f alpha:1.f]); + return UIColor.lokiDarkGray; } + (UIColor *)primaryColor { - return (Theme.isDarkThemeEnabled ? Theme.darkThemePrimaryColor : UIColor.ows_gray90Color); + return UIColor.whiteColor; } + (UIColor *)secondaryColor @@ -114,19 +113,19 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled"; + (UIColor *)placeholderColor { - return (Theme.isDarkThemeEnabled ? UIColor.ows_gray45Color : UIColor.ows_gray45Color); + return UIColor.lokiLightGray; } + (UIColor *)hairlineColor { - return (Theme.isDarkThemeEnabled ? UIColor.ows_gray75Color : UIColor.ows_gray25Color); + return UIColor.lokiDarkGray; } #pragma mark - Global App Colors + (UIColor *)navbarBackgroundColor { - return (Theme.isDarkThemeEnabled ? self.darkThemeNavbarBackgroundColor : UIColor.ows_whiteColor); + return UIColor.lokiDarkestGray; } + (UIColor *)darkThemeNavbarBackgroundColor @@ -136,7 +135,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled"; + (UIColor *)navbarIconColor { - return (Theme.isDarkThemeEnabled ? self.darkThemeNavbarIconColor : UIColor.ows_gray60Color); + return UIColor.lokiGreen; } + (UIColor *)darkThemeNavbarIconColor; @@ -156,7 +155,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled"; + (UIColor *)cellSelectedColor { - return (Theme.isDarkThemeEnabled ? [UIColor colorWithWhite:0.2 alpha:1] : [UIColor colorWithWhite:0.92 alpha:1]); + return UIColor.lokiDarkGray; } + (UIColor *)cellSeparatorColor diff --git a/SignalMessaging/categories/UIColor+OWS.h b/SignalMessaging/categories/UIColor+OWS.h index 7aece5c18..1ff9bc37e 100644 --- a/SignalMessaging/categories/UIColor+OWS.h +++ b/SignalMessaging/categories/UIColor+OWS.h @@ -51,6 +51,15 @@ NS_ASSUME_NONNULL_BEGIN // TODO: Remove @property (class, readonly, nonatomic) UIColor *ows_darkSkyBlueColor; +#pragma mark - Loki + ++ (UIColor *)lokiGreen; ++ (UIColor *)lokiDarkGreen; ++ (UIColor *)lokiDarkestGray; ++ (UIColor *)lokiDarkerGray; ++ (UIColor *)lokiDarkGray; ++ (UIColor *)lokiLightGray; + @end NS_ASSUME_NONNULL_END diff --git a/SignalMessaging/categories/UIColor+OWS.m b/SignalMessaging/categories/UIColor+OWS.m index 8dadbc795..971a47dd5 100644 --- a/SignalMessaging/categories/UIColor+OWS.m +++ b/SignalMessaging/categories/UIColor+OWS.m @@ -14,28 +14,27 @@ NS_ASSUME_NONNULL_BEGIN + (UIColor *)ows_signalBrandBlueColor { - return [UIColor colorWithRed:0.1135657504f green:0.4787300229f blue:0.89595204589999999f alpha:1.]; + return UIColor.lokiGreen; } + (UIColor *)ows_materialBlueColor { - // blue: #2090EA - return [UIColor colorWithRed:32.f / 255.f green:144.f / 255.f blue:234.f / 255.f alpha:1.f]; + return UIColor.lokiGreen; } + (UIColor *)ows_darkIconColor { - return [UIColor colorWithRGBHex:0x505050]; + return UIColor.lokiGreen; } + (UIColor *)ows_darkGrayColor { - return [UIColor colorWithRed:81.f / 255.f green:81.f / 255.f blue:81.f / 255.f alpha:1.f]; + return UIColor.lokiDarkGray; } + (UIColor *)ows_darkThemeBackgroundColor { - return [UIColor colorWithRed:35.f / 255.f green:31.f / 255.f blue:32.f / 255.f alpha:1.f]; + return UIColor.lokiDarkestGray; } + (UIColor *)ows_fadedBlueColor @@ -202,6 +201,15 @@ NS_ASSUME_NONNULL_BEGIN return [UIColor colorWithRed:32.f / 255.f green:144.f / 255.f blue:234.f / 255.f alpha:1.f]; } +#pragma mark - Loki + ++ (UIColor *)lokiGreen { return [UIColor colorWithRGBHex:0x5BCA5B]; } ++ (UIColor *)lokiDarkGreen { return [UIColor colorWithRGBHex:0x419B41]; } ++ (UIColor *)lokiDarkestGray { return [UIColor colorWithRGBHex:0x0A0A0A]; } ++ (UIColor *)lokiDarkerGray { return [UIColor colorWithRGBHex:0x252525]; } ++ (UIColor *)lokiDarkGray { return [UIColor colorWithRGBHex:0x313131]; } ++ (UIColor *)lokiLightGray { return [UIColor colorWithRGBHex:0x414141]; } + @end NS_ASSUME_NONNULL_END diff --git a/SignalMessaging/utils/ConversationStyle.swift b/SignalMessaging/utils/ConversationStyle.swift index 28df78303..3009c21d7 100644 --- a/SignalMessaging/utils/ConversationStyle.swift +++ b/SignalMessaging/utils/ConversationStyle.swift @@ -142,17 +142,17 @@ public class ConversationStyle: NSObject { @objc private static var defaultBubbleColorIncoming: UIColor { - return Theme.isDarkThemeEnabled ? UIColor.ows_gray75 : UIColor.ows_messageBubbleLightGray + return UIColor.lokiDarkGray() } @objc - public let bubbleColorOutgoingFailed = UIColor.ows_darkSkyBlue + public let bubbleColorOutgoingFailed = UIColor.lokiGreen() @objc - public let bubbleColorOutgoingSending = UIColor.ows_darkSkyBlue + public let bubbleColorOutgoingSending = UIColor.lokiGreen() @objc - public let bubbleColorOutgoingSent = UIColor.ows_darkSkyBlue + public let bubbleColorOutgoingSent = UIColor.lokiGreen() @objc public let dateBreakTextColor = UIColor.ows_gray60