mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
batteria finale, waiting for approve
This commit is contained in:
parent
1d53bbac13
commit
945707425a
9 changed files with 1091 additions and 89 deletions
|
|
@ -97,6 +97,7 @@ struct ExpandedItem {
|
|||
var type: SneakContentType = .battery
|
||||
var value: CGFloat = 0
|
||||
var browser: BrowserType = .chromium
|
||||
var autoHideDuration: TimeInterval? = nil
|
||||
}
|
||||
|
||||
class DynamicIslandViewCoordinator: ObservableObject {
|
||||
|
|
@ -413,7 +414,8 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
status: Bool,
|
||||
type: SneakContentType,
|
||||
value: CGFloat = 0,
|
||||
browser: BrowserType = .chromium
|
||||
browser: BrowserType = .chromium,
|
||||
autoHideDuration: TimeInterval? = nil
|
||||
) {
|
||||
Task { @MainActor in
|
||||
withAnimation(.smooth) {
|
||||
|
|
@ -421,6 +423,7 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
self.expandingView.type = type
|
||||
self.expandingView.value = value
|
||||
self.expandingView.browser = browser
|
||||
self.expandingView.autoHideDuration = autoHideDuration
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -433,7 +436,7 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
expandingViewTask?.cancel()
|
||||
// Only auto-hide for battery, not for downloads (DownloadManager handles that)
|
||||
if expandingView.type != .download {
|
||||
let duration: TimeInterval = 3
|
||||
let duration = expandingView.autoHideDuration ?? 3
|
||||
expandingViewTask = Task { [weak self] in
|
||||
try? await Task.sleep(for: .seconds(duration))
|
||||
guard let self = self, !Task.isCancelled else { return }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue