-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ (ContentKitxUIExplorer): Add Pairing activity
- Loading branch information
Showing
6 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
Apps/LekaActivityUIExplorer/Resources/GEKNewSystem/activities/activity-pairing.yml
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,22 @@ | ||
# Leka - iOS Monorepo | ||
# Copyright 2023 APF France handicap | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
id: 834779ede3324f44a38163159edc15c0 | ||
name: Pairing | ||
description: L'objectif est de découvrir Leka et s'habituer à ses réactions | ||
image: activity_color_recognition_1 | ||
sequence: | ||
- exercises: | ||
- instructions: Observe Leka | ||
interface: pairing | ||
payload: | ||
instructions: | ||
text_main_instructions: | | ||
Le mode Pairing permet à la personne accompagnée de se familiariser à Leka | ||
avant même d'entrer dans les apprentissages des Activités et des Parcours. | ||
Le robot va s'animer en faisant des pauses afin que la personne accompagnée puisse | ||
apprivoiser son nouveau compagnon ! | ||
text_button_play: Jouer | ||
text_button_pause: Pause | ||
text_button_stop: Stop |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,6 @@ public extension Exercise { | |
case hideAndSeek | ||
case musicalInstruments | ||
case melody | ||
case pairing | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
Modules/ContentKit/Sources/Exercise/Exercise+Pairing.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,73 @@ | ||
// Leka - iOS Monorepo | ||
// Copyright 2023 APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// MARK: - Pairing | ||
|
||
// swiftlint:disable nesting | ||
|
||
public enum Pairing { | ||
public struct Payload: Codable { | ||
// MARK: Lifecycle | ||
|
||
public init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
self.instructions = try container.decode(Instructions.self, forKey: .instructions) | ||
} | ||
|
||
// MARK: Public | ||
|
||
public let instructions: Instructions | ||
|
||
// MARK: Internal | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case instructions | ||
} | ||
} | ||
} | ||
|
||
// MARK: - Pairing.Payload.Instructions | ||
|
||
public extension Pairing.Payload { | ||
struct Instructions: Codable { | ||
// MARK: Lifecycle | ||
|
||
public init( | ||
textMainInstructions: String, textButtonPlay: String, textButtonPause: String, | ||
textButtonStop: String | ||
) { | ||
self.textMainInstructions = textMainInstructions | ||
self.textButtonPlay = textButtonPlay | ||
self.textButtonPause = textButtonPause | ||
self.textButtonStop = textButtonStop | ||
} | ||
|
||
public init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
|
||
self.textMainInstructions = try container.decode(String.self, forKey: .textMainInstructions) | ||
self.textButtonPlay = try container.decode(String.self, forKey: .textButtonPlay) | ||
self.textButtonPause = try container.decode(String.self, forKey: .textButtonPause) | ||
self.textButtonStop = try container.decode(String.self, forKey: .textButtonStop) | ||
} | ||
|
||
// MARK: Public | ||
|
||
public let textMainInstructions: String | ||
public let textButtonPlay: String | ||
public let textButtonPause: String | ||
public let textButtonStop: String | ||
|
||
// MARK: Internal | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case textMainInstructions = "text_main_instructions" | ||
case textButtonPlay = "text_button_play" | ||
case textButtonPause = "text_button_pause" | ||
case textButtonStop = "text_button_stop" | ||
} | ||
} | ||
} | ||
|
||
// swiftlint:enable nesting |
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