mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fixes #296 - Improved bubble timeline item corner radii
This commit is contained in:
committed by
Stefan Ceriu
parent
2bce779206
commit
ce6b0041d2
+21
-13
@@ -23,19 +23,6 @@ enum TimelineItemInGroupState {
|
||||
case middle
|
||||
case end
|
||||
|
||||
var roundedCorners: UIRectCorner {
|
||||
switch self {
|
||||
case .single:
|
||||
return .allCorners
|
||||
case .beginning:
|
||||
return [.topLeft, .topRight]
|
||||
case .middle:
|
||||
return []
|
||||
case .end:
|
||||
return [.bottomLeft, .bottomRight]
|
||||
}
|
||||
}
|
||||
|
||||
var shouldShowSenderDetails: Bool {
|
||||
switch self {
|
||||
case .single, .beginning:
|
||||
@@ -65,4 +52,25 @@ extension EventBasedTimelineItemProtocol {
|
||||
var shouldShowSenderDetails: Bool {
|
||||
inGroupState.shouldShowSenderDetails
|
||||
}
|
||||
|
||||
var roundedCorners: UIRectCorner {
|
||||
switch inGroupState {
|
||||
case .single:
|
||||
return .allCorners
|
||||
case .beginning:
|
||||
if isOutgoing {
|
||||
return [.topLeft, .topRight, .bottomLeft]
|
||||
} else {
|
||||
return [.topLeft, .topRight, .bottomRight]
|
||||
}
|
||||
case .middle:
|
||||
return isOutgoing ? [.topLeft, .bottomLeft] : [.topRight, .bottomRight]
|
||||
case .end:
|
||||
if isOutgoing {
|
||||
return [.topLeft, .bottomLeft, .bottomRight]
|
||||
} else {
|
||||
return [.topRight, .bottomLeft, .bottomRight]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user