diff --git a/Riot/Views/Authentication/AuthInputsView.m b/Riot/Views/Authentication/AuthInputsView.m index 6af7c8678..428c12e7f 100644 --- a/Riot/Views/Authentication/AuthInputsView.m +++ b/Riot/Views/Authentication/AuthInputsView.m @@ -63,19 +63,9 @@ { [super awakeFromNib]; - _repeatPasswordTextField.placeholder = NSLocalizedStringFromTable(@"auth_repeat_password_placeholder", @"Vector", nil); - _repeatPasswordTextField.textColor = kRiotTextColorBlack; - + self.repeatPasswordTextField.placeholder = NSLocalizedStringFromTable(@"auth_repeat_password_placeholder", @"Vector", nil); self.userLoginTextField.placeholder = NSLocalizedStringFromTable(@"auth_user_id_placeholder", @"Vector", nil); - self.userLoginTextField.textColor = kRiotTextColorBlack; - self.passWordTextField.placeholder = NSLocalizedStringFromTable(@"auth_password_placeholder", @"Vector", nil); - self.passWordTextField.textColor = kRiotTextColorBlack; - - self.emailTextField.textColor = kRiotTextColorBlack; - self.phoneTextField.textColor = kRiotTextColorBlack; - - self.messageLabel.numberOfLines = 0; _thirdPartyIdentifiersHidden = YES; _isThirdPartyIdentifierPending = NO; @@ -99,6 +89,22 @@ } } +#pragma mark - Override MXKView + +-(void)customizeViewRendering +{ + [super customizeViewRendering]; + + self.repeatPasswordTextField.textColor = kRiotTextColorBlack; + self.userLoginTextField.textColor = kRiotTextColorBlack; + self.passWordTextField.textColor = kRiotTextColorBlack; + + self.emailTextField.textColor = kRiotTextColorBlack; + self.phoneTextField.textColor = kRiotTextColorBlack; + + self.messageLabel.numberOfLines = 0; +} + #pragma mark - - (BOOL)setAuthSession:(MXAuthenticationSession *)authSession withAuthType:(MXKAuthenticationType)authType; diff --git a/Riot/Views/Authentication/ForgotPasswordInputsView.m b/Riot/Views/Authentication/ForgotPasswordInputsView.m index 18f4e6d35..369489667 100644 --- a/Riot/Views/Authentication/ForgotPasswordInputsView.m +++ b/Riot/Views/Authentication/ForgotPasswordInputsView.m @@ -52,19 +52,9 @@ [super awakeFromNib]; self.emailTextField.placeholder = NSLocalizedStringFromTable(@"auth_email_placeholder", @"Vector", nil); - self.emailTextField.textColor = kRiotTextColorBlack; - self.passWordTextField.placeholder = NSLocalizedStringFromTable(@"auth_new_password_placeholder", @"Vector", nil); - self.passWordTextField.textColor = kRiotTextColorBlack; - self.repeatPasswordTextField.placeholder = NSLocalizedStringFromTable(@"auth_repeat_new_password_placeholder", @"Vector", nil); - self.repeatPasswordTextField.textColor = kRiotTextColorBlack; - self.messageLabel.numberOfLines = 0; - - [self.nextStepButton.layer setCornerRadius:5]; - self.nextStepButton.clipsToBounds = YES; - self.nextStepButton.backgroundColor = kRiotColorGreen; [self.nextStepButton setTitle:[NSBundle mxk_localizedStringForKey:@"auth_reset_password_next_step_button"] forState:UIControlStateNormal]; [self.nextStepButton setTitle:[NSBundle mxk_localizedStringForKey:@"auth_reset_password_next_step_button"] forState:UIControlStateHighlighted]; self.nextStepButton.enabled = YES; @@ -102,6 +92,23 @@ self.viewHeightConstraint.constant = lastItemFrame.origin.y + lastItemFrame.size.height; } +#pragma mark - Override MXKView + +-(void)customizeViewRendering +{ + [super customizeViewRendering]; + + self.emailTextField.textColor = kRiotTextColorBlack; + self.passWordTextField.textColor = kRiotTextColorBlack; + self.repeatPasswordTextField.textColor = kRiotTextColorBlack; + + self.messageLabel.numberOfLines = 0; + + [self.nextStepButton.layer setCornerRadius:5]; + self.nextStepButton.clipsToBounds = YES; + self.nextStepButton.backgroundColor = kRiotColorGreen; +} + #pragma mark - - (BOOL)setAuthSession:(MXAuthenticationSession *)authSession withAuthType:(MXKAuthenticationType)authType; diff --git a/Riot/Views/Device/DeviceView.m b/Riot/Views/Device/DeviceView.m index 579835542..71a694f2b 100644 --- a/Riot/Views/Device/DeviceView.m +++ b/Riot/Views/Device/DeviceView.m @@ -21,9 +21,11 @@ @implementation DeviceView -- (void)awakeFromNib +#pragma mark - Override MXKView + +-(void)customizeViewRendering { - [super awakeFromNib]; + [super customizeViewRendering]; self.defaultTextColor = kRiotTextColorBlack; } diff --git a/Riot/Views/EncryptionInfoView/EncryptionInfoView.m b/Riot/Views/EncryptionInfoView/EncryptionInfoView.m index e2d58985e..160708864 100644 --- a/Riot/Views/EncryptionInfoView/EncryptionInfoView.m +++ b/Riot/Views/EncryptionInfoView/EncryptionInfoView.m @@ -21,9 +21,11 @@ @implementation EncryptionInfoView -- (void)awakeFromNib +#pragma mark - Override MXKView + +-(void)customizeViewRendering { - [super awakeFromNib]; + [super customizeViewRendering]; self.defaultTextColor = kRiotTextColorBlack; } diff --git a/Riot/Views/RoomActivitiesView/RoomActivitiesView.m b/Riot/Views/RoomActivitiesView/RoomActivitiesView.m index 5e5b45566..cfcbd86fc 100644 --- a/Riot/Views/RoomActivitiesView/RoomActivitiesView.m +++ b/Riot/Views/RoomActivitiesView/RoomActivitiesView.m @@ -96,9 +96,6 @@ { [super awakeFromNib]; - self.separatorView.backgroundColor = kRiotColorLightGrey; - self.messageLabel.textColor = kRiotTextColorGray; - // Adjust text view // Remove the container inset: this operation impacts only the vertical margin. // Reset textContainer.lineFragmentPadding to remove horizontal margin. @@ -108,6 +105,18 @@ xibMainHeightConstraint = self.mainHeightConstraint.constant; } +#pragma mark - Override MXKView + +-(void)customizeViewRendering +{ + [super customizeViewRendering]; + + self.separatorView.backgroundColor = kRiotColorLightGrey; + self.messageLabel.textColor = kRiotTextColorGray; +} + +#pragma mark - + - (void)displayUnsentMessagesNotification:(NSString*)notification withResendLink:(void (^)(void))onResendLinkPressed andCancelLink:(void (^)(void))onCancelLinkPressed andIconTapGesture:(void (^)(void))onIconTapGesture { [self reset]; diff --git a/Riot/Views/RoomInputToolbar/RoomInputToolbarView.m b/Riot/Views/RoomInputToolbar/RoomInputToolbarView.m index 63aa1c87a..584a850c7 100644 --- a/Riot/Views/RoomInputToolbar/RoomInputToolbarView.m +++ b/Riot/Views/RoomInputToolbar/RoomInputToolbarView.m @@ -63,9 +63,6 @@ { [super awakeFromNib]; - // Remove default toolbar background color - self.backgroundColor = [UIColor clearColor]; - _supportCallOption = YES; self.rightInputToolbarButton.hidden = YES; @@ -73,6 +70,18 @@ [self.rightInputToolbarButton setTitleColor:kRiotColorGreen forState:UIControlStateNormal]; [self.rightInputToolbarButton setTitleColor:kRiotColorGreen forState:UIControlStateHighlighted]; + self.isEncryptionEnabled = _isEncryptionEnabled; +} + +#pragma mark - Override MXKView + +-(void)customizeViewRendering +{ + [super customizeViewRendering]; + + // Remove default toolbar background color + self.backgroundColor = [UIColor clearColor]; + self.separatorView.backgroundColor = kRiotColorSilver; // Custom the growingTextView display @@ -83,10 +92,10 @@ growingTextView.font = [UIFont systemFontOfSize:15]; growingTextView.textColor = kRiotTextColorBlack; growingTextView.tintColor = kRiotColorGreen; - - self.isEncryptionEnabled = _isEncryptionEnabled; } +#pragma mark - + - (void)setSupportCallOption:(BOOL)supportCallOption { if (_supportCallOption != supportCallOption) diff --git a/Riot/Views/RoomMember/RoomMemberTitleView.h b/Riot/Views/RoomMember/RoomMemberTitleView.h index f8d35e092..05e12d66c 100644 --- a/Riot/Views/RoomMember/RoomMemberTitleView.h +++ b/Riot/Views/RoomMember/RoomMemberTitleView.h @@ -16,7 +16,7 @@ #import -@interface RoomMemberTitleView : UIView +@interface RoomMemberTitleView : MXKView /** * Returns the `UINib` object initialized for the room member title view. @@ -38,4 +38,4 @@ @property (weak, nonatomic) IBOutlet UIImageView *memberBadge; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *memberAvatarCenterXConstraint; -@end \ No newline at end of file +@end diff --git a/Riot/Views/RoomTitle/ExpandedRoomTitleView.m b/Riot/Views/RoomTitle/ExpandedRoomTitleView.m index 1cac075e5..d4c967395 100644 --- a/Riot/Views/RoomTitle/ExpandedRoomTitleView.m +++ b/Riot/Views/RoomTitle/ExpandedRoomTitleView.m @@ -32,6 +32,11 @@ - (void)awakeFromNib { [super awakeFromNib]; +} + +-(void)customizeViewRendering +{ + [super customizeViewRendering]; self.displayNameTextField.textColor = kRiotTextColorBlack; self.roomTopic.textColor = kRiotTextColorDarkGray; diff --git a/Riot/Views/RoomTitle/PreviewRoomTitleView.m b/Riot/Views/RoomTitle/PreviewRoomTitleView.m index 4accb70d2..32a76e761 100644 --- a/Riot/Views/RoomTitle/PreviewRoomTitleView.m +++ b/Riot/Views/RoomTitle/PreviewRoomTitleView.m @@ -33,6 +33,34 @@ { [super awakeFromNib]; + self.previewLabel.text = nil; + self.subNoticeLabel.text = nil; + + [self.leftButton setTitle:NSLocalizedStringFromTable(@"decline", @"Vector", nil) forState:UIControlStateNormal]; + [self.leftButton setTitle:NSLocalizedStringFromTable(@"decline", @"Vector", nil) forState:UIControlStateHighlighted]; + + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(reportTapGesture:)]; + [tap setNumberOfTouchesRequired:1]; + [tap setNumberOfTapsRequired:1]; + [tap setDelegate:self]; + [self.leftButton addGestureRecognizer:tap]; + self.leftButton.userInteractionEnabled = YES; + + [self.rightButton setTitle:NSLocalizedStringFromTable(@"join", @"Vector", nil) forState:UIControlStateNormal]; + [self.rightButton setTitle:NSLocalizedStringFromTable(@"join", @"Vector", nil) forState:UIControlStateHighlighted]; + + tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(reportTapGesture:)]; + [tap setNumberOfTouchesRequired:1]; + [tap setNumberOfTapsRequired:1]; + [tap setDelegate:self]; + [self.rightButton addGestureRecognizer:tap]; + self.rightButton.userInteractionEnabled = YES; +} + +-(void)customizeViewRendering +{ + [super customizeViewRendering]; + self.mainHeaderBackground.backgroundColor = kRiotColorLightGrey; self.displayNameTextField.textColor = kRiotTextColorBlack; @@ -44,37 +72,19 @@ self.previewLabel.textColor = kRiotTextColorDarkGray; self.previewLabel.numberOfLines = 0; - self.previewLabel.text = nil; self.subNoticeLabel.textColor = kRiotTextColorGray; self.subNoticeLabel.numberOfLines = 0; - self.subNoticeLabel.text = nil; self.bottomBorderView.backgroundColor = kRiotColorLightGrey; [self.leftButton.layer setCornerRadius:5]; self.leftButton.clipsToBounds = YES; self.leftButton.backgroundColor = kRiotColorGreen; - [self.leftButton setTitle:NSLocalizedStringFromTable(@"decline", @"Vector", nil) forState:UIControlStateNormal]; - [self.leftButton setTitle:NSLocalizedStringFromTable(@"decline", @"Vector", nil) forState:UIControlStateHighlighted]; - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(reportTapGesture:)]; - [tap setNumberOfTouchesRequired:1]; - [tap setNumberOfTapsRequired:1]; - [tap setDelegate:self]; - [self.leftButton addGestureRecognizer:tap]; - self.leftButton.userInteractionEnabled = YES; [self.rightButton.layer setCornerRadius:5]; self.rightButton.clipsToBounds = YES; self.rightButton.backgroundColor = kRiotColorGreen; - [self.rightButton setTitle:NSLocalizedStringFromTable(@"join", @"Vector", nil) forState:UIControlStateNormal]; - [self.rightButton setTitle:NSLocalizedStringFromTable(@"join", @"Vector", nil) forState:UIControlStateHighlighted]; - tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(reportTapGesture:)]; - [tap setNumberOfTouchesRequired:1]; - [tap setNumberOfTapsRequired:1]; - [tap setDelegate:self]; - [self.rightButton addGestureRecognizer:tap]; - self.rightButton.userInteractionEnabled = YES; } - (void)refreshDisplay diff --git a/Riot/Views/RoomTitle/RoomTitleView.m b/Riot/Views/RoomTitle/RoomTitleView.m index 2240da8e5..d2111ceba 100644 --- a/Riot/Views/RoomTitle/RoomTitleView.m +++ b/Riot/Views/RoomTitle/RoomTitleView.m @@ -38,8 +38,6 @@ { [super awakeFromNib]; - self.displayNameTextField.textColor = kRiotTextColorBlack; - if (_titleMask) { UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(reportTapGesture:)]; @@ -109,6 +107,13 @@ } } +-(void)customizeViewRendering +{ + [super customizeViewRendering]; + + self.displayNameTextField.textColor = kRiotTextColorBlack; +} + - (void)setRoomPreviewData:(RoomPreviewData *)roomPreviewData { _roomPreviewData = roomPreviewData; diff --git a/Riot/Views/RoomTitle/SimpleRoomTitleView.m b/Riot/Views/RoomTitle/SimpleRoomTitleView.m index e346cb010..e8ef182fe 100644 --- a/Riot/Views/RoomTitle/SimpleRoomTitleView.m +++ b/Riot/Views/RoomTitle/SimpleRoomTitleView.m @@ -32,8 +32,6 @@ - (void)awakeFromNib { [super awakeFromNib]; - - self.displayNameTextField.textColor = kRiotTextColorBlack; } - (void)layoutSubviews @@ -68,6 +66,13 @@ } } +-(void)customizeViewRendering +{ + [super customizeViewRendering]; + + self.displayNameTextField.textColor = kRiotTextColorBlack; +} + - (void)refreshDisplay { [super refreshDisplay];