feat(settings): 默认启用短动效并提供独立减弱动画选项
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
import SwiftUI
|
||||
|
||||
/// Static numbers avoid per-sample glyph rasterization and transition caches.
|
||||
/// Short numeric transitions follow the owner-supplied motion policy.
|
||||
struct AnimatedMetricText: View {
|
||||
let value: String
|
||||
@Environment(\.metricAnimationsEnabled) private var animates
|
||||
|
||||
var body: some View {
|
||||
Text(verbatim: value)
|
||||
.monospacedDigit()
|
||||
if animates {
|
||||
Text(verbatim: value).monospacedDigit()
|
||||
.contentTransition(.opacity)
|
||||
.animation(.easeInOut(duration: MetricMotion.duration), value: value)
|
||||
} else {
|
||||
Text(verbatim: value).monospacedDigit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user