mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 15:44:32 +00:00
just 2 small features
This commit is contained in:
parent
bbba30551d
commit
53f8b297c9
9 changed files with 139 additions and 4 deletions
|
|
@ -24,6 +24,7 @@ enum SneakContentType {
|
|||
case bluetoothAudio
|
||||
case privacy
|
||||
case lockScreen
|
||||
case capsLock
|
||||
}
|
||||
|
||||
struct sneakPeek {
|
||||
|
|
@ -190,7 +191,7 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
return
|
||||
}
|
||||
DispatchQueue.main.async {
|
||||
withAnimation(.smooth) {
|
||||
withAnimation(.smooth(duration: 0.3)) {
|
||||
self.sneakPeek.show = status
|
||||
self.sneakPeek.type = type
|
||||
self.sneakPeek.value = value
|
||||
|
|
@ -205,6 +206,9 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
// Helper function to manage sneakPeek timer using Swift Concurrency
|
||||
private func scheduleSneakPeekHide(after duration: TimeInterval) {
|
||||
sneakPeekTask?.cancel()
|
||||
|
||||
// Don't schedule auto-hide if duration is infinite (for persistent indicators like Caps Lock)
|
||||
guard duration.isFinite else { return }
|
||||
|
||||
sneakPeekTask = Task { [weak self] in
|
||||
try? await Task.sleep(for: .seconds(duration))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue