mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Update files following swiftformat upgrade
This commit is contained in:
committed by
Stefan Ceriu
parent
fe189fcfed
commit
23062901c0
@@ -31,8 +31,8 @@ struct LongPressWithFeedback: ViewModifier {
|
||||
})
|
||||
}
|
||||
|
||||
// The gesture's minimum duration doesn't actually invoke the perform block when elapsed (thus
|
||||
// the implementation below) but it does cancel other system gestures e.g. swipe to reply
|
||||
/// The gesture's minimum duration doesn't actually invoke the perform block when elapsed (thus
|
||||
/// the implementation below) but it does cancel other system gestures e.g. swipe to reply
|
||||
private func handleLongPress(isPressing: Bool) {
|
||||
isLongPressing = isPressing
|
||||
|
||||
@@ -56,7 +56,6 @@ struct LongPressWithFeedback: ViewModifier {
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private func mainContent(content: Content) -> some View {
|
||||
content
|
||||
.compositingGroup() // Apply the shadow to the view as a whole.
|
||||
@@ -76,7 +75,9 @@ extension View {
|
||||
}
|
||||
|
||||
struct LongPressWithFeedback_Previews: PreviewProvider, TestablePreview {
|
||||
static var previews: some View { Preview() }
|
||||
static var previews: some View {
|
||||
Preview()
|
||||
}
|
||||
|
||||
struct Preview: View {
|
||||
private let viewModel = TimelineViewModel.mock
|
||||
@@ -123,12 +124,14 @@ struct LongPressWithFeedback_Previews: PreviewProvider, TestablePreview {
|
||||
}
|
||||
}
|
||||
|
||||
// Fixes the issue on iOS 18 where LongPress conflicts with the scroll view
|
||||
// https://github.com/feedback-assistant/reports/issues/542#issuecomment-2581322968
|
||||
/// Fixes the issue on iOS 18 where LongPress conflicts with the scroll view
|
||||
/// https://github.com/feedback-assistant/reports/issues/542#issuecomment-2581322968
|
||||
private struct LongPressGestureRepresentable: UIGestureRecognizerRepresentable {
|
||||
var handle: (UILongPressGestureRecognizer) -> Void
|
||||
|
||||
func makeCoordinator(converter: CoordinateSpaceConverter) -> Coordinator { .init() }
|
||||
func makeCoordinator(converter: CoordinateSpaceConverter) -> Coordinator {
|
||||
.init()
|
||||
}
|
||||
|
||||
func makeUIGestureRecognizer(context: Context) -> UILongPressGestureRecognizer {
|
||||
let gesture = UILongPressGestureRecognizer()
|
||||
|
||||
@@ -6,9 +6,8 @@
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct ThreadDecorator: View {
|
||||
var body: some View {
|
||||
|
||||
@@ -12,7 +12,6 @@ private struct TimelineItemAccessibilityModifier: ViewModifier {
|
||||
let timelineItem: RoomTimelineItemProtocol
|
||||
let action: () -> Void
|
||||
|
||||
@ViewBuilder
|
||||
func body(content: Content) -> some View {
|
||||
switch timelineItem {
|
||||
case is PollRoomTimelineItem:
|
||||
|
||||
@@ -18,8 +18,14 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
|
||||
let adjustedDeliveryStatus: TimelineItemDeliveryStatus?
|
||||
@ViewBuilder let content: () -> Content
|
||||
|
||||
private var isDirectOneToOneRoom: Bool { context.viewState.isDirectOneToOneRoom }
|
||||
private var isFocussed: Bool { focussedEventID != nil && timelineItem.id.eventID == focussedEventID }
|
||||
private var isDirectOneToOneRoom: Bool {
|
||||
context.viewState.isDirectOneToOneRoom
|
||||
}
|
||||
|
||||
private var isFocussed: Bool {
|
||||
focussedEventID != nil && timelineItem.id.eventID == focussedEventID
|
||||
}
|
||||
|
||||
private var isPinned: Bool {
|
||||
guard context.viewState.timelineKind != .pinned,
|
||||
let eventID = timelineItem.id.eventID else {
|
||||
@@ -179,7 +185,6 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
|
||||
color: timelineItem.bubbleBackgroundColor)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
var contentWithReply: some View {
|
||||
TimelineBubbleLayout(spacing: 8) {
|
||||
if !context.viewState.timelineKind.isThread, timelineItem.properties.isThreaded {
|
||||
|
||||
@@ -96,7 +96,6 @@ private struct TimelineItemSendInfoLabel: View {
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
var content: some View {
|
||||
HStack(spacing: 4) {
|
||||
Text(sendInfo.localizedString)
|
||||
|
||||
@@ -49,7 +49,6 @@ struct TimelineStyler<Content: View>: View {
|
||||
.animation(.elementDefault, value: adjustedDeliveryStatus)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
var mainContent: some View {
|
||||
TimelineItemBubbledStylerView(timelineItem: timelineItem, adjustedDeliveryStatus: adjustedDeliveryStatus, content: content)
|
||||
}
|
||||
@@ -99,14 +98,13 @@ struct TimelineItemStyler_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
static let sentLast: TextRoomTimelineItem = {
|
||||
let id = viewModel.state.timelineState.uniqueIDs.last ?? .init(UUID().uuidString)
|
||||
let result = TextRoomTimelineItem(id: .event(uniqueID: id, eventOrTransactionID: .eventID(UUID().uuidString)),
|
||||
timestamp: .mock,
|
||||
isOutgoing: true,
|
||||
isEditable: false,
|
||||
canBeRepliedTo: true,
|
||||
sender: .test,
|
||||
content: .init(body: "Test"))
|
||||
return result
|
||||
return TextRoomTimelineItem(id: .event(uniqueID: id, eventOrTransactionID: .eventID(UUID().uuidString)),
|
||||
timestamp: .mock,
|
||||
isOutgoing: true,
|
||||
isEditable: false,
|
||||
canBeRepliedTo: true,
|
||||
sender: .test,
|
||||
content: .init(body: "Test"))
|
||||
}()
|
||||
|
||||
static let ltrString = TextRoomTimelineItem(id: .randomEvent,
|
||||
|
||||
Reference in New Issue
Block a user