mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Controls layouts, gestures and settings
This commit is contained in:
27
Shared/Player/Controls/ProgressBar.swift
Normal file
27
Shared/Player/Controls/ProgressBar.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ProgressBar: View {
|
||||
var value: Double
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geometry in
|
||||
ZStack(alignment: .leading) {
|
||||
Rectangle().frame(width: geometry.size.width, height: geometry.size.height)
|
||||
.opacity(0.3)
|
||||
.foregroundColor(Color.secondary)
|
||||
|
||||
Rectangle().frame(width: min(CGFloat(self.value) * geometry.size.width, geometry.size.width), height: geometry.size.height)
|
||||
.foregroundColor(Color.accentColor)
|
||||
.animation(.linear)
|
||||
}.cornerRadius(45.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct ProgressBar_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ProgressBar(value: 0.5)
|
||||
.frame(maxHeight: 6)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user