diff --git a/Modules/ContentKit/Examples/ContentKitExample/Resources/activity.yml b/Modules/ContentKit/Examples/ContentKitExample/Resources/activity.yml index ce582ce4d..e688d403d 100644 --- a/Modules/ContentKit/Examples/ContentKitExample/Resources/activity.yml +++ b/Modules/ContentKit/Examples/ContentKitExample/Resources/activity.yml @@ -25,6 +25,11 @@ locales: - en_US - fr_FR +hmi: + - robot + - magic_cards + - ipad_robot + l10n: - locale: fr_FR details: diff --git a/Modules/ContentKit/Examples/ContentKitExample/Sources/MainView.swift b/Modules/ContentKit/Examples/ContentKitExample/Sources/MainView.swift index 042ed72b2..d985a152a 100644 --- a/Modules/ContentKit/Examples/ContentKitExample/Sources/MainView.swift +++ b/Modules/ContentKit/Examples/ContentKitExample/Sources/MainView.swift @@ -83,6 +83,20 @@ struct MainView: View { } } + DisclosureGroup("**HMI**") { + ForEach(self.activity?.hmi ?? [], id: \.self) { hmi in + let hmi = HMI.hmi(id: hmi)! + HStack { + Text(hmi.name) + Button { + self.selectedHMI = hmi + } label: { + Image(systemName: "info.circle") + } + } + } + } + DisclosureGroup("**Tags**") { ForEach(self.activity?.tags ?? [], id: \.self) { skill in Text(skill) @@ -108,6 +122,13 @@ struct MainView: View { Text(skill.description) } }) + .sheet(item: self.$selectedHMI, onDismiss: { self.selectedHMI = nil }, content: { hmi in + VStack(alignment: .leading) { + Text(hmi.name) + .font(.headline) + Text(hmi.description) + } + }) .onAppear { self.activity = ContentKit.decodeActivity("activity") print(self.activity ?? "not working") @@ -133,6 +154,7 @@ struct MainView: View { // MARK: Private @State private var selectedSkill: Skill? + @State private var selectedHMI: HMIDetails? @State private var activity: Activity? }