Add basic styling

pull/33/head
Niels Andriesse 6 years ago
parent 2e30c5b9b5
commit 1bf0d44246

@ -6,8 +6,12 @@ final class OnboardingAccountDetailsViewController : OnboardingBaseViewControlle
result.textColor = Theme.primaryColor result.textColor = Theme.primaryColor
result.font = UIFont.ows_dynamicTypeBodyClamped result.font = UIFont.ows_dynamicTypeBodyClamped
result.textAlignment = .center 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.accessibilityIdentifier = "onboarding.accountDetailsStep.userNameTextField"
result.keyboardAppearance = .dark
return result return result
}() }()

@ -36,12 +36,14 @@ final class OnboardingKeyPairViewController : OnboardingBaseViewController {
private lazy var copyButton: OWSFlatButton = { private lazy var copyButton: OWSFlatButton = {
let result = createLinkButton(title: NSLocalizedString("Copy", comment: ""), selector: #selector(copyMnemonic)) let result = createLinkButton(title: NSLocalizedString("Copy", comment: ""), selector: #selector(copyMnemonic))
result.accessibilityIdentifier = "onboarding.keyPairStep.copyButton" result.accessibilityIdentifier = "onboarding.keyPairStep.copyButton"
result.setBackgroundColors(upColor: .clear, downColor: .clear)
return result return result
}() }()
private lazy var restoreButton: OWSFlatButton = { private lazy var restoreButton: OWSFlatButton = {
let result = createLinkButton(title: NSLocalizedString("Restore Using Mnemonic", comment: ""), selector: #selector(switchMode)) let result = createLinkButton(title: NSLocalizedString("Restore Using Mnemonic", comment: ""), selector: #selector(switchMode))
result.accessibilityIdentifier = "onboarding.keyPairStep.restoreButton" result.accessibilityIdentifier = "onboarding.keyPairStep.restoreButton"
result.setBackgroundColors(upColor: .clear, downColor: .clear)
return result return result
}() }()
@ -64,15 +66,22 @@ final class OnboardingKeyPairViewController : OnboardingBaseViewController {
private lazy var mnemonicTextField: UITextField = { private lazy var mnemonicTextField: UITextField = {
let result = UITextField(frame: CGRect.zero) let result = UITextField(frame: CGRect.zero)
result.accessibilityIdentifier = "onboarding.keyPairStep.mnemonicTextField" result.textColor = Theme.primaryColor
result.font = UIFont.ows_dynamicTypeBodyClamped
result.textAlignment = .center 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 return result
}() }()
private lazy var registerButton: OWSFlatButton = { private lazy var registerButton: OWSFlatButton = {
let result = createLinkButton(title: NSLocalizedString("Register a New Account", comment: ""), selector: #selector(switchMode)) let result = createLinkButton(title: NSLocalizedString("Register a New Account", comment: ""), selector: #selector(switchMode))
result.accessibilityIdentifier = "onboarding.keyPairStep.registerButton" result.accessibilityIdentifier = "onboarding.keyPairStep.registerButton"
result.setBackgroundColors(upColor: .clear, downColor: .clear)
return result return result
}() }()
@ -147,6 +156,7 @@ final class OnboardingKeyPairViewController : OnboardingBaseViewController {
UIView.transition(with: registerOrRestoreButton, duration: 0.25, options: .transitionCrossDissolve, animations: { UIView.transition(with: registerOrRestoreButton, duration: 0.25, options: .transitionCrossDissolve, animations: {
self.registerOrRestoreButton.setTitle(registerOrRestoreButtonTitle) self.registerOrRestoreButton.setTitle(registerOrRestoreButtonTitle)
}, completion: nil) }, completion: nil)
if mode == .register { mnemonicTextField.resignFirstResponder() }
} }
private func updateKeyPair() { private func updateKeyPair() {

@ -84,7 +84,7 @@
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop
target:self target:self
action:@selector(dismissWasPressed:)]; action:@selector(dismissWasPressed:)];
[self updateRightBarButtonForTheme]; // [self updateRightBarButtonForTheme];
[self observeNotifications]; [self observeNotifications];
self.title = NSLocalizedString(@"SETTINGS_NAV_BAR_TITLE", @"Title for settings activity"); self.title = NSLocalizedString(@"SETTINGS_NAV_BAR_TITLE", @"Title for settings activity");
@ -174,12 +174,15 @@
// ======== // ========
} }
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_INVITE_TITLE", // Loki: Original code
@"Settings table view cell label") // ========
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"invite") // [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_INVITE_TITLE",
actionBlock:^{ // @"Settings table view cell label")
[weakSelf showInviteFlow]; // accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"invite")
}]]; // actionBlock:^{
// [weakSelf showInviteFlow];
// }]];
// ========
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_TITLE", [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_TITLE",
@"Settings table view cell label") @"Settings table view cell label")
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"privacy") accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"privacy")
@ -191,17 +194,20 @@
actionBlock:^{ actionBlock:^{
[weakSelf showNotifications]; [weakSelf showNotifications];
}]]; }]];
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"LINKED_DEVICES_TITLE", // Loki: Original code
@"Menu item and navbar title for the device manager") // ========
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"linked_devices") // [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"LINKED_DEVICES_TITLE",
actionBlock:^{ // @"Menu item and navbar title for the device manager")
[weakSelf showLinkedDevices]; // accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"linked_devices")
}]]; // actionBlock:^{
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_TITLE", @"") // [weakSelf showLinkedDevices];
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"advanced") // }]];
actionBlock:^{ // [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_TITLE", @"")
[weakSelf showAdvanced]; // accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"advanced")
}]]; // actionBlock:^{
// [weakSelf showAdvanced];
// }]];
// ========
BOOL isBackupEnabled = [OWSBackup.sharedManager isBackupEnabled]; BOOL isBackupEnabled = [OWSBackup.sharedManager isBackupEnabled];
BOOL showBackup = (OWSBackup.isFeatureEnabled && isBackupEnabled); BOOL showBackup = (OWSBackup.isFeatureEnabled && isBackupEnabled);
if (showBackup) { if (showBackup) {
@ -212,18 +218,24 @@
[weakSelf showBackup]; [weakSelf showBackup];
}]]; }]];
} }
[section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_ABOUT", @"") // Loki: Original code
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"about") // ========
actionBlock:^{ // [section addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_ABOUT", @"")
[weakSelf showAbout]; // accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"about")
}]]; // actionBlock:^{
// [weakSelf showAbout];
// }]];
// ========
#ifdef USE_DEBUG_UI #ifdef USE_DEBUG_UI
[section addItem:[OWSTableItem disclosureItemWithText:@"Debug UI" // Loki: Original code
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"debugui") // ========
actionBlock:^{ // [section addItem:[OWSTableItem disclosureItemWithText:@"Debug UI"
[weakSelf showDebugUI]; // accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"debugui")
}]]; // actionBlock:^{
// [weakSelf showDebugUI];
// }]];
// ========
#endif #endif
[section [section

@ -25,7 +25,7 @@
__weak NotificationSettingsOptionsViewController *weakSelf = self; __weak NotificationSettingsOptionsViewController *weakSelf = self;
OWSTableSection *section = [OWSTableSection new]; OWSTableSection *section = [OWSTableSection new];
section.footerTitle = NSLocalizedString(@"NOTIFICATIONS_FOOTER_WARNING", nil); // section.footerTitle = NSLocalizedString(@"NOTIFICATIONS_FOOTER_WARNING", nil);
OWSPreferences *prefs = Environment.shared.preferences; OWSPreferences *prefs = Environment.shared.preferences;
NotificationType selectedNotifType = [prefs notificationPreviewType]; NotificationType selectedNotifType = [prefs notificationPreviewType];

@ -82,36 +82,39 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
__weak PrivacySettingsTableViewController *weakSelf = self; __weak PrivacySettingsTableViewController *weakSelf = self;
OWSTableSection *blocklistSection = [OWSTableSection new]; // Loki: Original code
blocklistSection.headerTitle // ========
= NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", @"Label for the block list section of the settings view"); // OWSTableSection *blocklistSection = [OWSTableSection new];
[blocklistSection // blocklistSection.headerTitle
addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", // = NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", @"Label for the block list section of the settings view");
@"Label for the block list section of the settings view") // [blocklistSection
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"blocklist"] // addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE",
actionBlock:^{ // @"Label for the block list section of the settings view")
[weakSelf showBlocklist]; // accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"blocklist"]
}]]; // actionBlock:^{
[contents addSection:blocklistSection]; // [weakSelf showBlocklist];
// }]];
OWSTableSection *readReceiptsSection = [OWSTableSection new]; // [contents addSection:blocklistSection];
readReceiptsSection.headerTitle //
= NSLocalizedString(@"SETTINGS_READ_RECEIPT", @"Label for the 'read receipts' setting."); // OWSTableSection *readReceiptsSection = [OWSTableSection new];
readReceiptsSection.footerTitle = NSLocalizedString( // readReceiptsSection.headerTitle
@"SETTINGS_READ_RECEIPTS_SECTION_FOOTER", @"An explanation of the 'read receipts' setting."); // = NSLocalizedString(@"SETTINGS_READ_RECEIPT", @"Label for the 'read receipts' setting.");
[readReceiptsSection // readReceiptsSection.footerTitle = NSLocalizedString(
addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_READ_RECEIPT", // @"SETTINGS_READ_RECEIPTS_SECTION_FOOTER", @"An explanation of the 'read receipts' setting.");
@"Label for the 'read receipts' setting.") // [readReceiptsSection
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"read_receipts"] // addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_READ_RECEIPT",
isOnBlock:^{ // @"Label for the 'read receipts' setting.")
return [OWSReadReceiptManager.sharedManager areReadReceiptsEnabled]; // accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"read_receipts"]
} // isOnBlock:^{
isEnabledBlock:^{ // return [OWSReadReceiptManager.sharedManager areReadReceiptsEnabled];
return YES; // }
} // isEnabledBlock:^{
target:weakSelf // return YES;
selector:@selector(didToggleReadReceiptsSwitch:)]]; // }
[contents addSection:readReceiptsSection]; // target:weakSelf
// selector:@selector(didToggleReadReceiptsSwitch:)]];
// [contents addSection:readReceiptsSection];
// ========
OWSTableSection *typingIndicatorsSection = [OWSTableSection new]; OWSTableSection *typingIndicatorsSection = [OWSTableSection new];
typingIndicatorsSection.headerTitle typingIndicatorsSection.headerTitle
@ -135,8 +138,7 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
OWSTableSection *screenLockSection = [OWSTableSection new]; OWSTableSection *screenLockSection = [OWSTableSection new];
screenLockSection.headerTitle = NSLocalizedString( screenLockSection.headerTitle = NSLocalizedString(
@"SETTINGS_SCREEN_LOCK_SECTION_TITLE", @"Title for the 'screen lock' section of the privacy settings."); @"SETTINGS_SCREEN_LOCK_SECTION_TITLE", @"Title for the 'screen lock' section of the privacy settings.");
screenLockSection.footerTitle = NSLocalizedString( 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.", @"");
@"SETTINGS_SCREEN_LOCK_SECTION_FOOTER", @"Footer for the 'screen lock' section of the privacy settings.");
[screenLockSection [screenLockSection
addItem:[OWSTableItem addItem:[OWSTableItem
switchItemWithText:NSLocalizedString(@"SETTINGS_SCREEN_LOCK_SWITCH_LABEL", 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]; OWSTableSection *screenSecuritySection = [OWSTableSection new];
screenSecuritySection.headerTitle = NSLocalizedString(@"SETTINGS_SECURITY_TITLE", @"Section header"); 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 [screenSecuritySection
addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_SCREEN_SECURITY", @"") addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_SCREEN_SECURITY", @"")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"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:)]]; selector:@selector(didToggleScreenSecuritySwitch:)]];
[contents addSection:screenSecuritySection]; [contents addSection:screenSecuritySection];
// Allow calls to connect directly vs. using TURN exclusively // Loki: Original code
OWSTableSection *callingSection = [OWSTableSection new]; // ========
callingSection.headerTitle // // Allow calls to connect directly vs. using TURN exclusively
= NSLocalizedString(@"SETTINGS_SECTION_TITLE_CALLING", @"settings topic header for table section"); // OWSTableSection *callingSection = [OWSTableSection new];
callingSection.footerTitle = NSLocalizedString(@"SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE_DETAIL", // callingSection.headerTitle
@"User settings section footer, a detailed explanation"); // = NSLocalizedString(@"SETTINGS_SECTION_TITLE_CALLING", @"settings topic header for table section");
[callingSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString( // callingSection.footerTitle = NSLocalizedString(@"SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE_DETAIL",
@"SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE", // @"User settings section footer, a detailed explanation");
@"Table cell label") // [callingSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString(
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", // @"SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE",
@"calling_hide_ip_address"] // @"Table cell label")
isOnBlock:^{ // accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@",
return [Environment.shared.preferences doCallsHideIPAddress]; // @"calling_hide_ip_address"]
} // isOnBlock:^{
isEnabledBlock:^{ // return [Environment.shared.preferences doCallsHideIPAddress];
return YES; // }
} // isEnabledBlock:^{
target:weakSelf // return YES;
selector:@selector(didToggleCallsHideIPAddressSwitch:)]]; // }
[contents addSection:callingSection]; // target:weakSelf
// selector:@selector(didToggleCallsHideIPAddressSwitch:)]];
if (CallUIAdapter.isCallkitDisabledForLocale) { // [contents addSection:callingSection];
// Hide all CallKit-related prefs; CallKit is disabled. //
} else if (@available(iOS 11, *)) { // if (CallUIAdapter.isCallkitDisabledForLocale) {
OWSTableSection *callKitSection = [OWSTableSection new]; // // Hide all CallKit-related prefs; CallKit is disabled.
[callKitSection // } else if (@available(iOS 11, *)) {
addItem:[OWSTableItem switchItemWithText:NSLocalizedString( // OWSTableSection *callKitSection = [OWSTableSection new];
@"SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_TITLE", // [callKitSection
@"Short table cell label") // addItem:[OWSTableItem switchItemWithText:NSLocalizedString(
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"callkit_history"] // @"SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_TITLE",
isOnBlock:^{ // @"Short table cell label")
return [Environment.shared.preferences isSystemCallLogEnabled]; // accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"callkit_history"]
} // isOnBlock:^{
isEnabledBlock:^{ // return [Environment.shared.preferences isSystemCallLogEnabled];
return YES; // }
} // isEnabledBlock:^{
target:weakSelf // return YES;
selector:@selector(didToggleEnableSystemCallLogSwitch:)]]; // }
callKitSection.footerTitle = NSLocalizedString( // target:weakSelf
@"SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_DESCRIPTION", @"Settings table section footer."); // selector:@selector(didToggleEnableSystemCallLogSwitch:)]];
[contents addSection:callKitSection]; // callKitSection.footerTitle = NSLocalizedString(
} else if (@available(iOS 10, *)) { // @"SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_DESCRIPTION", @"Settings table section footer.");
OWSTableSection *callKitSection = [OWSTableSection new]; // [contents addSection:callKitSection];
callKitSection.footerTitle // } else if (@available(iOS 10, *)) {
= NSLocalizedString(@"SETTINGS_SECTION_CALL_KIT_DESCRIPTION", @"Settings table section footer."); // OWSTableSection *callKitSection = [OWSTableSection new];
[callKitSection // callKitSection.footerTitle
addItem:[OWSTableItem switchItemWithText:NSLocalizedString( // = NSLocalizedString(@"SETTINGS_SECTION_CALL_KIT_DESCRIPTION", @"Settings table section footer.");
@"SETTINGS_PRIVACY_CALLKIT_TITLE", @"Short table cell label") // [callKitSection
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"callkit"] // addItem:[OWSTableItem switchItemWithText:NSLocalizedString(
isOnBlock:^{ // @"SETTINGS_PRIVACY_CALLKIT_TITLE", @"Short table cell label")
return [Environment.shared.preferences isCallKitEnabled]; // accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"callkit"]
} // isOnBlock:^{
isEnabledBlock:^{ // return [Environment.shared.preferences isCallKitEnabled];
return YES; // }
} // isEnabledBlock:^{
target:weakSelf // return YES;
selector:@selector(didToggleEnableCallKitSwitch:)]]; // }
if (self.preferences.isCallKitEnabled) { // target:weakSelf
[callKitSection // selector:@selector(didToggleEnableCallKitSwitch:)]];
addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_CALLKIT_PRIVACY_TITLE", // if (self.preferences.isCallKitEnabled) {
@"Label for 'CallKit privacy' preference") // [callKitSection
accessibilityIdentifier:[NSString // addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_CALLKIT_PRIVACY_TITLE",
stringWithFormat:@"settings.privacy.%@", @"callkit_privacy"] // @"Label for 'CallKit privacy' preference")
isOnBlock:^{ // accessibilityIdentifier:[NSString
return (BOOL) ![Environment.shared.preferences isCallKitPrivacyEnabled]; // stringWithFormat:@"settings.privacy.%@", @"callkit_privacy"]
} // isOnBlock:^{
isEnabledBlock:^{ // return (BOOL) ![Environment.shared.preferences isCallKitPrivacyEnabled];
return YES; // }
} // isEnabledBlock:^{
target:weakSelf // return YES;
selector:@selector(didToggleEnableCallKitPrivacySwitch:)]]; // }
} // target:weakSelf
[contents addSection:callKitSection]; // 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."); // OWSTableSection *twoFactorAuthSection = [OWSTableSection new];
[twoFactorAuthSection // twoFactorAuthSection.headerTitle = NSLocalizedString(
addItem: // @"SETTINGS_TWO_FACTOR_AUTH_TITLE", @"Title for the 'two factor auth' section of the privacy settings.");
[OWSTableItem // [twoFactorAuthSection
disclosureItemWithText:NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_ITEM", // addItem:
@"Label for the 'two factor auth' item of the privacy settings.") // [OWSTableItem
detailText: // disclosureItemWithText:NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_ITEM",
([OWS2FAManager.sharedManager is2FAEnabled] // @"Label for the 'two factor auth' item of the privacy settings.")
? NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_ENABLED", // detailText:
@"Indicates that 'two factor auth' is enabled in the privacy settings.") // ([OWS2FAManager.sharedManager is2FAEnabled]
: NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_DISABLED", // ? NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_ENABLED",
@"Indicates that 'two factor auth' is disabled in the privacy settings.")) // @"Indicates that 'two factor auth' is enabled in the privacy settings.")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"2fa"] // : NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_DISABLED",
actionBlock:^{ // @"Indicates that 'two factor auth' is disabled in the privacy settings."))
[weakSelf show2FASettings]; // accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"2fa"]
}]]; // actionBlock:^{
[contents addSection:twoFactorAuthSection]; // [weakSelf show2FASettings];
// }]];
// [contents addSection:twoFactorAuthSection];
// ========
OWSTableSection *historyLogsSection = [OWSTableSection new]; OWSTableSection *historyLogsSection = [OWSTableSection new];
historyLogsSection.headerTitle = NSLocalizedString(@"SETTINGS_HISTORYLOG_TITLE", @"Section header"); 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]; [contents addSection:historyLogsSection];
OWSTableSection *unidentifiedDeliveryIndicatorsSection = [OWSTableSection new]; // Loki: Original code
unidentifiedDeliveryIndicatorsSection.headerTitle // ========
= NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SECTION_TITLE", @"table section label"); // OWSTableSection *unidentifiedDeliveryIndicatorsSection = [OWSTableSection new];
[unidentifiedDeliveryIndicatorsSection // unidentifiedDeliveryIndicatorsSection.headerTitle
addItem:[OWSTableItem // = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SECTION_TITLE", @"table section label");
itemWithCustomCellBlock:^UITableViewCell * { // [unidentifiedDeliveryIndicatorsSection
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 // addItem:[OWSTableItem
reuseIdentifier:@"UITableViewCellStyleValue1"]; // itemWithCustomCellBlock:^UITableViewCell * {
[OWSTableItem configureCell:cell]; // UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1
cell.preservesSuperviewLayoutMargins = YES; // reuseIdentifier:@"UITableViewCellStyleValue1"];
cell.contentView.preservesSuperviewLayoutMargins = YES; // [OWSTableItem configureCell:cell];
cell.selectionStyle = UITableViewCellSelectionStyleNone; // cell.preservesSuperviewLayoutMargins = YES;
// cell.contentView.preservesSuperviewLayoutMargins = YES;
UILabel *label = [UILabel new]; // cell.selectionStyle = UITableViewCellSelectionStyleNone;
label.text //
= NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SHOW_INDICATORS", @"switch label"); // UILabel *label = [UILabel new];
label.font = [UIFont ows_regularFontWithSize:18.f]; // label.text
label.textColor = [Theme primaryColor]; // = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SHOW_INDICATORS", @"switch label");
[label setContentHuggingHorizontalHigh]; // label.font = [UIFont ows_regularFontWithSize:18.f];
// label.textColor = [Theme primaryColor];
UIImage *icon = [UIImage imageNamed:@"ic_secret_sender_indicator"]; // [label setContentHuggingHorizontalHigh];
UIImageView *iconView = [[UIImageView alloc] //
initWithImage:[icon imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]]; // UIImage *icon = [UIImage imageNamed:@"ic_secret_sender_indicator"];
iconView.tintColor = Theme.secondaryColor; // UIImageView *iconView = [[UIImageView alloc]
[iconView setContentHuggingHorizontalHigh]; // initWithImage:[icon imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]];
// iconView.tintColor = Theme.secondaryColor;
UIView *spacer = [UIView new]; // [iconView setContentHuggingHorizontalHigh];
[spacer setContentHuggingHorizontalLow]; //
// UIView *spacer = [UIView new];
UISwitch *cellSwitch = [UISwitch new]; // [spacer setContentHuggingHorizontalLow];
cell.accessoryView = cellSwitch; //
[cellSwitch setOn:Environment.shared.preferences.shouldShowUnidentifiedDeliveryIndicators]; // UISwitch *cellSwitch = [UISwitch new];
[cellSwitch addTarget:weakSelf // cell.accessoryView = cellSwitch;
action:@selector(didToggleUDShowIndicatorsSwitch:) // [cellSwitch setOn:Environment.shared.preferences.shouldShowUnidentifiedDeliveryIndicators];
forControlEvents:UIControlEventValueChanged]; // [cellSwitch addTarget:weakSelf
[cellSwitch setContentHuggingHorizontalHigh]; // action:@selector(didToggleUDShowIndicatorsSwitch:)
cellSwitch.accessibilityIdentifier = // forControlEvents:UIControlEventValueChanged];
[NSString stringWithFormat:@"settings.privacy.%@", @"sealed_sender"]; // [cellSwitch setContentHuggingHorizontalHigh];
// cellSwitch.accessibilityIdentifier =
UIStackView *stackView = // [NSString stringWithFormat:@"settings.privacy.%@", @"sealed_sender"];
[[UIStackView alloc] initWithArrangedSubviews:@[ label, iconView, spacer, cellSwitch ]]; //
stackView.axis = UILayoutConstraintAxisHorizontal; // UIStackView *stackView =
stackView.spacing = 10; // [[UIStackView alloc] initWithArrangedSubviews:@[ label, iconView, spacer, cellSwitch ]];
stackView.alignment = UIStackViewAlignmentCenter; // stackView.axis = UILayoutConstraintAxisHorizontal;
// stackView.spacing = 10;
[cell.contentView addSubview:stackView]; // stackView.alignment = UIStackViewAlignmentCenter;
[stackView ows_autoPinToSuperviewMargins]; //
return cell; // [cell.contentView addSubview:stackView];
} // [stackView ows_autoPinToSuperviewMargins];
customRowHeight:UITableViewAutomaticDimension // return cell;
actionBlock:^{ // }
NSURL *url = [NSURL URLWithString:kSealedSenderInfoURL]; // customRowHeight:UITableViewAutomaticDimension
OWSCAssertDebug(url); // actionBlock:^{
[UIApplication.sharedApplication openURL:url]; // 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]; // unidentifiedDeliveryIndicatorsSection.footerTitle
// = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_SHOW_INDICATORS_FOOTER", @"table section footer");
OWSTableSection *unidentifiedDeliveryUnrestrictedSection = [OWSTableSection new]; // [contents addSection:unidentifiedDeliveryIndicatorsSection];
OWSTableItem *unrestrictedAccessItem = [OWSTableItem //
switchItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS", @"switch label") // OWSTableSection *unidentifiedDeliveryUnrestrictedSection = [OWSTableSection new];
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"sealed_sender_unrestricted"] // OWSTableItem *unrestrictedAccessItem = [OWSTableItem
isOnBlock:^{ // switchItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS", @"switch label")
return [SSKEnvironment.shared.udManager shouldAllowUnrestrictedAccessLocal]; // accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"sealed_sender_unrestricted"]
} // isOnBlock:^{
isEnabledBlock:^{ // return [SSKEnvironment.shared.udManager shouldAllowUnrestrictedAccessLocal];
return YES; // }
} // isEnabledBlock:^{
target:weakSelf // return YES;
selector:@selector(didToggleUDUnrestrictedAccessSwitch:)]; // }
[unidentifiedDeliveryUnrestrictedSection addItem:unrestrictedAccessItem]; // target:weakSelf
unidentifiedDeliveryUnrestrictedSection.footerTitle // selector:@selector(didToggleUDUnrestrictedAccessSwitch:)];
= NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS_FOOTER", @"table section footer"); // [unidentifiedDeliveryUnrestrictedSection addItem:unrestrictedAccessItem];
[contents addSection:unidentifiedDeliveryUnrestrictedSection]; // unidentifiedDeliveryUnrestrictedSection.footerTitle
// = NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS_FOOTER", @"table section footer");
OWSTableSection *unidentifiedDeliveryLearnMoreSection = [OWSTableSection new]; // [contents addSection:unidentifiedDeliveryUnrestrictedSection];
[unidentifiedDeliveryLearnMoreSection //
addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_LEARN_MORE", // OWSTableSection *unidentifiedDeliveryLearnMoreSection = [OWSTableSection new];
@"Label for a link to more info about unidentified delivery.") // [unidentifiedDeliveryLearnMoreSection
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", // addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_LEARN_MORE",
@"sealed_sender_learn_more"] // @"Label for a link to more info about unidentified delivery.")
actionBlock:^{ // accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@",
NSURL *url = [NSURL URLWithString:kSealedSenderInfoURL]; // @"sealed_sender_learn_more"]
OWSCAssertDebug(url); // actionBlock:^{
[UIApplication.sharedApplication openURL:url]; // NSURL *url = [NSURL URLWithString:kSealedSenderInfoURL];
}]]; // OWSCAssertDebug(url);
[contents addSection:unidentifiedDeliveryLearnMoreSection]; // [UIApplication.sharedApplication openURL:url];
// }]];
// [contents addSection:unidentifiedDeliveryLearnMoreSection];
// ========
OWSTableSection *linkPreviewsSection = [OWSTableSection new]; OWSTableSection *linkPreviewsSection = [OWSTableSection new];
[linkPreviewsSection [linkPreviewsSection

@ -37,6 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
self.font = [UIFont ows_dynamicTypeBodyFont]; self.font = [UIFont ows_dynamicTypeBodyFont];
self.textColor = Theme.primaryColor; self.textColor = Theme.primaryColor;
self.textAlignment = NSTextAlignmentNatural; self.textAlignment = NSTextAlignmentNatural;
self.tintColor = UIColor.lokiGreen;
self.contentMode = UIViewContentModeRedraw; self.contentMode = UIViewContentModeRedraw;
self.dataDetectorTypes = UIDataDetectorTypeNone; self.dataDetectorTypes = UIDataDetectorTypeNone;

@ -120,7 +120,7 @@ const CGFloat kMaxTextViewHeight = 98;
self.backgroundColor = Theme.toolbarBackgroundColor; self.backgroundColor = Theme.toolbarBackgroundColor;
} else { } else {
CGFloat alpha = OWSNavigationBar.backgroundBlurMutingFactor; CGFloat alpha = OWSNavigationBar.backgroundBlurMutingFactor;
self.backgroundColor = [Theme.toolbarBackgroundColor colorWithAlphaComponent:alpha]; self.backgroundColor = UIColor.lokiDarkerGray;
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:Theme.barBlurEffect]; UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:Theme.barBlurEffect];
blurEffectView.layer.zPosition = -1; blurEffectView.layer.zPosition = -1;
@ -157,7 +157,7 @@ const CGFloat kMaxTextViewHeight = 98;
_sendButton = [UIButton buttonWithType:UIButtonTypeCustom]; _sendButton = [UIButton buttonWithType:UIButtonTypeCustom];
[self.sendButton setTitle:MessageStrings.sendButton forState:UIControlStateNormal]; [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.textAlignment = NSTextAlignmentCenter;
self.sendButton.titleLabel.font = [UIFont ows_mediumFontWithSize:17.f]; self.sendButton.titleLabel.font = [UIFont ows_mediumFontWithSize:17.f];
self.sendButton.contentEdgeInsets = UIEdgeInsetsMake(0, 4, 0, 4); self.sendButton.contentEdgeInsets = UIEdgeInsetsMake(0, 4, 0, 4);
@ -220,7 +220,7 @@ const CGFloat kMaxTextViewHeight = 98;
// H Stack // H Stack
_hStack = [[UIStackView alloc] _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.axis = UILayoutConstraintAxisHorizontal;
self.hStack.layoutMarginsRelativeArrangement = YES; self.hStack.layoutMarginsRelativeArrangement = YES;
self.hStack.layoutMargins = UIEdgeInsetsMake(6, 6, 6, 6); self.hStack.layoutMargins = UIEdgeInsetsMake(6, 6, 6, 6);

@ -1518,9 +1518,12 @@ typedef enum : NSUInteger {
0, 0,
round(image.size.width + imageEdgeInsets.left + imageEdgeInsets.right), round(image.size.width + imageEdgeInsets.left + imageEdgeInsets.right),
round(image.size.height + imageEdgeInsets.top + imageEdgeInsets.bottom)); round(image.size.height + imageEdgeInsets.top + imageEdgeInsets.bottom));
[barButtons // Loki: Original code
addObject:[[UIBarButtonItem alloc] initWithCustomView:callButton // ========
accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"call")]]; // [barButtons
// addObject:[[UIBarButtonItem alloc] initWithCustomView:callButton
// accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"call")]];
// ========
} }
if (self.disappearingMessagesConfiguration.isEnabled) { if (self.disappearingMessagesConfiguration.isEnabled) {

@ -1256,10 +1256,7 @@ static const int kYapDatabaseRangeMaxLength = 25000;
[interactionIds addObject:interaction.uniqueId]; [interactionIds addObject:interaction.uniqueId];
} }
OWSContactOffersInteraction *_Nullable offers = OWSContactOffersInteraction *_Nullable offers = nil;
[self tryToBuildContactOffersInteractionWithTransaction:transaction
loadedInteractions:interactions
canLoadMoreItems:canLoadMoreItems];
if (offers && [interactionIds containsObject:offers.beforeInteractionId]) { if (offers && [interactionIds containsObject:offers.beforeInteractionId]) {
id<ConversationViewItem> offersItem = tryToAddViewItem(offers, transaction); id<ConversationViewItem> offersItem = tryToAddViewItem(offers, transaction);
if ([offersItem.interaction isKindOfClass:[OWSContactOffersInteraction class]]) { if ([offersItem.interaction isKindOfClass:[OWSContactOffersInteraction class]]) {

@ -536,7 +536,7 @@ NS_ASSUME_NONNULL_BEGIN
if (hasCheckmark) { if (hasCheckmark) {
NSMutableAttributedString *checkmark = [[NSMutableAttributedString alloc] initWithString:@"✓"]; NSMutableAttributedString *checkmark = [[NSMutableAttributedString alloc] initWithString:@"✓"];
[checkmark beginEditing]; [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]; [checkmark endEditing];
NSMutableAttributedString *mutableName = [name mutableCopy]; NSMutableAttributedString *mutableName = [name mutableCopy];
[mutableName appendAttributedString:[[NSAttributedString alloc] initWithString:@" "]]; [mutableName appendAttributedString:[[NSAttributedString alloc] initWithString:@" "]];

@ -619,7 +619,7 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) {
switch (self.homeViewMode) { switch (self.homeViewMode) {
case HomeViewMode_Inbox: case HomeViewMode_Inbox:
// TODO: Should our app name be translated? Probably not. // 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; break;
case HomeViewMode_Archive: case HomeViewMode_Archive:
self.title = NSLocalizedString(@"HOME_VIEW_TITLE_ARCHIVE", @"Title for the home view's 'archive' mode."); self.title = NSLocalizedString(@"HOME_VIEW_TITLE_ARCHIVE", @"Title for the home view's 'archive' mode.");

@ -127,7 +127,7 @@ NS_ASSUME_NONNULL_BEGIN
UISearchBar *searchBar = [OWSSearchBar new]; UISearchBar *searchBar = [OWSSearchBar new];
_searchBar = searchBar; _searchBar = searchBar;
searchBar.delegate = self; searchBar.delegate = self;
searchBar.placeholder = NSLocalizedString(@"Search by name or public key", @""); searchBar.placeholder = NSLocalizedString(@"Search by public key", @"");
searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone; searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone;
[searchBar sizeToFit]; [searchBar sizeToFit];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, searchBar); SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, searchBar);
@ -479,11 +479,16 @@ NS_ASSUME_NONNULL_BEGIN
// ======== // ========
if (self.contactsViewHelper.hasUpdatedContactsAtLeastOnce) { if (self.contactsViewHelper.hasUpdatedContactsAtLeastOnce) {
/**
* Loki: Original code
* ========
[contactsSection [contactsSection
addItem:[OWSTableItem softCenterLabelItemWithText: addItem:[OWSTableItem softCenterLabelItemWithText:
NSLocalizedString(@"SETTINGS_BLOCK_LIST_NO_CONTACTS", NSLocalizedString(@"SETTINGS_BLOCK_LIST_NO_CONTACTS",
@"A label that indicates the user has no Signal contacts.") @"A label that indicates the user has no Signal contacts.")
customRowHeight:UITableViewAutomaticDimension]]; customRowHeight:UITableViewAutomaticDimension]];
* ========
*/
} else { } else {
UITableViewCell *loadingCell = [OWSTableItem newCell]; UITableViewCell *loadingCell = [OWSTableItem newCell];
OWSAssertDebug(loadingCell.contentView); OWSAssertDebug(loadingCell.contentView);
@ -736,12 +741,9 @@ NS_ASSUME_NONNULL_BEGIN
[sections addObject:inviteeSection]; [sections addObject:inviteeSection];
} }
// Loki: /**
// ======== * Loki: Original code
NSString *publicKey = self.searchBar.text; * ========
BOOL isValidPublicKey = [ECKeyPair isValidHexEncodedPublicKeyWithCandidate:publicKey];
// ========
if (isValidPublicKey && !hasSearchResults) { if (isValidPublicKey && !hasSearchResults) {
// No Search Results // No Search Results
OWSTableSection *noResultsSection = [OWSTableSection new]; OWSTableSection *noResultsSection = [OWSTableSection new];
@ -753,6 +755,8 @@ NS_ASSUME_NONNULL_BEGIN
[sections addObject:noResultsSection]; [sections addObject:noResultsSection];
} }
* ========
*/
return [sections copy]; return [sections copy];
} }
@ -812,17 +816,17 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
_isNoContactsModeActive = isNoContactsModeActive; _isNoContactsModeActive = NO;
if (isNoContactsModeActive) { // if (isNoContactsModeActive) {
self.tableViewController.tableView.hidden = YES; // self.tableViewController.tableView.hidden = YES;
self.searchBar.hidden = YES; // self.searchBar.hidden = YES;
self.noSignalContactsView.hidden = NO; // self.noSignalContactsView.hidden = NO;
} else { // } else {
self.tableViewController.tableView.hidden = NO; self.tableViewController.tableView.hidden = NO;
self.searchBar.hidden = NO; self.searchBar.hidden = NO;
self.noSignalContactsView.hidden = YES; self.noSignalContactsView.hidden = YES;
} // }
[self updateTableContents]; [self updateTableContents];
} }

@ -95,7 +95,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
- (void)createViews - (void)createViews
{ {
self.view.backgroundColor = Theme.offBackgroundColor; self.view.backgroundColor = Theme.backgroundColor;
UIView *contentView = [UIView containerView]; UIView *contentView = [UIView containerView];
contentView.backgroundColor = Theme.backgroundColor; contentView.backgroundColor = Theme.backgroundColor;
@ -116,8 +116,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
[rows addObject:nameRow]; [rows addObject:nameRow];
UILabel *nameLabel = [UILabel new]; UILabel *nameLabel = [UILabel new];
nameLabel.text = NSLocalizedString( nameLabel.text = NSLocalizedString(@"Display Name", @"");
@"PROFILE_VIEW_PROFILE_NAME_FIELD", @"Label for the profile name field of the profile view.");
nameLabel.textColor = Theme.primaryColor; nameLabel.textColor = Theme.primaryColor;
nameLabel.font = [UIFont ows_mediumFontWithSize:fontSizePoints]; nameLabel.font = [UIFont ows_mediumFontWithSize:fontSizePoints];
[nameRow addSubview:nameLabel]; [nameRow addSubview:nameLabel];
@ -187,39 +186,42 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
// Information // Information
UIView *infoRow = [UIView containerView]; // Loki: Original code
infoRow.userInteractionEnabled = YES; // ========
[infoRow // UIView *infoRow = [UIView containerView];
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(infoRowTapped:)]]; // infoRow.userInteractionEnabled = YES;
infoRow.accessibilityIdentifier = ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"infoRow"); // [infoRow
[rows addObject:infoRow]; // addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(infoRowTapped:)]];
// infoRow.accessibilityIdentifier = ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"infoRow");
UILabel *infoLabel = [UILabel new]; // [rows addObject:infoRow];
infoLabel.textColor = Theme.secondaryColor; //
infoLabel.font = [UIFont ows_regularFontWithSize:11.f]; // UILabel *infoLabel = [UILabel new];
infoLabel.textAlignment = NSTextAlignmentCenter; // infoLabel.textColor = Theme.secondaryColor;
NSMutableAttributedString *text = [NSMutableAttributedString new]; // infoLabel.font = [UIFont ows_regularFontWithSize:11.f];
[text appendAttributedString:[[NSAttributedString alloc] // infoLabel.textAlignment = NSTextAlignmentCenter;
initWithString:NSLocalizedString(@"PROFILE_VIEW_PROFILE_DESCRIPTION", // NSMutableAttributedString *text = [NSMutableAttributedString new];
@"Description of the user profile.") // [text appendAttributedString:[[NSAttributedString alloc]
attributes:@{}]]; // initWithString:NSLocalizedString(@"PROFILE_VIEW_PROFILE_DESCRIPTION",
[text appendAttributedString:[[NSAttributedString alloc] initWithString:@" " attributes:@{}]]; // @"Description of the user profile.")
[text appendAttributedString:[[NSAttributedString alloc] // attributes:@{}]];
initWithString:NSLocalizedString(@"PROFILE_VIEW_PROFILE_DESCRIPTION_LINK", // [text appendAttributedString:[[NSAttributedString alloc] initWithString:@" " attributes:@{}]];
@"Link to more information about the user profile.") // [text appendAttributedString:[[NSAttributedString alloc]
attributes:@{ // initWithString:NSLocalizedString(@"PROFILE_VIEW_PROFILE_DESCRIPTION_LINK",
NSUnderlineStyleAttributeName : // @"Link to more information about the user profile.")
@(NSUnderlineStyleSingle | NSUnderlinePatternSolid), // attributes:@{
NSForegroundColorAttributeName : [UIColor ows_materialBlueColor], // NSUnderlineStyleAttributeName :
}]]; // @(NSUnderlineStyleSingle | NSUnderlinePatternSolid),
infoLabel.attributedText = text; // NSForegroundColorAttributeName : [UIColor ows_materialBlueColor],
infoLabel.numberOfLines = 0; // }]];
infoLabel.lineBreakMode = NSLineBreakByWordWrapping; // infoLabel.attributedText = text;
[infoRow addSubview:infoLabel]; // infoLabel.numberOfLines = 0;
[infoLabel autoPinLeadingToSuperviewMargin]; // infoLabel.lineBreakMode = NSLineBreakByWordWrapping;
[infoLabel autoPinTrailingToSuperviewMargin]; // [infoRow addSubview:infoLabel];
[infoLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:10.f]; // [infoLabel autoPinLeadingToSuperviewMargin];
[infoLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:10.f]; // [infoLabel autoPinTrailingToSuperviewMargin];
// [infoLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:10.f];
// [infoLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:10.f];
// ========
// Big Button // Big Button

@ -324,6 +324,9 @@ const CGFloat kIconViewLength = 24;
mainSection.customHeaderView = [self mainSectionHeader]; mainSection.customHeaderView = [self mainSectionHeader];
mainSection.customHeaderHeight = @(100.f); mainSection.customHeaderHeight = @(100.f);
/**
* Loki: Original code
* ========
if ([self.thread isKindOfClass:[TSContactThread class]] && self.contactsManager.supportsContactEditing if ([self.thread isKindOfClass:[TSContactThread class]] && self.contactsManager.supportsContactEditing
&& !self.hasExistingContact) { && !self.hasExistingContact) {
[mainSection [mainSection
@ -455,6 +458,8 @@ const CGFloat kIconViewLength = 24;
[weakSelf showShareProfileAlert]; [weakSelf showShareProfileAlert];
}]]; }]];
} }
* =======
*/
[mainSection addItem:[OWSTableItem [mainSection addItem:[OWSTableItem
itemWithCustomCellBlock:^{ itemWithCustomCellBlock:^{
@ -770,6 +775,9 @@ const CGFloat kIconViewLength = 24;
} }
// Block Conversation section. // Block Conversation section.
/**
* Loki: Original code
* ========
if (!isNoteToSelf) { if (!isNoteToSelf) {
OWSTableSection *section = [OWSTableSection new]; OWSTableSection *section = [OWSTableSection new];
if (self.thread.isGroupThread) { if (self.thread.isGroupThread) {
@ -816,6 +824,8 @@ const CGFloat kIconViewLength = 24;
actionBlock:nil]]; actionBlock:nil]];
[contents addSection:section]; [contents addSection:section];
} }
* ========
*/
self.contents = contents; self.contents = contents;
} }

@ -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."; "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."; "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."; "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"; "Start a Conversation" = "Start a Conversation";
"Invalid public key" = "Invalid public key"; "Invalid public key" = "Invalid public key";
"No search results" = "No search results"; "No search results" = "No search results";
@ -2587,3 +2587,7 @@
"Your friend request to %@ has expired" = "Your friend request to %@ has expired"; "Your friend request to %@ has expired" = "Your friend request to %@ has expired";
"Show Seed" = "Show Seed"; "Show Seed" = "Show Seed";
"Your Seed" = "Your 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";

@ -90,7 +90,7 @@ NS_ASSUME_NONNULL_BEGIN
UISearchBar *searchBar = [OWSSearchBar new]; UISearchBar *searchBar = [OWSSearchBar new];
_searchBar = searchBar; _searchBar = searchBar;
searchBar.delegate = self; searchBar.delegate = self;
searchBar.placeholder = NSLocalizedString(@"Search by name or public key", @""); searchBar.placeholder = NSLocalizedString(@"Search by public key", @"");
[searchBar sizeToFit]; [searchBar sizeToFit];
UIView *header = [self.selectThreadViewDelegate createHeaderWithSearchBar:searchBar]; UIView *header = [self.selectThreadViewDelegate createHeaderWithSearchBar:searchBar];

@ -31,7 +31,7 @@ public class AvatarImageView: UIImageView {
func initialize() { func initialize() {
// Loki: Used to indicate a contact's online status // Loki: Used to indicate a contact's online status
layer.borderWidth = 3 layer.borderWidth = 4
// Loki: Observe online status changes // Loki: Observe online status changes
NotificationCenter.default.addObserver(self, selector: #selector(handleContactOnlineStatusChangedNotification), name: .contactOnlineStatusChanged, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(handleContactOnlineStatusChangedNotification), name: .contactOnlineStatusChanged, object: nil)
@ -87,7 +87,7 @@ public class AvatarImageView: UIImageView {
@objc func updateOnlineStatusIndicator() { @objc func updateOnlineStatusIndicator() {
let peerInfo = LokiP2PAPI.getInfo(for: contactID) let peerInfo = LokiP2PAPI.getInfo(for: contactID)
let isOnline = peerInfo?.isOnline ?? false 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 currentUserID = OWSIdentityManager.shared().identityKeyPair()!.hexEncodedPublicKey
let isCurrentUser = (contactID == currentUserID) let isCurrentUser = (contactID == currentUserID)
layer.borderColor = isCurrentUser ? UIColor.clear.cgColor : color.cgColor layer.borderColor = isCurrentUser ? UIColor.clear.cgColor : color.cgColor

@ -83,7 +83,7 @@ public class OWSNavigationBar: UINavigationBar {
} else { } else {
// Make navbar more translucent than default. Navbars remove alpha from any assigned backgroundColor, so // Make navbar more translucent than default. Navbars remove alpha from any assigned backgroundColor, so
// to achieve transparency, we have to assign a transparent image. // 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) let backgroundImage = UIImage(color: color)
self.setBackgroundImage(backgroundImage, for: .default) self.setBackgroundImage(backgroundImage, for: .default)

@ -65,6 +65,7 @@ NS_ASSUME_NONNULL_BEGIN
UIColor *foregroundColor = Theme.placeholderColor; UIColor *foregroundColor = Theme.placeholderColor;
searchBar.barTintColor = Theme.backgroundColor; searchBar.barTintColor = Theme.backgroundColor;
searchBar.barStyle = Theme.barStyle; searchBar.barStyle = Theme.barStyle;
searchBar.tintColor = UIColor.lokiGreen;
// Hide searchBar border. // Hide searchBar border.
// Alternatively we could hide the border by using `UISearchBarStyleMinimal`, but that causes an issue when toggling // Alternatively we could hide the border by using `UISearchBarStyleMinimal`, but that causes an issue when toggling

@ -38,7 +38,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (BOOL)isDarkThemeEnabled + (BOOL)isDarkThemeEnabled
{ {
return [self.sharedInstance isDarkThemeEnabled]; return YES;
} }
- (BOOL)isDarkThemeEnabled - (BOOL)isDarkThemeEnabled
@ -83,18 +83,17 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (UIColor *)backgroundColor + (UIColor *)backgroundColor
{ {
return (Theme.isDarkThemeEnabled ? Theme.darkThemeBackgroundColor : UIColor.ows_whiteColor); return UIColor.lokiDarkestGray;
} }
+ (UIColor *)offBackgroundColor + (UIColor *)offBackgroundColor
{ {
return ( return UIColor.lokiDarkGray;
Theme.isDarkThemeEnabled ? [UIColor colorWithWhite:0.2f alpha:1.f] : [UIColor colorWithWhite:0.94f alpha:1.f]);
} }
+ (UIColor *)primaryColor + (UIColor *)primaryColor
{ {
return (Theme.isDarkThemeEnabled ? Theme.darkThemePrimaryColor : UIColor.ows_gray90Color); return UIColor.whiteColor;
} }
+ (UIColor *)secondaryColor + (UIColor *)secondaryColor
@ -114,19 +113,19 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (UIColor *)placeholderColor + (UIColor *)placeholderColor
{ {
return (Theme.isDarkThemeEnabled ? UIColor.ows_gray45Color : UIColor.ows_gray45Color); return UIColor.lokiLightGray;
} }
+ (UIColor *)hairlineColor + (UIColor *)hairlineColor
{ {
return (Theme.isDarkThemeEnabled ? UIColor.ows_gray75Color : UIColor.ows_gray25Color); return UIColor.lokiDarkGray;
} }
#pragma mark - Global App Colors #pragma mark - Global App Colors
+ (UIColor *)navbarBackgroundColor + (UIColor *)navbarBackgroundColor
{ {
return (Theme.isDarkThemeEnabled ? self.darkThemeNavbarBackgroundColor : UIColor.ows_whiteColor); return UIColor.lokiDarkestGray;
} }
+ (UIColor *)darkThemeNavbarBackgroundColor + (UIColor *)darkThemeNavbarBackgroundColor
@ -136,7 +135,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (UIColor *)navbarIconColor + (UIColor *)navbarIconColor
{ {
return (Theme.isDarkThemeEnabled ? self.darkThemeNavbarIconColor : UIColor.ows_gray60Color); return UIColor.lokiGreen;
} }
+ (UIColor *)darkThemeNavbarIconColor; + (UIColor *)darkThemeNavbarIconColor;
@ -156,7 +155,7 @@ NSString *const ThemeKeyThemeEnabled = @"ThemeKeyThemeEnabled";
+ (UIColor *)cellSelectedColor + (UIColor *)cellSelectedColor
{ {
return (Theme.isDarkThemeEnabled ? [UIColor colorWithWhite:0.2 alpha:1] : [UIColor colorWithWhite:0.92 alpha:1]); return UIColor.lokiDarkGray;
} }
+ (UIColor *)cellSeparatorColor + (UIColor *)cellSeparatorColor

@ -51,6 +51,15 @@ NS_ASSUME_NONNULL_BEGIN
// TODO: Remove // TODO: Remove
@property (class, readonly, nonatomic) UIColor *ows_darkSkyBlueColor; @property (class, readonly, nonatomic) UIColor *ows_darkSkyBlueColor;
#pragma mark - Loki
+ (UIColor *)lokiGreen;
+ (UIColor *)lokiDarkGreen;
+ (UIColor *)lokiDarkestGray;
+ (UIColor *)lokiDarkerGray;
+ (UIColor *)lokiDarkGray;
+ (UIColor *)lokiLightGray;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -14,28 +14,27 @@ NS_ASSUME_NONNULL_BEGIN
+ (UIColor *)ows_signalBrandBlueColor + (UIColor *)ows_signalBrandBlueColor
{ {
return [UIColor colorWithRed:0.1135657504f green:0.4787300229f blue:0.89595204589999999f alpha:1.]; return UIColor.lokiGreen;
} }
+ (UIColor *)ows_materialBlueColor + (UIColor *)ows_materialBlueColor
{ {
// blue: #2090EA return UIColor.lokiGreen;
return [UIColor colorWithRed:32.f / 255.f green:144.f / 255.f blue:234.f / 255.f alpha:1.f];
} }
+ (UIColor *)ows_darkIconColor + (UIColor *)ows_darkIconColor
{ {
return [UIColor colorWithRGBHex:0x505050]; return UIColor.lokiGreen;
} }
+ (UIColor *)ows_darkGrayColor + (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 + (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 + (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]; 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 @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -142,17 +142,17 @@ public class ConversationStyle: NSObject {
@objc @objc
private static var defaultBubbleColorIncoming: UIColor { private static var defaultBubbleColorIncoming: UIColor {
return Theme.isDarkThemeEnabled ? UIColor.ows_gray75 : UIColor.ows_messageBubbleLightGray return UIColor.lokiDarkGray()
} }
@objc @objc
public let bubbleColorOutgoingFailed = UIColor.ows_darkSkyBlue public let bubbleColorOutgoingFailed = UIColor.lokiGreen()
@objc @objc
public let bubbleColorOutgoingSending = UIColor.ows_darkSkyBlue public let bubbleColorOutgoingSending = UIColor.lokiGreen()
@objc @objc
public let bubbleColorOutgoingSent = UIColor.ows_darkSkyBlue public let bubbleColorOutgoingSent = UIColor.lokiGreen()
@objc @objc
public let dateBreakTextColor = UIColor.ows_gray60 public let dateBreakTextColor = UIColor.ows_gray60

Loading…
Cancel
Save