38 lines
1.3 KiB
Swift
38 lines
1.3 KiB
Swift
import SwiftUI
|
|
import RemoteCore
|
|
|
|
struct WatchRemoteDemoView: View {
|
|
@State private var lastCommand = "No TV connected"
|
|
|
|
var body: some View {
|
|
ScrollView {
|
|
VStack(spacing: 8) {
|
|
Text("Wristivo").font(.headline)
|
|
Text("DEMO").font(.caption2).foregroundStyle(.secondary)
|
|
commandButton(.up)
|
|
HStack(spacing: 4) {
|
|
commandButton(.left)
|
|
commandButton(.select)
|
|
commandButton(.right)
|
|
}
|
|
commandButton(.down)
|
|
Text(lastCommand).font(.caption2)
|
|
HStack(spacing: 4) {
|
|
commandButton(.back)
|
|
commandButton(.home)
|
|
}
|
|
Text("Wrist gestures are coming in the hardware prototype.")
|
|
.font(.footnote).foregroundStyle(.secondary)
|
|
}.padding(.horizontal, 4)
|
|
}.tint(.teal)
|
|
}
|
|
|
|
private func commandButton(_ command: RemoteCommand) -> some View {
|
|
Button { lastCommand = "Demo: \(command.title)" } label: {
|
|
Image(systemName: command.symbol).frame(minWidth: 24, minHeight: 30)
|
|
}
|
|
.buttonStyle(.bordered)
|
|
.accessibilityLabel(command.title)
|
|
}
|
|
}
|