mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 09:32:52 +02:00
Fix: default pill icon for an unknown user
This commit is contained in:
@@ -17,12 +17,33 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
@available (iOS 15.0, *)
|
||||
struct PillAssetColor: Codable {
|
||||
var red: CGFloat = 0.0, green: CGFloat = 0.0, blue: CGFloat = 0.0, alpha: CGFloat = 0.0
|
||||
|
||||
var uiColor: UIColor {
|
||||
return UIColor(red: red, green: green, blue: blue, alpha: alpha)
|
||||
}
|
||||
|
||||
init(uiColor: UIColor) {
|
||||
uiColor.getRed(&red, green: &green, blue: &blue, alpha: &alpha)
|
||||
}
|
||||
}
|
||||
|
||||
@available (iOS 15.0, *)
|
||||
struct PillAssetParameter: Codable {
|
||||
var tintColor: PillAssetColor?
|
||||
var backgroundColor: PillAssetColor?
|
||||
var rawRenderingMode: Int = UIImage.RenderingMode.automatic.rawValue
|
||||
var padding: CGFloat = 2.0
|
||||
}
|
||||
|
||||
@available (iOS 15.0, *)
|
||||
enum PillTextAttachmentItem: Codable {
|
||||
case text(String)
|
||||
case avatar(url: String?, string: String?, matrixId: String)
|
||||
case spaceAvatar(url: String?, string: String?, matrixId: String)
|
||||
case asset(named: String)
|
||||
case asset(named: String, parameters: PillAssetParameter)
|
||||
}
|
||||
|
||||
@available (iOS 15.0, *)
|
||||
|
||||
Reference in New Issue
Block a user