Skip to content

Commit

Permalink
refactor: Swiftformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu-dgl committed Sep 19, 2024
1 parent 62c9d20 commit 42c92b3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
14 changes: 12 additions & 2 deletions MailCoreUI/Components/AttachmentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ public struct AttachmentView<Content: View>: View {
self.accessory = accessory
}

public init(attachment: Attachment, isDownloading: Bool = false, downloadProgress: Double = 0, accessory: @escaping () -> Content? = { EmptyView() }) {
public init(
attachment: Attachment,
isDownloading: Bool = false,
downloadProgress: Double = 0,
accessory: @escaping () -> Content? = { EmptyView() }
) {
title = attachment.name
subtitle = attachment.size.formatted(.defaultByteCount)
icon = attachment.icon
Expand All @@ -55,7 +60,12 @@ public struct AttachmentView<Content: View>: View {
self.accessory = accessory
}

public init(swissTransferFile: File, isDownloading: Bool = false, downloadProgress: Double = 0, accessory: @escaping () -> Content? = { EmptyView() }) {
public init(
swissTransferFile: File,
isDownloading: Bool = false,
downloadProgress: Double = 0,
accessory: @escaping () -> Content? = { EmptyView() }
) {
title = swissTransferFile.name
subtitle = swissTransferFile.size.formatted(.defaultByteCount)
icon = swissTransferFile.icon
Expand Down
30 changes: 15 additions & 15 deletions MailCoreUI/Components/CircleIndeterminateProgressView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ public struct CircleIndeterminateProgressView: View {
}

public var body: some View {
ZStack {
Circle()
.stroke(lineWidth: 2)
.opacity(0.1)
.foregroundColor(Color.gray)
.frame(height: 15)

Circle()
.trim(from: 0.0, to: min(progress, 1.0))
.stroke(style: StrokeStyle(lineWidth: 2, lineCap: .round, lineJoin: .round))
.foregroundColor(Color.accentColor)
.rotationEffect(Angle(degrees: 270.0))
.animation(.linear, value: progress)
.frame(height: 15)
ZStack {
Circle()
.stroke(lineWidth: 2)
.opacity(0.1)
.foregroundColor(Color.gray)
.frame(height: 15)

Circle()
.trim(from: 0.0, to: min(progress, 1.0))
.stroke(style: StrokeStyle(lineWidth: 2, lineCap: .round, lineJoin: .round))
.foregroundColor(Color.accentColor)
.rotationEffect(Angle(degrees: 270.0))
.animation(.linear, value: progress)
.frame(height: 15)
}
}
}
}

#Preview {
Expand Down

0 comments on commit 42c92b3

Please sign in to comment.