mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-29 04:36:58 +02:00
MESSENGER-5204 fix federation pill appearance
This commit is contained in:
@@ -64,6 +64,8 @@ class RoomInfoBasicView: UIView {
|
||||
@IBOutlet private weak var securityInformationLabel: UILabel!
|
||||
|
||||
private var pillImageView: UIImageView?
|
||||
private var roomDisplayName: String?
|
||||
private var isRoomFederated: Bool = false
|
||||
|
||||
/// Block to be invoked when topic text view changes its content size.
|
||||
var onTopicSizeChange: ((RoomInfoBasicView) -> Void)?
|
||||
@@ -110,6 +112,8 @@ class RoomInfoBasicView: UIView {
|
||||
|
||||
// bwi: 5216 - federation
|
||||
if BWIBuildSettings.shared.isFederationEnabled && viewData.isFederated {
|
||||
isRoomFederated = true
|
||||
self.roomDisplayName = viewData.roomDisplayName
|
||||
// add imageview for the pill if it doesn't exist
|
||||
if pillImageView == nil {
|
||||
let imageView = FederationIconHelper.shared.getFederatedIconImageView(avatarFrame: avatarImageView.frame)
|
||||
@@ -122,6 +126,7 @@ class RoomInfoBasicView: UIView {
|
||||
roomNameLabel.attributedText = FederationIconHelper.shared.roomNameWithFederationPill(roomDisplayName: viewData.roomDisplayName, font: roomNameLabel.font)
|
||||
} else {
|
||||
roomNameLabel.text = viewData.roomDisplayName
|
||||
isRoomFederated = false
|
||||
}
|
||||
|
||||
roomNameLabel.numberOfLines = 0
|
||||
@@ -219,6 +224,16 @@ extension RoomInfoBasicView: Themable {
|
||||
securityTitleLabel.textColor = theme.textSecondaryColor
|
||||
securityInformationLabel.textColor = theme.textPrimaryColor
|
||||
presenceIndicatorView.borderColor = theme.headerBackgroundColor
|
||||
|
||||
// bwi: 5216 - federation
|
||||
if BWIBuildSettings.shared.isFederationEnabled && isRoomFederated {
|
||||
if pillImageView != nil {
|
||||
pillImageView?.image = FederationIconHelper.shared.federationBadgeImage()
|
||||
}
|
||||
if let roomDisplayName = self.roomDisplayName {
|
||||
roomNameLabel.attributedText = FederationIconHelper.shared.roomNameWithFederationPill(roomDisplayName: roomDisplayName, font: roomNameLabel.font)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user