mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Refactor TimelineItemBubbledStylerView for polls (#1404)
* Refactor bubble bg colors and insets * Improve MapLibreStaticMapView layout * Add BubbleTimestampLayout * Refactor BubbleTimestampLayoutType * Refine .horizontal, .vertical layouts * Rename layout type * Add docs * Restore LocationRoomTimelineItem body * Refactor whitespaces * Fix background color for LocationRoomTimelineView. * Fix UTs * Fix analytics ui tests * Fix bug report tests * Fix settings ui tests * Rename private property * Record room screen tests
This commit is contained in:
@@ -53,4 +53,31 @@ extension EventBasedTimelineItemProtocol {
|
||||
var hasFailedDecryption: Bool {
|
||||
self is EncryptedRoomTimelineItem
|
||||
}
|
||||
|
||||
func additionalWhitespaces(timelineStyle: TimelineStyle) -> Int {
|
||||
guard timelineStyle == .bubbles else {
|
||||
return 0
|
||||
}
|
||||
var whiteSpaces = 1
|
||||
localizedSendInfo.forEach { _ in
|
||||
whiteSpaces += 1
|
||||
}
|
||||
|
||||
// To account for the extra spacing created by the alert icon
|
||||
if hasFailedToSend {
|
||||
whiteSpaces += 3
|
||||
}
|
||||
|
||||
return whiteSpaces
|
||||
}
|
||||
|
||||
/// contains the timestamp and an optional edited localised prefix
|
||||
/// example: (edited) 12:17 PM
|
||||
var localizedSendInfo: String {
|
||||
var start = ""
|
||||
if properties.isEdited {
|
||||
start = "\(L10n.commonEditedSuffix) "
|
||||
}
|
||||
return start + timestamp
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user