mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 15:44:32 +00:00
Working Timer, need to enable fulscreen mode
This commit is contained in:
parent
628d76b41c
commit
19b1977fa8
13 changed files with 937 additions and 7 deletions
|
|
@ -18,6 +18,7 @@ enum SneakContentType {
|
|||
case mic
|
||||
case battery
|
||||
case download
|
||||
case timer
|
||||
}
|
||||
|
||||
struct sneakPeek {
|
||||
|
|
@ -58,6 +59,7 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
@AppStorage("firstLaunch") var firstLaunch: Bool = true
|
||||
@AppStorage("showWhatsNew") var showWhatsNew: Bool = true
|
||||
@AppStorage("musicLiveActivityEnabled") var musicLiveActivityEnabled: Bool = true
|
||||
@AppStorage("timerLiveActivityEnabled") var timerLiveActivityEnabled: Bool = true
|
||||
@AppStorage("currentMicStatus") var currentMicStatus: Bool = true
|
||||
|
||||
@AppStorage("alwaysShowTabs") var alwaysShowTabs: Bool = true {
|
||||
|
|
@ -109,7 +111,7 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
@objc func sneakPeekEvent(_ notification: Notification) {
|
||||
let decoder = JSONDecoder()
|
||||
if let decodedData = try? decoder.decode(SharedSneakPeek.self, from: notification.userInfo?.first?.value as! Data) {
|
||||
let contentType = decodedData.type == "brightness" ? SneakContentType.brightness : decodedData.type == "volume" ? SneakContentType.volume : decodedData.type == "backlight" ? SneakContentType.backlight : decodedData.type == "mic" ? SneakContentType.mic : SneakContentType.brightness
|
||||
let contentType = decodedData.type == "brightness" ? SneakContentType.brightness : decodedData.type == "volume" ? SneakContentType.volume : decodedData.type == "backlight" ? SneakContentType.backlight : decodedData.type == "mic" ? SneakContentType.mic : decodedData.type == "timer" ? SneakContentType.timer : SneakContentType.brightness
|
||||
|
||||
let value = CGFloat((NumberFormatter().number(from: decodedData.value) ?? 0.0).floatValue)
|
||||
let icon = decodedData.icon
|
||||
|
|
@ -125,7 +127,7 @@ class DynamicIslandViewCoordinator: ObservableObject {
|
|||
|
||||
func toggleSneakPeek(status: Bool, type: SneakContentType, duration: TimeInterval = 1.5, value: CGFloat = 0, icon: String = "") {
|
||||
sneakPeekDuration = duration
|
||||
if type != .music {
|
||||
if type != .music && type != .timer {
|
||||
// close()
|
||||
if !hudReplacement {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue