Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hugo/feature/Refactor TTS to new UIModel system #1659

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Leka - iOS Monorepo
// Copyright APF France handicap
// SPDX-License-Identifier: Apache-2.0

import GameEngineKit
import SwiftUI

struct ActionThenDnDGridExercises: View {
var body: some View {
Text("Action Then DnD Grid")
.font(.title)
.padding()
ScrollView(.horizontal) {
HStack(spacing: 20) {
NavigationLink {
let gameplay = NewGameplayAssociateCategories(choices: NewGameplayAssociateCategories.kDefaultChoices)
let coordinator = DnDGridCoordinatorAssociateCategories(gameplay: gameplay,
action: .ipad(type: .image("sport_dance_player_man")))
let viewModel = DnDGridViewModel(coordinator: coordinator)

return DnDGridView(viewModel: viewModel)
.navigationTitle("Observe Image")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Observe Image & Associate", color: .yellow)
}

NavigationLink {
let gameplay = NewGameplayAssociateCategories(choices: NewGameplayAssociateCategories.kDefaultChoices)
let coordinator = DnDGridCoordinatorAssociateCategories(gameplay: gameplay, action: .ipad(type: .sfsymbol("star")))
let viewModel = DnDGridViewModel(coordinator: coordinator)

return DnDGridView(viewModel: viewModel)
.navigationTitle("Observe SFSymbol")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Observe SFSymbol & Associate", color: .yellow)
}

NavigationLink {
let gameplay = NewGameplayAssociateCategories(choices: NewGameplayAssociateCategories.kDefaultChoices)
let coordinator = DnDGridCoordinatorAssociateCategories(gameplay: gameplay,
action: .ipad(type: .audio("sound_animal_duck")))
let viewModel = DnDGridViewModel(coordinator: coordinator)

return DnDGridView(viewModel: viewModel)
.navigationTitle("Listen Audio")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Listen Audio & Associate", color: .yellow)
}

NavigationLink {
let gameplay = NewGameplayAssociateCategories(choices: NewGameplayAssociateCategories.kDefaultImageChoices)
let coordinator = DnDGridCoordinatorAssociateCategories(gameplay: gameplay,
action: .ipad(type: .speech("Correct answer")))
let viewModel = DnDGridViewModel(coordinator: coordinator)

return DnDGridView(viewModel: viewModel)
.navigationTitle("Listen Speech")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Listen Speech & Associate", color: .yellow)
}

NavigationLink {
let gameplay = NewGameplayAssociateCategories(choices: NewGameplayAssociateCategories.kDefaultChoices)
let coordinator = DnDGridCoordinatorAssociateCategories(gameplay: gameplay, action: .robot(type: .color("yellow")))
let viewModel = DnDGridViewModel(coordinator: coordinator)

return DnDGridView(viewModel: viewModel)
.navigationTitle("Robot")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Robot & Associate", color: .yellow)
}
}
}
}
}

#Preview {
ActionThenDnDGridExercises()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Leka - iOS Monorepo
// Copyright APF France handicap
// SPDX-License-Identifier: Apache-2.0

import GameEngineKit
import SwiftUI

struct ActionThenDnDGridWithZoneExercises: View {
var body: some View {
Text("Action Then DnD Grid With Zones")
.font(.title)
.padding()
ScrollView(.horizontal) {
HStack(spacing: 20) {
NavigationLink {
let gameplay = NewGameplayAssociateCategories(choices: NewGameplayAssociateCategories.kDefaultImageChoicesWithZones)
let coordinator = DnDGridWithZonesCoordinatorAssociateCategories(gameplay: gameplay,
action: .ipad(type: .image("sport_dance_player_man")))
let viewModel = DnDGridWithZonesViewModel(coordinator: coordinator)

return DnDGridWithZonesView(viewModel: viewModel)
.navigationTitle("Observe Image Then Drag & Drop Grid With Zones")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Observe Image & Associate", color: .orange)
}

NavigationLink {
let gameplay = NewGameplayAssociateCategories(choices: NewGameplayAssociateCategories.kDefaultChoicesWithZones)
let coordinator = DnDGridWithZonesCoordinatorAssociateCategories(gameplay: gameplay,
action: .ipad(type: .sfsymbol("star")))
let viewModel = DnDGridWithZonesViewModel(coordinator: coordinator)

return DnDGridWithZonesView(viewModel: viewModel)
.navigationTitle("Observe SFSymbol")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Observe SFSymbol & Associate", color: .orange)
}

NavigationLink {
let gameplay = NewGameplayAssociateCategories(choices: NewGameplayAssociateCategories.kDefaultChoicesWithZones)
let coordinator = DnDGridWithZonesCoordinatorAssociateCategories(gameplay: gameplay,
action: .ipad(type: .audio("sound_animal_duck")))
let viewModel = DnDGridWithZonesViewModel(coordinator: coordinator)

return DnDGridWithZonesView(viewModel: viewModel)
.navigationTitle("Listen Audio")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Listen Audio & Associate", color: .orange)
}

NavigationLink {
let gameplay = NewGameplayAssociateCategories(choices: NewGameplayAssociateCategories.kDefaultImageChoicesWithZones)
let coordinator = DnDGridWithZonesCoordinatorAssociateCategories(gameplay: gameplay,
action: .ipad(type: .speech("Correct answer")))
let viewModel = DnDGridWithZonesViewModel(coordinator: coordinator)

return DnDGridWithZonesView(viewModel: viewModel)
.navigationTitle("Listen Speech")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Listen Speech & Associate", color: .orange)
}

NavigationLink {
let gameplay = NewGameplayAssociateCategories(choices: NewGameplayAssociateCategories.kDefaultChoicesWithZones)
let coordinator = DnDGridWithZonesCoordinatorAssociateCategories(gameplay: gameplay,
action: .robot(type: .color("orange")))
let viewModel = DnDGridWithZonesViewModel(coordinator: coordinator)

return DnDGridWithZonesView(viewModel: viewModel)
.navigationTitle("Listen Robot")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Robot & Associate", color: .orange)
}
}
}
}
}

#Preview {
ActionThenDnDGridWithZoneExercises()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Leka - iOS Monorepo
// Copyright APF France handicap
// SPDX-License-Identifier: Apache-2.0

import GameEngineKit
import SwiftUI

struct ActionThenDnDOneToOneExercises: View {
var body: some View {
Text("Action Then DnD One To One")
.font(.title)
.padding()
ScrollView(.horizontal) {
HStack(spacing: 20) {
NavigationLink {
let gameplay = NewGameplayFindTheRightOrder(choices: NewGameplayFindTheRightOrder.kDefaultImageChoicesWithZones)
let coordinator = DnDOneToOneCoordinatorFindTheRightOrder(gameplay: gameplay,
action: .ipad(type: .image("sport_dance_player_man")))
let viewModel = DnDOneToOneViewModel(coordinator: coordinator)

return DnDOneToOneView(viewModel: viewModel)
.navigationTitle("Observe Image Then Drag & Drop One To One")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Observe Image & Right Order", color: .red)
}

NavigationLink {
let gameplay = NewGameplayFindTheRightOrder(choices: NewGameplayFindTheRightOrder.kDefaultImageChoicesWithZones)
let coordinator = DnDOneToOneCoordinatorFindTheRightOrder(gameplay: gameplay,
action: .ipad(type: .sfsymbol("star")))
let viewModel = DnDOneToOneViewModel(coordinator: coordinator)

return DnDOneToOneView(viewModel: viewModel)
.navigationTitle("Observe SFSymbol Then Drag & Drop One To One")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Observe SFSymbol & Right Order", color: .red)
}

NavigationLink {
let gameplay = NewGameplayFindTheRightOrder(choices: NewGameplayFindTheRightOrder.kDefaultImageChoicesWithZones)
let coordinator = DnDOneToOneCoordinatorFindTheRightOrder(gameplay: gameplay,
action: .ipad(type: .audio("sound_animal_duck")))
let viewModel = DnDOneToOneViewModel(coordinator: coordinator)

return DnDOneToOneView(viewModel: viewModel)
.navigationTitle("Listen Audio Then Drag & Drop One To One")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Listen Audio & Right Order", color: .red)
}

NavigationLink {
let gameplay = NewGameplayFindTheRightOrder(choices: NewGameplayFindTheRightOrder.kDefaultImageChoicesWithZones)
let coordinator = DnDOneToOneCoordinatorFindTheRightOrder(gameplay: gameplay,
action: .ipad(type: .speech("Correct answer")))
let viewModel = DnDOneToOneViewModel(coordinator: coordinator)

return DnDOneToOneView(viewModel: viewModel)
.navigationTitle("Listen Speech Then Drag & Drop One To One")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Listen Speech & Right Order", color: .red)
}

NavigationLink {
let gameplay = NewGameplayFindTheRightOrder(choices: NewGameplayFindTheRightOrder.kDefaultImageChoicesWithZones)
let coordinator = DnDOneToOneCoordinatorFindTheRightOrder(gameplay: gameplay,
action: .robot(type: .color("red")))
let viewModel = DnDOneToOneViewModel(coordinator: coordinator)

return DnDOneToOneView(viewModel: viewModel)
.navigationTitle("Listen Robot Then Drag & Drop One To One")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Robot & Right Order", color: .red)
}
}
}
}
}

#Preview {
ActionThenDnDOneToOneExercises()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Leka - iOS Monorepo
// Copyright APF France handicap
// SPDX-License-Identifier: Apache-2.0

import GameEngineKit
import SwiftUI

struct ActionThenTTSExercises: View {
var body: some View {
Text("Action Then TTS")
.font(.title)
.padding()
ScrollView(.horizontal) {
HStack(spacing: 20) {
NavigationLink {
let gameplay = NewGameplayFindTheRightAnswers(choices: NewGameplayFindTheRightAnswers.kDefaultChoices)
let coordinator = TTSCoordinatorFindTheRightAnswers(gameplay: gameplay,
action: .ipad(type: .image("sport_dance_player_man")))
let viewModel = TTSViewViewModel(coordinator: coordinator)

return TTSView(viewModel: viewModel)
.navigationTitle("Observe Image Then Find The Right Answers")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Observe Image & Right Answers", color: .blue)
}

NavigationLink {
let gameplay = NewGameplayFindTheRightAnswers(choices: NewGameplayFindTheRightAnswers.kDefaultChoices)
let coordinator = TTSCoordinatorFindTheRightAnswers(gameplay: gameplay, action: .ipad(type: .sfsymbol("star")))
let viewModel = TTSViewViewModel(coordinator: coordinator)

return TTSView(viewModel: viewModel)
.navigationTitle("Observe SFSymbol Then Find The Right Answers")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Observe SFSymbol & Right Answers", color: .blue)
}

NavigationLink {
let gameplay = NewGameplayFindTheRightAnswers(choices: NewGameplayFindTheRightAnswers.kDefaultChoices)
let coordinator = TTSCoordinatorFindTheRightAnswers(gameplay: gameplay,
action: .ipad(type: .audio("sound_animal_duck")))
let viewModel = TTSViewViewModel(coordinator: coordinator)

return TTSView(viewModel: viewModel)
.navigationTitle("Listen Audio Then Find The Right Answers")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Listen Audio & Right Answers", color: .blue)
}

NavigationLink {
let gameplay = NewGameplayFindTheRightAnswers(choices: NewGameplayFindTheRightAnswers.kDefaultChoices)
let coordinator = TTSCoordinatorFindTheRightAnswers(gameplay: gameplay,
action: .ipad(type: .speech("Correct answer")))
let viewModel = TTSViewViewModel(coordinator: coordinator)

return TTSView(viewModel: viewModel)
.navigationTitle("Listen Speech Then Find The Right Answers")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Listen Speech & Right Answers", color: .blue)
}

NavigationLink {
let gameplay = NewGameplayFindTheRightAnswers(choices: NewGameplayFindTheRightAnswers.kDefaultChoices)
let coordinator = TTSCoordinatorFindTheRightAnswers(gameplay: gameplay, action: .robot(type: .color("blue")))
let viewModel = TTSViewViewModel(coordinator: coordinator)

return TTSView(viewModel: viewModel)
.navigationTitle("Robot Then Find The Right Answers")
.navigationBarTitleDisplayMode(.large)
} label: {
ExerciseNavigationButtonLabel(text: "Robot & Right Answers", color: .blue)
}
}
}
}
}

#Preview {
ActionThenTTSExercises()
}
Loading
Loading