mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
MESSENGER-5208 and 5220 us09 and us04
This commit is contained in:
@@ -46,6 +46,32 @@
|
||||
// Disable by default interactions defined in the cell
|
||||
// because we want [tableView didSelectRowAtIndexPath:] to be called
|
||||
self.thumbnailView.userInteractionEnabled = NO;
|
||||
|
||||
// BWI: 5208 add federation icon
|
||||
if ([ThemeService.shared isCurrentThemeDark])
|
||||
{
|
||||
self.federationImage = AssetImages.roomFederatedBumIconDark.image;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.federationImage = AssetImages.roomFederatedBumIconLight.image;
|
||||
}
|
||||
self.federationImageView = [[UIImageView alloc] initWithImage:self.federationImage];
|
||||
self.federationImageView.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
self.federationImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
[self.contentView addSubview:self.federationImageView];
|
||||
|
||||
// scale and new with federation icon
|
||||
float scaleFactor = ((self.thumbnailView.frame.size.height * 0.34) / self.federationImage.size.height);
|
||||
float imageWidth = scaleFactor * self.federationImage.size.width;
|
||||
// offset federation icon
|
||||
float offsetTrailing = 3 * scaleFactor;
|
||||
float offsetBotom = 1;
|
||||
|
||||
[self.federationImageView.bottomAnchor constraintEqualToAnchor:self.thumbnailView.bottomAnchor constant:offsetBotom].active = YES;
|
||||
[self.federationImageView.trailingAnchor constraintEqualToAnchor:self.thumbnailView.trailingAnchor constant:offsetTrailing].active = YES;
|
||||
[self.federationImageView.heightAnchor constraintEqualToConstant:(self.thumbnailView.frame.size.height * 0.34)].active = YES;
|
||||
[self.federationImageView.widthAnchor constraintEqualToConstant:imageWidth].active = YES;
|
||||
}
|
||||
|
||||
- (void)customizeTableViewCellRendering
|
||||
@@ -69,6 +95,17 @@
|
||||
// Round image view
|
||||
self.thumbnailView.layer.cornerRadius = self.thumbnailView.frame.size.width / 2;
|
||||
self.thumbnailView.clipsToBounds = YES;
|
||||
|
||||
// BWI: 5208 add federation icon
|
||||
if ([ThemeService.shared isCurrentThemeDark])
|
||||
{
|
||||
self.federationImage = AssetImages.roomFederatedBumIconDark.image;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.federationImage = AssetImages.roomFederatedBumIconLight.image;
|
||||
}
|
||||
self.federationImageView.image = self.federationImage;
|
||||
}
|
||||
|
||||
- (void)prepareForReuse
|
||||
@@ -142,6 +179,16 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// BWI: 5208 add federation icon
|
||||
if (BWIBuildSettings.shared.isFederationEnabled)
|
||||
{
|
||||
self.federationImageView.hidden = !contact.bwiIsFederated;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.federationImageView.hidden = YES;
|
||||
}
|
||||
|
||||
// Be warned when the thumbnail is updated
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onThumbnailUpdate:) name:kMXKContactThumbnailUpdateNotification object:nil];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user