Skip to content

Commit

Permalink
Merge pull request #2325 from CruGlobal/GT-2331-cyoa-tool-tip-rendering
Browse files Browse the repository at this point in the history
GT-2331 cyoa tool tip rendering
  • Loading branch information
levieggertcru authored Nov 5, 2024
2 parents 19f7ec0 + badaa49 commit 6999ad7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ class ChooseYourOwnAdventureFlow: ToolNavigationFlow, ToolSettingsNavigationFlow
var tractFlow: TractFlow?
var downloadToolTranslationFlow: DownloadToolTranslationsFlow?

init(flowDelegate: FlowDelegate, appDiContainer: AppDiContainer, sharedNavigationController: AppNavigationController, appLanguage: AppLanguageDomainModel, toolTranslations: ToolTranslationsDomainModel, initialPage: MobileContentPagesPage?, selectedLanguageIndex: Int?) {
init(flowDelegate: FlowDelegate, appDiContainer: AppDiContainer, sharedNavigationController: AppNavigationController, appLanguage: AppLanguageDomainModel, toolTranslations: ToolTranslationsDomainModel, initialPage: MobileContentPagesPage?, selectedLanguageIndex: Int?, trainingTipsEnabled: Bool) {

self.flowDelegate = flowDelegate
self.appDiContainer = appDiContainer
self.navigationController = sharedNavigationController
self.appLanguage = appLanguage

sharedNavigationController.pushViewController(
getChooseYourOwnAdventureView(toolTranslations: toolTranslations, initialPage: initialPage, selectedLanguageIndex: selectedLanguageIndex),
getChooseYourOwnAdventureView(
toolTranslations: toolTranslations,
initialPage: initialPage,
selectedLanguageIndex: selectedLanguageIndex,
trainingTipsEnabled: trainingTipsEnabled
),
animated: true
)
}
Expand Down Expand Up @@ -71,7 +76,7 @@ class ChooseYourOwnAdventureFlow: ToolNavigationFlow, ToolSettingsNavigationFlow

extension ChooseYourOwnAdventureFlow {

private func getChooseYourOwnAdventureView(toolTranslations: ToolTranslationsDomainModel, initialPage: MobileContentPagesPage?, selectedLanguageIndex: Int?) -> UIViewController {
private func getChooseYourOwnAdventureView(toolTranslations: ToolTranslationsDomainModel, initialPage: MobileContentPagesPage?, selectedLanguageIndex: Int?, trainingTipsEnabled: Bool) -> UIViewController {

let navigation: MobileContentRendererNavigation = appDiContainer.getMobileContentRendererNavigation(
parentFlow: self,
Expand All @@ -97,7 +102,7 @@ extension ChooseYourOwnAdventureFlow {
mobileContentEventAnalytics: appDiContainer.getMobileContentRendererEventAnalyticsTracking(),
getCurrentAppLanguageUseCase: appDiContainer.feature.appLanguage.domainLayer.getCurrentAppLanguageUseCase(),
getTranslatedLanguageName: appDiContainer.dataLayer.getTranslatedLanguageName(),
trainingTipsEnabled: false,
trainingTipsEnabled: trainingTipsEnabled,
incrementUserCounterUseCase: appDiContainer.domainLayer.getIncrementUserCounterUseCase(),
selectedLanguageIndex: selectedLanguageIndex
)
Expand Down
3 changes: 2 additions & 1 deletion godtools/App/Flows/ToolNavigation/ToolNavigationFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ extension ToolNavigationFlow {
appLanguage: appLanguage,
toolTranslations: toolTranslations,
initialPage: initialPage,
selectedLanguageIndex: selectedLanguageIndex
selectedLanguageIndex: selectedLanguageIndex,
trainingTipsEnabled: trainingTipsEnabled
)

case .metaTool:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ class MobileContentRendererPageViewFactories: MobileContentPageViewFactoryType {
mobileContentAnalytics: mobileContentAnalytics
)

pageViewFactories = [chooseYourOwnAdventureViewFactory]
let trainingViewFactory: TrainingViewFactory = TrainingViewFactory(
mobileContentAnalytics: mobileContentAnalytics,
getTrainingTipCompletedUseCase: getTrainingTipCompletedUseCase
)

pageViewFactories = [chooseYourOwnAdventureViewFactory, trainingViewFactory]

case .lesson:

Expand Down

0 comments on commit 6999ad7

Please sign in to comment.