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.
session-ios/Session/Shared/LoadingIndicatorView.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
@State private var trim: Double = 0.9
public var body: some View {
GeometryReader { (geometry: GeometryProxy) in
10 months ago
Circle()
.trim(from: 0, to: trim)
10 months ago
.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
10 months ago
.timingCurve(0.5, 1, 0.25, 1, duration: 1.5)
.repeatForever(autoreverses: false)
)
}
.aspectRatio(1, contentMode: .fit)
.onAppear {
self.isAnimating = true
}
}
}