mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
Swift
37 lines
1.1 KiB
Swift
// Copyright © 2023 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import SwiftUI
|
|
|
|
public struct ActivityIndicator: View {
|
|
@State private var isAnimating: Bool = false
|
|
|
|
public var body: some View {
|
|
GeometryReader { (geometry: GeometryProxy) in
|
|
Circle()
|
|
.trim(from: 0, to: 0.9)
|
|
.stroke(
|
|
themeColor: .borderSeparator,
|
|
style: StrokeStyle(
|
|
lineWidth: 2,
|
|
lineCap: .round
|
|
)
|
|
)
|
|
.frame(
|
|
width: geometry.size.width,
|
|
height: geometry.size.height
|
|
)
|
|
.
|
|
.rotationEffect(!self.isAnimating ? .degrees(0) : .degrees(360))
|
|
.animation(Animation
|
|
.timingCurve(0.5, 1, 0.25, 1, duration: 1.5)
|
|
.repeatForever(autoreverses: false)
|
|
)
|
|
}
|
|
.aspectRatio(1, contentMode: .fit)
|
|
.onAppear {
|
|
self.isAnimating = true
|
|
}
|
|
}
|
|
}
|
|
|