-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
417 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
nightguard WatchKit Extension/ActionButtonController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// ActionController.swift | ||
// nightguard WatchKit Extension | ||
// | ||
// Created by Dirk Hermanns on 05.10.20. | ||
// Copyright © 2020 private. All rights reserved. | ||
// | ||
|
||
import WatchKit | ||
import Foundation | ||
import SwiftUI | ||
|
||
class ActionButtonController: WKHostingController<ActionButtonView> { | ||
override var body: ActionButtonView { | ||
return ActionButtonView() | ||
} | ||
} | ||
|
||
struct ActionButtonController_Previews: PreviewProvider { | ||
static var previews: some View { | ||
/*@START_MENU_TOKEN@*/Text("Hello, World!")/*@END_MENU_TOKEN@*/ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// ContentView.swift | ||
// nightguard WatchKit Extension | ||
// | ||
// Created by Dirk Hermanns on 08.09.20. | ||
// Copyright © 2020 private. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import SpriteKit | ||
import Combine | ||
|
||
struct ActionButtonView: View { | ||
|
||
@State private var snoozeModalIsPresented = false | ||
|
||
init() {} | ||
|
||
var body: some View { | ||
VStack() { | ||
HStack(spacing: 5, content: { | ||
if #available(watchOSApplicationExtension 7.0, *) { | ||
Button("Snooze", action: { | ||
self.snoozeModalIsPresented.toggle() | ||
}).fullScreenCover(isPresented: self.$snoozeModalIsPresented, content: { | ||
SnoozeModalView(isPresented: self.$snoozeModalIsPresented) | ||
}) | ||
} | ||
Button("Aktualisieren", action: { | ||
print("Button") | ||
}) | ||
}) | ||
} | ||
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) | ||
.edgesIgnoringSafeArea(.bottom) | ||
.focusable(false) | ||
} | ||
} | ||
|
||
struct ActionButtonView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
ContentView(mainViewModel: MainViewModel()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.