Merge pull request #2200 from vector-im/riot_2174

Fix iOS side of #2174
This commit is contained in:
manuroe 2019-01-23 14:22:48 +01:00 committed by GitHub
commit e4d0cf4523
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 90 additions and 130 deletions

View file

@ -143,21 +143,18 @@
self.authenticationScrollView.backgroundColor = ThemeService.shared.theme.backgroundColor; self.authenticationScrollView.backgroundColor = ThemeService.shared.theme.backgroundColor;
self.authFallbackContentView.backgroundColor = ThemeService.shared.theme.backgroundColor; self.authFallbackContentView.backgroundColor = ThemeService.shared.theme.backgroundColor;
if (ThemeService.shared.theme.placeholderTextColor) if (self.homeServerTextField.placeholder)
{ {
if (self.homeServerTextField.placeholder) self.homeServerTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:self.homeServerTextField.placeholder
self.homeServerTextField.attributedPlaceholder = [[NSAttributedString alloc] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
initWithString:self.homeServerTextField.placeholder }
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; if (self.identityServerTextField.placeholder)
} {
if (self.identityServerTextField.placeholder) self.identityServerTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:self.identityServerTextField.placeholder
self.identityServerTextField.attributedPlaceholder = [[NSAttributedString alloc] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
initWithString:self.identityServerTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
} }
self.submitButton.backgroundColor = ThemeService.shared.theme.tintColor; self.submitButton.backgroundColor = ThemeService.shared.theme.tintColor;

View file

@ -71,12 +71,9 @@
self.userLoginTextField.placeholder = NSLocalizedStringFromTable(@"auth_user_id_placeholder", @"Vector", nil); self.userLoginTextField.placeholder = NSLocalizedStringFromTable(@"auth_user_id_placeholder", @"Vector", nil);
self.repeatPasswordTextField.placeholder = NSLocalizedStringFromTable(@"auth_repeat_password_placeholder", @"Vector", nil); self.repeatPasswordTextField.placeholder = NSLocalizedStringFromTable(@"auth_repeat_password_placeholder", @"Vector", nil);
self.passWordTextField.placeholder = NSLocalizedStringFromTable(@"auth_password_placeholder", @"Vector", nil); self.passWordTextField.placeholder = NSLocalizedStringFromTable(@"auth_password_placeholder", @"Vector", nil);
if (ThemeService.shared.theme.placeholderTextColor) // Apply placeholder color
{ [self customizeViewRendering];
// Apply placeholder color
[self customizeViewRendering];
}
} }
- (void)destroy - (void)destroy
@ -115,44 +112,41 @@
self.messageLabel.textColor = ThemeService.shared.theme.textSecondaryColor; self.messageLabel.textColor = ThemeService.shared.theme.textSecondaryColor;
self.messageLabel.numberOfLines = 0; self.messageLabel.numberOfLines = 0;
if (ThemeService.shared.theme.placeholderTextColor) if (self.userLoginTextField.placeholder)
{ {
if (self.userLoginTextField.placeholder) self.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:self.userLoginTextField.placeholder
self.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.userLoginTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
if (self.repeatPasswordTextField.placeholder)
{
self.repeatPasswordTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.repeatPasswordTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
if (self.passWordTextField.placeholder)
{
self.passWordTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.passWordTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
if (self.phoneTextField.placeholder)
{
self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.phoneTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
} }
if (self.emailTextField.placeholder) if (self.repeatPasswordTextField.placeholder)
{ {
self.emailTextField.attributedPlaceholder = [[NSAttributedString alloc] self.repeatPasswordTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.emailTextField.placeholder initWithString:self.repeatPasswordTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
}
if (self.passWordTextField.placeholder)
{
self.passWordTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.passWordTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
if (self.phoneTextField.placeholder)
{
self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.phoneTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
if (self.emailTextField.placeholder)
{
self.emailTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.emailTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
} }
} }
@ -195,16 +189,13 @@
self.userLoginTextField.placeholder = NSLocalizedStringFromTable(@"auth_user_id_placeholder", @"Vector", nil); self.userLoginTextField.placeholder = NSLocalizedStringFromTable(@"auth_user_id_placeholder", @"Vector", nil);
self.messageLabel.text = NSLocalizedStringFromTable(@"or", @"Vector", nil); self.messageLabel.text = NSLocalizedStringFromTable(@"or", @"Vector", nil);
self.phoneTextField.placeholder = NSLocalizedStringFromTable(@"auth_phone_placeholder", @"Vector", nil); self.phoneTextField.placeholder = NSLocalizedStringFromTable(@"auth_phone_placeholder", @"Vector", nil);
if (ThemeService.shared.theme.placeholderTextColor) self.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:self.userLoginTextField.placeholder
self.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.userLoginTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.phoneTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
} self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.phoneTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
self.userLoginContainer.hidden = NO; self.userLoginContainer.hidden = NO;
self.messageLabel.hidden = NO; self.messageLabel.hidden = NO;
@ -1024,17 +1015,10 @@
if (thirdPartyIdentifiersHidden) if (thirdPartyIdentifiersHidden)
{ {
self.passWordTextField.returnKeyType = UIReturnKeyNext; self.passWordTextField.returnKeyType = UIReturnKeyNext;
if (ThemeService.shared.theme.placeholderTextColor) self.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:NSLocalizedStringFromTable(@"auth_user_name_placeholder", @"Vector", nil)
self.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
initWithString:NSLocalizedStringFromTable(@"auth_user_name_placeholder", @"Vector", nil)
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
else
{
self.userLoginTextField.placeholder = NSLocalizedStringFromTable(@"auth_user_name_placeholder", @"Vector", nil);
}
self.userLoginContainer.hidden = NO; self.userLoginContainer.hidden = NO;
self.passwordContainer.hidden = NO; self.passwordContainer.hidden = NO;
@ -1057,12 +1041,9 @@
self.emailTextField.placeholder = NSLocalizedStringFromTable(@"auth_optional_email_placeholder", @"Vector", nil); self.emailTextField.placeholder = NSLocalizedStringFromTable(@"auth_optional_email_placeholder", @"Vector", nil);
} }
if (ThemeService.shared.theme.placeholderTextColor) self.emailTextField.attributedPlaceholder = [[NSAttributedString alloc]
{
self.emailTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.emailTextField.placeholder initWithString:self.emailTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
self.emailContainer.hidden = NO; self.emailContainer.hidden = NO;
@ -1085,12 +1066,9 @@
self.phoneTextField.placeholder = NSLocalizedStringFromTable(@"auth_optional_phone_placeholder", @"Vector", nil); self.phoneTextField.placeholder = NSLocalizedStringFromTable(@"auth_optional_phone_placeholder", @"Vector", nil);
} }
if (ThemeService.shared.theme.placeholderTextColor) self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:self.phoneTextField.placeholder
self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
initWithString:self.phoneTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
self.phoneContainer.hidden = NO; self.phoneContainer.hidden = NO;

View file

@ -60,11 +60,8 @@
self.passWordTextField.placeholder = NSLocalizedStringFromTable(@"auth_new_password_placeholder", @"Vector", nil); self.passWordTextField.placeholder = NSLocalizedStringFromTable(@"auth_new_password_placeholder", @"Vector", nil);
self.repeatPasswordTextField.placeholder = NSLocalizedStringFromTable(@"auth_repeat_new_password_placeholder", @"Vector", nil); self.repeatPasswordTextField.placeholder = NSLocalizedStringFromTable(@"auth_repeat_new_password_placeholder", @"Vector", nil);
if (ThemeService.shared.theme.placeholderTextColor) // Apply placeholder color
{ [self customizeViewRendering];
// Apply placeholder color
[self customizeViewRendering];
}
} }
- (void)destroy - (void)destroy
@ -116,27 +113,24 @@
[self.nextStepButton.layer setCornerRadius:5]; [self.nextStepButton.layer setCornerRadius:5];
self.nextStepButton.clipsToBounds = YES; self.nextStepButton.clipsToBounds = YES;
self.nextStepButton.backgroundColor = ThemeService.shared.theme.tintColor; self.nextStepButton.backgroundColor = ThemeService.shared.theme.tintColor;
if (ThemeService.shared.theme.placeholderTextColor) if (self.emailTextField.placeholder)
{ {
if (self.emailTextField.placeholder) self.emailTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:self.emailTextField.placeholder
self.emailTextField.attributedPlaceholder = [[NSAttributedString alloc] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
initWithString:self.emailTextField.placeholder }
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; if (self.passWordTextField.placeholder)
} {
if (self.passWordTextField.placeholder) self.passWordTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:self.passWordTextField.placeholder
self.passWordTextField.attributedPlaceholder = [[NSAttributedString alloc] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
initWithString:self.passWordTextField.placeholder }
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}]; if (self.repeatPasswordTextField.placeholder)
} {
if (self.repeatPasswordTextField.placeholder) self.repeatPasswordTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:self.repeatPasswordTextField.placeholder
self.repeatPasswordTextField.attributedPlaceholder = [[NSAttributedString alloc] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
initWithString:self.repeatPasswordTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
} }
} }

View file

@ -121,7 +121,7 @@ static const CGFloat kDirectRoomBorderWidth = 3.0;
} }
else else
{ {
self.missedNotifAndUnreadIndicator.backgroundColor = ThemeService.shared.theme.headerTextSecondaryColor; self.missedNotifAndUnreadIndicator.backgroundColor = ThemeService.shared.theme.unreadRoomIndentColor;
} }
// Use bold font for the room title // Use bold font for the room title

View file

@ -2499,12 +2499,9 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
addAddressTextField = addAddressCell.mxkTextField; addAddressTextField = addAddressCell.mxkTextField;
addAddressTextField.placeholder = [NSString stringWithFormat:NSLocalizedStringFromTable(@"room_details_new_address_placeholder", @"Vector", nil), self.mainSession.matrixRestClient.homeserverSuffix]; addAddressTextField.placeholder = [NSString stringWithFormat:NSLocalizedStringFromTable(@"room_details_new_address_placeholder", @"Vector", nil), self.mainSession.matrixRestClient.homeserverSuffix];
if (ThemeService.shared.theme.placeholderTextColor) addAddressTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:addAddressTextField.placeholder
addAddressTextField.attributedPlaceholder = [[NSAttributedString alloc] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
initWithString:addAddressTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
addAddressTextField.userInteractionEnabled = YES; addAddressTextField.userInteractionEnabled = YES;
addAddressTextField.text = currentValue; addAddressTextField.text = currentValue;
addAddressTextField.textColor = ThemeService.shared.theme.textSecondaryColor; addAddressTextField.textColor = ThemeService.shared.theme.textSecondaryColor;
@ -2590,12 +2587,9 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
addGroupTextField = addCommunityCell.mxkTextField; addGroupTextField = addCommunityCell.mxkTextField;
addGroupTextField.placeholder = [NSString stringWithFormat:NSLocalizedStringFromTable(@"room_details_new_flair_placeholder", @"Vector", nil), self.mainSession.matrixRestClient.homeserverSuffix]; addGroupTextField.placeholder = [NSString stringWithFormat:NSLocalizedStringFromTable(@"room_details_new_flair_placeholder", @"Vector", nil), self.mainSession.matrixRestClient.homeserverSuffix];
if (ThemeService.shared.theme.placeholderTextColor) addGroupTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:addGroupTextField.placeholder
addGroupTextField.attributedPlaceholder = [[NSAttributedString alloc] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
initWithString:addGroupTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
addGroupTextField.userInteractionEnabled = YES; addGroupTextField.userInteractionEnabled = YES;
addGroupTextField.text = currentValue; addGroupTextField.text = currentValue;
addGroupTextField.textColor = ThemeService.shared.theme.textSecondaryColor; addGroupTextField.textColor = ThemeService.shared.theme.textSecondaryColor;

View file

@ -1526,12 +1526,9 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void);
{ {
newEmailCell.mxkLabel.text = nil; newEmailCell.mxkLabel.text = nil;
newEmailCell.mxkTextField.placeholder = NSLocalizedStringFromTable(@"settings_email_address_placeholder", @"Vector", nil); newEmailCell.mxkTextField.placeholder = NSLocalizedStringFromTable(@"settings_email_address_placeholder", @"Vector", nil);
if (ThemeService.shared.theme.placeholderTextColor) newEmailCell.mxkTextField.attributedPlaceholder = [[NSAttributedString alloc]
{ initWithString:newEmailCell.mxkTextField.placeholder
newEmailCell.mxkTextField.attributedPlaceholder = [[NSAttributedString alloc] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
initWithString:newEmailCell.mxkTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
newEmailCell.mxkTextField.text = newEmailTextField.text; newEmailCell.mxkTextField.text = newEmailTextField.text;
newEmailCell.mxkTextField.userInteractionEnabled = YES; newEmailCell.mxkTextField.userInteractionEnabled = YES;
newEmailCell.mxkTextField.keyboardType = UIKeyboardTypeEmailAddress; newEmailCell.mxkTextField.keyboardType = UIKeyboardTypeEmailAddress;