mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Sneak peek is a bit issue
This commit is contained in:
parent
27b16a3d15
commit
88692a241a
3 changed files with 44 additions and 21 deletions
|
|
@ -344,12 +344,37 @@ struct ExtensionInlineSneakPeekView: View {
|
|||
@ViewBuilder
|
||||
private var trailingWing: some View {
|
||||
if let payload {
|
||||
ExtensionMusicWingView(
|
||||
payload: payload,
|
||||
notchHeight: contentHeight,
|
||||
trailingWidth: trailingWidth
|
||||
)
|
||||
let descriptor = payload.descriptor
|
||||
switch resolvedExtensionTrailingRenderable(for: descriptor) {
|
||||
case let .content(content):
|
||||
if case .none = content {
|
||||
spectrumPlaceholder
|
||||
} else {
|
||||
VStack(alignment: .trailing, spacing: 6) {
|
||||
ExtensionEdgeContentView(
|
||||
content: content,
|
||||
accent: resolvedAccent,
|
||||
availableWidth: trailingWidth,
|
||||
alignment: .trailing
|
||||
)
|
||||
.frame(maxWidth: .infinity, alignment: .trailing)
|
||||
|
||||
Spacer(minLength: 0)
|
||||
}
|
||||
.padding(.trailing, 8)
|
||||
.padding(.vertical, 6)
|
||||
}
|
||||
case .indicator:
|
||||
spectrumPlaceholder
|
||||
}
|
||||
} else {
|
||||
spectrumPlaceholder
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var spectrumPlaceholder: some View {
|
||||
VStack {
|
||||
Rectangle()
|
||||
.fill(resolvedAccent.gradient)
|
||||
.mask {
|
||||
|
|
@ -358,5 +383,8 @@ struct ExtensionInlineSneakPeekView: View {
|
|||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
|
||||
.padding(.trailing, 8)
|
||||
.padding(.vertical, 6)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -318,10 +318,13 @@ struct ExtensionProgressIndicatorView: View {
|
|||
.monospacedDigit()
|
||||
case let .countdown(font, color):
|
||||
let textColor = color?.swiftUIColor ?? accent
|
||||
Text(countdownText)
|
||||
let text = countdownText
|
||||
Text(text)
|
||||
.font(font.swiftUIFont())
|
||||
.foregroundStyle(textColor)
|
||||
.monospacedDigit()
|
||||
.contentTransition(.numericText())
|
||||
.animation(.smooth(duration: 0.25), value: text)
|
||||
case .lottie:
|
||||
Image(systemName: "sparkles")
|
||||
.font(.system(size: 14, weight: .medium))
|
||||
|
|
@ -418,10 +421,13 @@ struct ExtensionCountdownTextView: View {
|
|||
|
||||
var body: some View {
|
||||
TimelineView(.periodic(from: .now, by: 1)) { context in
|
||||
Text(formattedRemaining(since: context.date))
|
||||
let remainingText = formattedRemaining(since: context.date)
|
||||
Text(remainingText)
|
||||
.font(font.swiftUIFont())
|
||||
.foregroundStyle(customColor ?? accent)
|
||||
.monospacedDigit()
|
||||
.contentTransition(.numericText())
|
||||
.animation(.smooth(duration: 0.25), value: remainingText)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue