mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-02 22:26:59 +02:00
Bug Fix - Chat screen: the vertical offset on encryption icon due to the timestamp
This commit is contained in:
@@ -77,4 +77,39 @@ NSString *const kRoomEncryptedDataBubbleCellTapOnEncryptionIcon = @"kRoomEncrypt
|
||||
return [UIImage imageNamed:encryptionIcon];
|
||||
}
|
||||
|
||||
+ (void)addEncryptionStatusFromBubbleData:(MXKRoomBubbleCellData *)bubbleData inContainerView:(UIView *)containerView
|
||||
{
|
||||
// Ensure that older subviews are removed
|
||||
// They should be (they are removed when the cell is not anymore used).
|
||||
// But, it seems that is not always true.
|
||||
NSArray* views = [containerView subviews];
|
||||
for (UIView* view in views)
|
||||
{
|
||||
[view removeFromSuperview];
|
||||
}
|
||||
|
||||
NSArray *bubbleComponents = bubbleData.bubbleComponents;
|
||||
MXKRoomBubbleComponent *component;
|
||||
|
||||
for (NSUInteger componentIndex; componentIndex < bubbleComponents.count; componentIndex++)
|
||||
{
|
||||
component = bubbleComponents[componentIndex];
|
||||
|
||||
UIImage *icon = [RoomEncryptedDataBubbleCell encryptionIconForEvent:component.event andSession:bubbleData.mxSession];
|
||||
UIImageView *encryptStatusImageView = [[UIImageView alloc] initWithImage:icon];
|
||||
|
||||
CGRect frame = encryptStatusImageView.frame;
|
||||
frame.origin.y = component.position.y + 3;
|
||||
encryptStatusImageView.frame = frame;
|
||||
|
||||
CGPoint center = encryptStatusImageView.center;
|
||||
center.x = containerView.frame.size.width / 2;
|
||||
encryptStatusImageView.center = center;
|
||||
|
||||
encryptStatusImageView.tag = componentIndex;
|
||||
|
||||
[containerView addSubview:encryptStatusImageView];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user