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:
Alfonso Grillo
2023-07-26 17:17:41 +02:00
committed by GitHub
parent 99b5bf5150
commit 90ff2df00e
39 changed files with 209 additions and 231 deletions
@@ -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
}
}