Reskin: Factorise *RoomTitleViews

and apply them kRiotDesignNavigationBarBarTintColor as background color to mimic the nav bar color
This commit is contained in:
manuroe
2018-11-29 17:47:42 +01:00
parent 5beaa454db
commit 36ec1409d4
4 changed files with 9 additions and 57 deletions
@@ -38,7 +38,6 @@
{
[super customizeViewRendering];
self.displayNameTextField.textColor = (self.mxRoom.summary.displayname.length ? kRiotPrimaryTextColor : kRiotSecondaryTextColor);
self.roomTopic.textColor = kRiotTopicTextColor;
self.roomMembers.textColor = kRiotColorGreen;
}
@@ -51,17 +50,6 @@
{
[self.mxRoom.summary setRoomAvatarImageIn:self.roomAvatar];
self.displayNameTextField.text = self.mxRoom.summary.displayname;
if (!self.displayNameTextField.text.length)
{
self.displayNameTextField.text = [NSBundle mxk_localizedStringForKey:@"room_displayname_empty_room"];
self.displayNameTextField.textColor = kRiotSecondaryTextColor;
}
else
{
self.displayNameTextField.textColor = kRiotPrimaryTextColor;
}
self.roomTopic.text = [MXTools stripNewlineCharacters:self.mxRoom.summary.topic];
// Compute active members count
@@ -61,11 +61,10 @@
-(void)customizeViewRendering
{
[super customizeViewRendering];
self.backgroundColor = kRiotPrimaryBgColor;
self.mainHeaderBackground.backgroundColor = kRiotSecondaryBgColor;
self.displayNameTextField.textColor = (self.mxRoom.summary.displayname.length ? kRiotPrimaryTextColor : kRiotSecondaryTextColor);
// Use same color as navigation bar
self.mainHeaderBackground.backgroundColor = kRiotDesignNavigationBarBarTintColor;
self.roomTopic.textColor = kRiotTopicTextColor;
@@ -173,18 +172,6 @@
{
[self.mxRoom.summary setRoomAvatarImageIn:self.roomAvatar];
// The user is here invited to join a room (This invitation has been received from server sync)
self.displayNameTextField.text = self.mxRoom.summary.displayname;
if (!self.displayNameTextField.text.length)
{
self.displayNameTextField.text = [NSBundle mxk_localizedStringForKey:@"room_displayname_empty_room"];
self.displayNameTextField.textColor = kRiotSecondaryTextColor;
}
else
{
self.displayNameTextField.textColor = kRiotPrimaryTextColor;
}
// Display room topic
self.roomTopic.text = [MXTools stripNewlineCharacters:self.mxRoom.summary.topic];
@@ -132,8 +132,10 @@
-(void)customizeViewRendering
{
[super customizeViewRendering];
self.displayNameTextField.textColor = (self.mxRoom.summary.displayname.length ? kRiotPrimaryTextColor : kRiotSecondaryTextColor);
// Use same color as navigation bar
self.backgroundColor = kRiotDesignNavigationBarBarTintColor;
self.displayNameTextField.textColor = (self.mxRoom.summary.displayname.length ? kRiotDesignNavigationBarTintColor : kRiotSecondaryTextColor);
}
- (void)setRoomPreviewData:(RoomPreviewData *)roomPreviewData
@@ -162,7 +164,7 @@
}
else
{
self.displayNameTextField.textColor = kRiotPrimaryTextColor;
self.displayNameTextField.textColor = kRiotDesignNavigationBarTintColor;
}
}
}
@@ -87,30 +87,5 @@
}
}
-(void)customizeViewRendering
{
[super customizeViewRendering];
self.displayNameTextField.textColor = (self.mxRoom.summary.displayname.length ? kRiotPrimaryTextColor : kRiotSecondaryTextColor);
}
- (void)refreshDisplay
{
[super refreshDisplay];
if (self.mxRoom)
{
self.displayNameTextField.text = self.mxRoom.summary.displayname;
if (!self.displayNameTextField.text.length)
{
self.displayNameTextField.text = [NSBundle mxk_localizedStringForKey:@"room_displayname_empty_room"];
self.displayNameTextField.textColor = kRiotSecondaryTextColor;
}
else
{
self.displayNameTextField.textColor = kRiotPrimaryTextColor;
}
}
}
@end