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.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
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
if (self.identityServerTextField.placeholder)
{
self.identityServerTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.identityServerTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
self.homeServerTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.homeServerTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
if (self.identityServerTextField.placeholder)
{
self.identityServerTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.identityServerTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
self.submitButton.backgroundColor = ThemeService.shared.theme.tintColor;

View file

@ -71,12 +71,9 @@
self.userLoginTextField.placeholder = NSLocalizedStringFromTable(@"auth_user_id_placeholder", @"Vector", nil);
self.repeatPasswordTextField.placeholder = NSLocalizedStringFromTable(@"auth_repeat_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
@ -115,44 +112,41 @@
self.messageLabel.textColor = ThemeService.shared.theme.textSecondaryColor;
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
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
self.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.userLoginTextField.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}];
}
}
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}];
}
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.messageLabel.text = NSLocalizedStringFromTable(@"or", @"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
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.phoneTextField.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}];
self.userLoginContainer.hidden = NO;
self.messageLabel.hidden = NO;
@ -1024,17 +1015,10 @@
if (thirdPartyIdentifiersHidden)
{
self.passWordTextField.returnKeyType = UIReturnKeyNext;
if (ThemeService.shared.theme.placeholderTextColor)
{
self.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc]
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.userLoginTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:NSLocalizedStringFromTable(@"auth_user_name_placeholder", @"Vector", nil)
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
self.userLoginContainer.hidden = NO;
self.passwordContainer.hidden = NO;
@ -1057,12 +1041,9 @@
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
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
self.emailContainer.hidden = NO;
@ -1085,12 +1066,9 @@
self.phoneTextField.placeholder = NSLocalizedStringFromTable(@"auth_optional_phone_placeholder", @"Vector", nil);
}
if (ThemeService.shared.theme.placeholderTextColor)
{
self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.phoneTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
self.phoneTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.phoneTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
self.phoneContainer.hidden = NO;

View file

@ -60,11 +60,8 @@
self.passWordTextField.placeholder = NSLocalizedStringFromTable(@"auth_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
@ -116,27 +113,24 @@
[self.nextStepButton.layer setCornerRadius:5];
self.nextStepButton.clipsToBounds = YES;
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
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.repeatPasswordTextField.placeholder)
{
self.repeatPasswordTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.repeatPasswordTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
self.emailTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.emailTextField.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.repeatPasswordTextField.placeholder)
{
self.repeatPasswordTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:self.repeatPasswordTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
}

View file

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

View file

@ -2499,12 +2499,9 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
addAddressTextField = addAddressCell.mxkTextField;
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
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
addAddressTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:addAddressTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
addAddressTextField.userInteractionEnabled = YES;
addAddressTextField.text = currentValue;
addAddressTextField.textColor = ThemeService.shared.theme.textSecondaryColor;
@ -2590,12 +2587,9 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
addGroupTextField = addCommunityCell.mxkTextField;
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
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
addGroupTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:addGroupTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
addGroupTextField.userInteractionEnabled = YES;
addGroupTextField.text = currentValue;
addGroupTextField.textColor = ThemeService.shared.theme.textSecondaryColor;

View file

@ -1526,12 +1526,9 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(void);
{
newEmailCell.mxkLabel.text = 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
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
}
newEmailCell.mxkTextField.attributedPlaceholder = [[NSAttributedString alloc]
initWithString:newEmailCell.mxkTextField.placeholder
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
newEmailCell.mxkTextField.text = newEmailTextField.text;
newEmailCell.mxkTextField.userInteractionEnabled = YES;
newEmailCell.mxkTextField.keyboardType = UIKeyboardTypeEmailAddress;