reskin: Create ThemeService.shared

This commit is contained in:
manuroe
2019-01-11 11:45:27 +01:00
parent d94284a100
commit bed6b151cb
112 changed files with 758 additions and 728 deletions
@@ -40,19 +40,19 @@
[super layoutSubviews];
self.membersListIcon.image = [MXKTools paintImage:self.membersListIcon.image
withColor:ThemeService.theme.tintColor];
withColor:ThemeService.shared.theme.tintColor];
// TODO: paintImage does not work here because addParticipantIcon has 2 colors
// self.addParticipantIcon.image = [MXKTools paintImage:self.addParticipantIcon.image
// withColor:ThemeService.theme.accent];
// withColor:ThemeService.shared.theme.accent];
}
-(void)customizeViewRendering
{
[super customizeViewRendering];
self.roomTopic.textColor = ThemeService.theme.baseTextSecondaryColor;
self.roomMembers.textColor = ThemeService.theme.tintColor;
self.roomTopic.textColor = ThemeService.shared.theme.baseTextSecondaryColor;
self.roomMembers.textColor = ThemeService.shared.theme.tintColor;
}
- (void)refreshDisplay
@@ -131,7 +131,7 @@
self.roomAvatar.layer.cornerRadius = self.roomAvatar.frame.size.width / 2;
self.roomAvatar.clipsToBounds = YES;
self.roomAvatar.defaultBackgroundColor = ThemeService.theme.headerBackgroundColor;
self.roomAvatar.defaultBackgroundColor = ThemeService.shared.theme.headerBackgroundColor;
// Force the layout of subviews to update the position of 'bottomBorderView' which is used to define the actual height of the preview container.
[self layoutIfNeeded];
@@ -64,28 +64,28 @@
[super customizeViewRendering];
// Use same color as navigation bar
self.mainHeaderBackground.backgroundColor = ThemeService.theme.baseColor;
self.mainHeaderBackground.backgroundColor = ThemeService.shared.theme.baseColor;
self.roomTopic.textColor = ThemeService.theme.baseTextSecondaryColor;
self.roomTopic.textColor = ThemeService.shared.theme.baseTextSecondaryColor;
self.roomMembers.textColor = ThemeService.theme.tintColor;
self.roomMembers.textColor = ThemeService.shared.theme.tintColor;
self.previewLabel.textColor = ThemeService.theme.baseTextSecondaryColor;
self.previewLabel.textColor = ThemeService.shared.theme.baseTextSecondaryColor;
self.previewLabel.numberOfLines = 0;
self.subNoticeLabel.textColor = ThemeService.theme.textSecondaryColor;
self.subNoticeLabel.textColor = ThemeService.shared.theme.textSecondaryColor;
self.subNoticeLabel.numberOfLines = 0;
self.bottomBorderView.backgroundColor = ThemeService.theme.headerBackgroundColor;
self.bottomBorderView.backgroundColor = ThemeService.shared.theme.headerBackgroundColor;
[self.leftButton.layer setCornerRadius:5];
self.leftButton.clipsToBounds = YES;
self.leftButton.backgroundColor = ThemeService.theme.tintColor;
self.leftButton.backgroundColor = ThemeService.shared.theme.tintColor;
[self.rightButton.layer setCornerRadius:5];
self.rightButton.clipsToBounds = YES;
self.rightButton.backgroundColor = ThemeService.theme.tintColor;
self.rightButton.backgroundColor = ThemeService.shared.theme.tintColor;
}
- (void)refreshDisplay
@@ -103,7 +103,7 @@
toFitViewSize:self.roomAvatar.frame.size
withMethod:MXThumbnailingMethodCrop
previewImage:[MXKTools paintImage:[UIImage imageNamed:@"placeholder"]
withColor:ThemeService.theme.tintColor]
withColor:ThemeService.shared.theme.tintColor]
mediaManager:self.mxRoom.mxSession.mediaManager];
}
else
@@ -249,7 +249,7 @@
self.roomAvatar.layer.cornerRadius = self.roomAvatar.frame.size.width / 2;
self.roomAvatar.clipsToBounds = YES;
self.roomAvatar.defaultBackgroundColor = ThemeService.theme.headerBackgroundColor;
self.roomAvatar.defaultBackgroundColor = ThemeService.shared.theme.headerBackgroundColor;
// Force the layout of subviews to update the position of 'bottomBorderView' which is used to define the actual height of the preview container.
[self layoutIfNeeded];
@@ -73,7 +73,7 @@
[super layoutSubviews];
self.roomDetailsIconImageView.image = [MXKTools paintImage:self.roomDetailsIconImageView.image
withColor:ThemeService.theme.tintColor];
withColor:ThemeService.shared.theme.tintColor];
if (self.superview)
{
@@ -138,8 +138,8 @@
[super customizeViewRendering];
// Use same color as navigation bar
self.backgroundColor = ThemeService.theme.baseColor;
self.displayNameTextField.textColor = (self.mxRoom.summary.displayname.length ? ThemeService.theme.baseTextPrimaryColor : ThemeService.theme.textSecondaryColor);
self.backgroundColor = ThemeService.shared.theme.baseColor;
self.displayNameTextField.textColor = (self.mxRoom.summary.displayname.length ? ThemeService.shared.theme.baseTextPrimaryColor : ThemeService.shared.theme.textSecondaryColor);
}
- (void)setRoomPreviewData:(RoomPreviewData *)roomPreviewData
@@ -164,11 +164,11 @@
if (!self.displayNameTextField.text.length)
{
self.displayNameTextField.text = [NSBundle mxk_localizedStringForKey:@"room_displayname_empty_room"];
self.displayNameTextField.textColor = ThemeService.theme.textSecondaryColor;
self.displayNameTextField.textColor = ThemeService.shared.theme.textSecondaryColor;
}
else
{
self.displayNameTextField.textColor = ThemeService.theme.baseTextPrimaryColor;
self.displayNameTextField.textColor = ThemeService.shared.theme.baseTextPrimaryColor;
}
}
}