From 162a50ef7d44b15a9363a68e2ac4d891efcce60a Mon Sep 17 00:00:00 2001 From: Vraj Desai <43074241+vrajdesai78@users.noreply.github.com> Date: Thu, 6 Oct 2022 01:46:24 +0530 Subject: [PATCH] Fixes #3095, #2824: Use protos with intent extras in RecentlyPlayedActivity (#4511) * RecentlyPlayedActivityParams proto created with ActivityRouter * Nit changes * Optimize imports * Shifted applicationComponent to developerApplicationComponent * Optimized import * ActivityRouterModule updated * Updated RECENTLY_PLAYED_ACTIVITY_INTENT_EXTRAS_KEY in ProfileProgressFragmentTest * Static checks fixed * setTitle added in ReceltyPlayedActivityPresenter * bazel added and set title to toolbar * removed unused import * nit changes * test updated and made changes in bazel * dependencies added BUILD.bazel * static and lint checks fixed * protobuf lint issue fixed * Revert "protobuf lint issue fixed" This reverts commit 8b0c70725bbd6ad7a1443e887667c34f79b463c3. * protofub lint test fixed * UNSPECIFIED enum renamed * order changed in bazel * src of bazel fixed * dagger deps added in bazel * KDoc updated for bazel * nit changes * Revert "nit changes" This reverts commit 00c426a60aabe2b5cace9acfa885869584921563. * Updated kdoc and optimized code * klint issue fixed * reformated route/BUILD.bazel * regex pattern checks fixed * optimized import * Nit changes * Test updated and RecentlyPlayedActivityTitle used * Optimized import * Added newline EOF * ActivityRouter added to bazel * reformat bazel * corrected path * made nit changes * Nit changes * added new line * New approach implemented for dagger * code optimized * Fix broken builds for #4511. * Fixed intentname failing tests * Imports optimized * Added tests for ActivityRouter and ActivityRouterModule * optimized code * Added KDoc and ActivityRouter in bazel * fixed typo * removed practicetab * ActivityRouterModule added in BottomSheetOptionsMenu * Optimized imports * Updated failing tests * Added activityRouterModule in Intrumentation * removed activity_router_module from bazel in Instrumentation * removed activityRouterModule from LogReportingModuleTest * removed activity_component_factory from bazel in route/BUILD.bazel * Nit changes * Optimized import * Tests for ActivityRouter and ActivityRouterModule updated * Optimized code for null safety in ProfileProgressHeaderViewModel * Optimized code * Updated KDoc * Updated kDoc * Nit changes * Added new tests and updated ActivityRouter to fix failing CI * Update app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfileProgressFragmentTest.kt Co-authored-by: Ben Henning * Revert "Update app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfileProgressFragmentTest.kt" This reverts commit 3c141fb4b81c60faedf1d3b8a87b906914defee1. * Updated testname * Updated logic in ActivityRouter Co-authored-by: Ben Henning Co-authored-by: Ben Henning --- app/BUILD.bazel | 2 + .../app/activity/ActivityIntentFactories.kt | 3 +- .../oppia/android/app/activity/BUILD.bazel | 1 + .../app/activity/route/ActivityRouter.kt | 31 +++ .../activity/route/ActivityRouterModule.kt | 30 +++ .../android/app/activity/route/BUILD.bazel | 29 +++ .../oppia/android/app/activity/route/Route.kt | 20 ++ .../android/app/activity/route/RouteKey.kt | 8 + .../alpha/AlphaApplicationComponent.kt | 3 +- .../AlphaKenyaApplicationComponent.kt | 3 +- .../beta/BetaApplicationComponent.kt | 3 +- .../dev/DeveloperApplicationComponent.kt | 3 +- .../application/ga/GaApplicationComponent.kt | 3 +- .../oppia/android/app/home/HomeActivity.kt | 27 +- .../app/home/RouteToRecentlyPlayedListener.kt | 4 +- .../PromotedStoryListViewModel.kt | 23 +- .../recentlyplayed/RecentlyPlayedActivity.kt | 35 ++- .../RecentlyPlayedActivityPresenter.kt | 44 +++- .../RecentlyPlayedFragmentPresenter.kt | 9 - .../ProfileProgressActivity.kt | 32 ++- .../ProfileProgressHeaderViewModel.kt | 15 +- .../android/app/shim/IntentFactoryShim.kt | 6 - .../android/app/shim/IntentFactoryShimImpl.kt | 15 -- .../app/testing/HomeFragmentTestActivity.kt | 3 +- .../testing/NavigationDrawerTestActivity.kt | 28 +- .../android/app/testing/activity/BUILD.bazel | 1 + .../app/testing/activity/TestActivity.kt | 4 + .../res/layout/recently_played_activity.xml | 57 +++- .../res/layout/recently_played_fragment.xml | 70 ++--- .../AdministratorControlsActivityTest.kt | 3 +- .../AdministratorControlsFragmentTest.kt | 3 +- .../AppVersionActivityTest.kt | 3 +- .../ProfileAndDeviceIdActivityTest.kt | 4 +- .../ProfileAndDeviceIdFragmentTest.kt | 4 +- .../CompletedStoryListActivityTest.kt | 3 +- .../LessonThumbnailImageViewTest.kt | 3 +- .../MathExpressionInteractionsViewTest.kt | 3 +- .../DrawableBindingAdaptersTest.kt | 3 +- .../ImageViewBindingAdaptersTest.kt | 3 +- .../databinding/MarginBindingAdaptersTest.kt | 3 +- ...StateAssemblerMarginBindingAdaptersTest.kt | 3 +- ...tateAssemblerPaddingBindingAdaptersTest.kt | 3 +- .../TextViewBindingAdaptersTest.kt | 3 +- .../databinding/ViewBindingAdaptersTest.kt | 3 +- .../DeveloperOptionsActivityTest.kt | 3 +- .../DeveloperOptionsFragmentTest.kt | 3 +- .../MarkChaptersCompletedActivityTest.kt | 3 +- .../MarkChaptersCompletedFragmentTest.kt | 3 +- .../MarkStoriesCompletedActivityTest.kt | 3 +- .../MarkStoriesCompletedFragmentTest.kt | 3 +- .../MarkTopicsCompletedActivityTest.kt | 3 +- .../MarkTopicsCompletedFragmentTest.kt | 3 +- .../devoptions/ViewEventLogsActivityTest.kt | 4 +- .../devoptions/ViewEventLogsFragmentTest.kt | 3 +- .../ForceNetworkTypeActivityTest.kt | 3 +- .../ForceNetworkTypeFragmentTest.kt | 3 +- .../MathExpressionParserActivityTest.kt | 3 +- .../MathExpressionParserFragmentTest.kt | 3 +- .../android/app/faq/FAQListFragmentTest.kt | 3 +- .../android/app/faq/FAQSingleActivityTest.kt | 3 +- .../android/app/faq/FaqListActivityTest.kt | 3 +- .../android/app/help/HelpActivityTest.kt | 3 +- .../android/app/help/HelpFragmentTest.kt | 3 +- .../android/app/home/HomeActivityTest.kt | 3 +- .../app/home/RecentlyPlayedFragmentTest.kt | 23 +- .../app/home/TopicSummaryViewModelTest.kt | 3 +- .../android/app/home/WelcomeViewModelTest.kt | 3 +- .../PromotedStoryListViewModelTest.kt | 3 +- .../PromotedStoryViewModelTest.kt | 3 +- .../mydownloads/MyDownloadsActivityTest.kt | 3 +- .../mydownloads/MyDownloadsFragmentTest.kt | 3 +- .../notice/BetaNoticeDialogFragmentTest.kt | 3 +- ...labilityUpgradeNoticeDialogFragmentTest.kt | 3 +- .../app/onboarding/OnboardingActivityTest.kt | 3 +- .../app/onboarding/OnboardingFragmentTest.kt | 3 +- .../OngoingTopicListActivityTest.kt | 3 +- .../app/options/AppLanguageActivityTest.kt | 3 +- .../app/options/AppLanguageFragmentTest.kt | 3 +- .../app/options/AudioLanguageActivityTest.kt | 3 +- .../app/options/AudioLanguageFragmentTest.kt | 3 +- .../app/options/OptionsActivityTest.kt | 3 +- .../app/options/OptionsFragmentTest.kt | 3 +- .../options/ReadingTextSizeActivityTest.kt | 3 +- .../options/ReadingTextSizeFragmentTest.kt | 3 +- .../android/app/parser/HtmlParserTest.kt | 3 +- .../app/player/audio/AudioFragmentTest.kt | 3 +- .../exploration/BottomSheetOptionsMenuTest.kt | 3 +- .../exploration/ExplorationActivityTest.kt | 3 +- .../app/player/state/StateFragmentTest.kt | 3 +- .../app/policies/PoliciesActivityTest.kt | 3 +- .../app/policies/PoliciesFragmentTest.kt | 3 +- .../app/profile/AddProfileActivityTest.kt | 3 +- .../app/profile/AdminAuthActivityTest.kt | 3 +- .../app/profile/AdminPinActivityTest.kt | 3 +- .../app/profile/PinPasswordActivityTest.kt | 3 +- .../app/profile/ProfileChooserActivityTest.kt | 3 +- .../app/profile/ProfileChooserFragmentTest.kt | 3 +- .../ProfilePictureActivityTest.kt | 3 +- .../ProfileProgressActivityTest.kt | 3 +- .../ProfileProgressFragmentTest.kt | 74 +++++- .../app/recyclerview/BindableAdapterTest.kt | 3 +- .../resumelesson/ResumeLessonActivityTest.kt | 3 +- .../resumelesson/ResumeLessonFragmentTest.kt | 3 +- .../profile/ProfileEditActivityTest.kt | 3 +- .../profile/ProfileEditFragmentTest.kt | 3 +- .../profile/ProfileListActivityTest.kt | 3 +- .../profile/ProfileListFragmentTest.kt | 3 +- .../profile/ProfileRenameActivityTest.kt | 3 +- .../profile/ProfileRenameFragmentTest.kt | 3 +- .../profile/ProfileResetPinActivityTest.kt | 3 +- .../profile/ProfileResetPinFragmentTest.kt | 3 +- .../android/app/splash/SplashActivityTest.kt | 3 +- .../android/app/story/StoryActivityTest.kt | 3 +- .../android/app/story/StoryFragmentTest.kt | 3 +- .../app/testing/DragDropTestActivityTest.kt | 3 +- ...ImageRegionSelectionInteractionViewTest.kt | 3 +- .../InputInteractionViewTestActivityTest.kt | 3 +- .../NavigationDrawerActivityDebugTest.kt | 3 +- .../NavigationDrawerActivityProdTest.kt | 3 +- ...tFontScaleConfigurationUtilActivityTest.kt | 3 +- .../testing/TopicTestActivityForStoryTest.kt | 3 +- .../app/thirdparty/LicenseListActivityTest.kt | 3 +- .../app/thirdparty/LicenseListFragmentTest.kt | 3 +- .../LicenseTextViewerActivityTest.kt | 3 +- .../LicenseTextViewerFragmentTest.kt | 3 +- .../ThirdPartyDependencyListActivityTest.kt | 3 +- .../ThirdPartyDependencyListFragmentTest.kt | 3 +- .../android/app/topic/TopicActivityTest.kt | 3 +- .../android/app/topic/TopicFragmentTest.kt | 3 +- .../conceptcard/ConceptCardFragmentTest.kt | 3 +- .../app/topic/info/TopicInfoFragmentTest.kt | 3 +- .../topic/lessons/TopicLessonsFragmentTest.kt | 3 +- .../practice/TopicPracticeFragmentTest.kt | 3 +- .../QuestionPlayerActivityTest.kt | 3 +- .../revision/TopicRevisionFragmentTest.kt | 3 +- .../revisioncard/RevisionCardActivityTest.kt | 3 +- .../revisioncard/RevisionCardFragmentTest.kt | 3 +- .../app/utility/RatioExtensionsTest.kt | 3 +- .../walkthrough/WalkthroughActivityTest.kt | 3 +- .../WalkthroughFinalFragmentTest.kt | 3 +- .../WalkthroughTopicListFragmentTest.kt | 3 +- .../WalkthroughWelcomeFragmentTest.kt | 3 +- .../activity/ActivityIntentFactoriesTest.kt | 8 +- .../oppia/android/app/activity/BUILD.bazel | 2 +- .../route/ActivityRouterModuleTest.kt | 193 ++++++++++++++ .../app/activity/route/ActivityRouterTest.kt | 243 ++++++++++++++++++ .../android/app/activity/route/BUILD.bazel | 90 +++++++ .../android/app/home/HomeActivityLocalTest.kt | 3 +- .../app/parser/FractionParsingUiErrorTest.kt | 3 +- .../parser/ListItemLeadingMarginSpanTest.kt | 3 +- .../app/parser/StringToRatioParserTest.kt | 3 +- .../ExplorationActivityLocalTest.kt | 3 +- .../player/state/StateFragmentLocalTest.kt | 3 +- .../ProfileChooserFragmentLocalTest.kt | 3 +- .../app/story/StoryActivityLocalTest.kt | 3 +- .../app/testing/CompletedStoryListSpanTest.kt | 3 +- .../oppia/android/app/testing/HomeSpanTest.kt | 3 +- .../app/testing/OngoingTopicListSpanTest.kt | 3 +- .../PlatformParameterIntegrationTest.kt | 3 +- .../app/testing/ProfileChooserSpanTest.kt | 3 +- .../testing/ProfileProgressSpanCountTest.kt | 3 +- .../app/testing/RecentlyPlayedSpanTest.kt | 11 +- .../app/testing/TopicRevisionSpanTest.kt | 3 +- .../app/testing/activity/TestActivityTest.kt | 3 +- .../AdministratorControlsFragmentTest.kt | 3 +- .../testing/options/OptionsFragmentTest.kt | 3 +- .../player/split/PlayerSplitScreenTest.kt | 3 +- .../state/StateFragmentAccessibilityTest.kt | 3 +- .../topic/info/TopicInfoFragmentLocalTest.kt | 3 +- .../lessons/TopicLessonsFragmentLocalTest.kt | 3 +- .../QuestionPlayerActivityLocalTest.kt | 3 +- .../RevisionCardActivityLocalTest.kt | 3 +- .../AppLanguageResourceHandlerTest.kt | 3 +- .../AppLanguageWatcherMixinTest.kt | 3 +- .../app/utility/datetime/DateTimeUtilTest.kt | 3 +- .../MathExpressionAccessibilityUtilTest.kt | 3 +- .../application/TestApplicationComponent.kt | 4 +- model/src/main/proto/arguments.proto | 36 +++ scripts/assets/test_file_exemptions.textproto | 2 + ...alizeDefaultLocaleRuleCustomContextTest.kt | 3 +- ...InitializeDefaultLocaleRuleOmissionTest.kt | 3 +- .../junit/InitializeDefaultLocaleRuleTest.kt | 3 +- 182 files changed, 1334 insertions(+), 293 deletions(-) create mode 100644 app/src/main/java/org/oppia/android/app/activity/route/ActivityRouter.kt create mode 100644 app/src/main/java/org/oppia/android/app/activity/route/ActivityRouterModule.kt create mode 100644 app/src/main/java/org/oppia/android/app/activity/route/BUILD.bazel create mode 100644 app/src/main/java/org/oppia/android/app/activity/route/Route.kt create mode 100644 app/src/main/java/org/oppia/android/app/activity/route/RouteKey.kt create mode 100644 app/src/test/java/org/oppia/android/app/activity/route/ActivityRouterModuleTest.kt create mode 100644 app/src/test/java/org/oppia/android/app/activity/route/ActivityRouterTest.kt create mode 100644 app/src/test/java/org/oppia/android/app/activity/route/BUILD.bazel diff --git a/app/BUILD.bazel b/app/BUILD.bazel index 0099f64044c..5b8793cf70e 100644 --- a/app/BUILD.bazel +++ b/app/BUILD.bazel @@ -740,6 +740,7 @@ kt_android_library( "//app/src/main/java/org/oppia/android/app/activity:ActivityComponentImpl.kt", "//app/src/main/java/org/oppia/android/app/activity:ActivityIntentFactoriesModule.kt", "//app/src/main/java/org/oppia/android/app/activity:ActivityModule.kt", + "//app/src/main/java/org/oppia/android/app/activity/route:ActivityRouterModule.kt", "//app/src/main/java/org/oppia/android/app/fragment:FragmentComponentBuilderModule.kt", "//app/src/main/java/org/oppia/android/app/fragment:FragmentComponentImpl.kt", "//app/src/main/java/org/oppia/android/app/fragment:FragmentModule.kt", @@ -758,6 +759,7 @@ kt_android_library( ":views", "//app/src/main/java/org/oppia/android/app/activity:activity_intent_factories_shim", "//app/src/main/java/org/oppia/android/app/activity:injectable_app_compat_activity", + "//app/src/main/java/org/oppia/android/app/activity/route:activity_router", "//app/src/main/java/org/oppia/android/app/fragment:injectable_bottom_sheet_dialog_fragment", "//app/src/main/java/org/oppia/android/app/fragment:injectable_dialog_fragment", "//app/src/main/java/org/oppia/android/app/fragment:injectable_fragment", diff --git a/app/src/main/java/org/oppia/android/app/activity/ActivityIntentFactories.kt b/app/src/main/java/org/oppia/android/app/activity/ActivityIntentFactories.kt index 12c98f14ab8..ab6ab90bf77 100644 --- a/app/src/main/java/org/oppia/android/app/activity/ActivityIntentFactories.kt +++ b/app/src/main/java/org/oppia/android/app/activity/ActivityIntentFactories.kt @@ -2,6 +2,7 @@ package org.oppia.android.app.activity import android.content.Intent import org.oppia.android.app.model.ProfileId +import org.oppia.android.app.model.RecentlyPlayedActivityParams // TODO(#59): Split this up into separate interfaces & move them to the corresponding activities. // This pattern will probably need to be used for all activities (& maybe fragments) as part of app @@ -33,6 +34,6 @@ interface ActivityIntentFactories { */ interface RecentlyPlayedActivityIntentFactory { /** Returns a new [Intent] to start the recently played activity for the specified profile. */ - fun createIntent(profileId: ProfileId): Intent + fun createIntent(recentlyPlayedActivityParams: RecentlyPlayedActivityParams): Intent } } diff --git a/app/src/main/java/org/oppia/android/app/activity/BUILD.bazel b/app/src/main/java/org/oppia/android/app/activity/BUILD.bazel index 3c09724c453..dfc04d8e006 100644 --- a/app/src/main/java/org/oppia/android/app/activity/BUILD.bazel +++ b/app/src/main/java/org/oppia/android/app/activity/BUILD.bazel @@ -75,6 +75,7 @@ kt_android_library( "//app:app_visibility", ], deps = [ + "//model/src/main/proto:arguments_java_proto_lite", "//model/src/main/proto:profile_java_proto_lite", ], ) diff --git a/app/src/main/java/org/oppia/android/app/activity/route/ActivityRouter.kt b/app/src/main/java/org/oppia/android/app/activity/route/ActivityRouter.kt new file mode 100644 index 00000000000..7e4c020e4af --- /dev/null +++ b/app/src/main/java/org/oppia/android/app/activity/route/ActivityRouter.kt @@ -0,0 +1,31 @@ +package org.oppia.android.app.activity.route + +import androidx.appcompat.app.AppCompatActivity +import org.oppia.android.app.model.DestinationScreen +import org.oppia.android.app.model.DestinationScreen.DestinationScreenCase +import org.oppia.android.util.logging.ConsoleLogger +import javax.inject.Inject + +/** + * A central router that can navigate the user to a specific activity based on a provided + * [DestinationScreen]. + */ +class ActivityRouter @Inject constructor( + private val activity: AppCompatActivity, + private val destinationRoutes: Map, + private val consoleLogger: ConsoleLogger +) { + /** Opens the activity corresponding to the specified [destinationScreen]. */ + fun routeToScreen(destinationScreen: DestinationScreen) { + val routeIntent = destinationRoutes[destinationScreen.destinationScreenCase] + ?.createIntent( + activity, + destinationScreen + ) + if (routeIntent != null) { + activity.startActivity(routeIntent) + } else { + consoleLogger.w("ActivityRouter", "Destination screen case is not identified.") + } + } +} diff --git a/app/src/main/java/org/oppia/android/app/activity/route/ActivityRouterModule.kt b/app/src/main/java/org/oppia/android/app/activity/route/ActivityRouterModule.kt new file mode 100644 index 00000000000..856cbc37cdd --- /dev/null +++ b/app/src/main/java/org/oppia/android/app/activity/route/ActivityRouterModule.kt @@ -0,0 +1,30 @@ +package org.oppia.android.app.activity.route + +import android.content.Context +import android.content.Intent +import dagger.Module +import dagger.Provides +import dagger.multibindings.IntoMap +import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity +import org.oppia.android.app.model.DestinationScreen + +/** Module to bind destination screens to navigable activity routes. */ +@Module +class ActivityRouterModule { + @Provides + @IntoMap + @RouteKey(DestinationScreen.DestinationScreenCase.RECENTLY_PLAYED_ACTIVITY_PARAMS) + fun provideRecentlyPlayedActivityRoute(): Route { + return object : Route { + override fun createIntent( + context: Context, + destinationScreen: DestinationScreen + ): Intent { + return RecentlyPlayedActivity.createRecentlyPlayedActivityIntent( + context, + destinationScreen.recentlyPlayedActivityParams + ) + } + } + } +} diff --git a/app/src/main/java/org/oppia/android/app/activity/route/BUILD.bazel b/app/src/main/java/org/oppia/android/app/activity/route/BUILD.bazel new file mode 100644 index 00000000000..4700674d4c2 --- /dev/null +++ b/app/src/main/java/org/oppia/android/app/activity/route/BUILD.bazel @@ -0,0 +1,29 @@ +""" +Constructs for setting up activity routing support in the Dagger graph. +""" + +load("@dagger//:workspace_defs.bzl", "dagger_rules") +load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library") + +# TODO(#59): Define these exported files as separate libraries from top-level targets. +exports_files([ + "ActivityRouterModule.kt", +]) + +kt_android_library( + name = "activity_router", + srcs = [ + "ActivityRouter.kt", + "Route.kt", + "RouteKey.kt", + ], + visibility = ["//:oppia_api_visibility"], + deps = [ + ":dagger", + "//model/src/main/proto:arguments_java_proto_lite", + "//third_party:androidx_appcompat_appcompat", + "//utility/src/main/java/org/oppia/android/util/logging:console_logger", + ], +) + +dagger_rules() diff --git a/app/src/main/java/org/oppia/android/app/activity/route/Route.kt b/app/src/main/java/org/oppia/android/app/activity/route/Route.kt new file mode 100644 index 00000000000..5b186a09b74 --- /dev/null +++ b/app/src/main/java/org/oppia/android/app/activity/route/Route.kt @@ -0,0 +1,20 @@ +package org.oppia.android.app.activity.route + +import android.content.Context +import android.content.Intent +import org.oppia.android.app.model.DestinationScreen + +/** Represents a possible navigation route to a specific activity in the app. */ +interface Route { + /** + * Creates an [Intent] to route to the activity corresponding to this route. + * + * @param context the context to be used for creating the [Intent] + * @param params the parameters to pass to the activity via its extras bundle + * @return the intent that can be used to navigate to this route's activity + */ + fun createIntent( + context: Context, + destinationScreen: DestinationScreen + ): Intent +} diff --git a/app/src/main/java/org/oppia/android/app/activity/route/RouteKey.kt b/app/src/main/java/org/oppia/android/app/activity/route/RouteKey.kt new file mode 100644 index 00000000000..12895e1f1e6 --- /dev/null +++ b/app/src/main/java/org/oppia/android/app/activity/route/RouteKey.kt @@ -0,0 +1,8 @@ +package org.oppia.android.app.activity.route + +import dagger.MapKey +import org.oppia.android.app.model.DestinationScreen + +/** Specifies [DestinationScreenCase] which can be used to pass in activity Route. */ +@MapKey +annotation class RouteKey(val value: DestinationScreen.DestinationScreenCase) diff --git a/app/src/main/java/org/oppia/android/app/application/alpha/AlphaApplicationComponent.kt b/app/src/main/java/org/oppia/android/app/application/alpha/AlphaApplicationComponent.kt index 183dcee96c5..102da66b0fd 100644 --- a/app/src/main/java/org/oppia/android/app/application/alpha/AlphaApplicationComponent.kt +++ b/app/src/main/java/org/oppia/android/app/application/alpha/AlphaApplicationComponent.kt @@ -1,6 +1,7 @@ package org.oppia.android.app.application.alpha import dagger.Component +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationModule import org.oppia.android.app.application.ApplicationStartupListenerModule @@ -87,7 +88,7 @@ import javax.inject.Singleton PlatformParameterModule::class, PlatformParameterSingletonModule::class, ExplorationStorageModule::class, DeveloperOptionsModule::class, PlatformParameterSyncUpWorkerModule::class, NetworkConfigProdModule::class, AssetModule::class, - LocaleProdModule::class, ActivityRecreatorProdModule::class, + LocaleProdModule::class, ActivityRecreatorProdModule::class, ActivityRouterModule::class, NumericExpressionInputModule::class, AlgebraicExpressionInputModule::class, MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, diff --git a/app/src/main/java/org/oppia/android/app/application/alphakenya/AlphaKenyaApplicationComponent.kt b/app/src/main/java/org/oppia/android/app/application/alphakenya/AlphaKenyaApplicationComponent.kt index 38cd3188710..2bf219282eb 100644 --- a/app/src/main/java/org/oppia/android/app/application/alphakenya/AlphaKenyaApplicationComponent.kt +++ b/app/src/main/java/org/oppia/android/app/application/alphakenya/AlphaKenyaApplicationComponent.kt @@ -1,6 +1,7 @@ package org.oppia.android.app.application.alphakenya import dagger.Component +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationModule import org.oppia.android.app.application.ApplicationStartupListenerModule @@ -88,7 +89,7 @@ import javax.inject.Singleton PlatformParameterAlphaKenyaModule::class, PlatformParameterSingletonModule::class, ExplorationStorageModule::class, DeveloperOptionsModule::class, PlatformParameterSyncUpWorkerModule::class, NetworkConfigProdModule::class, AssetModule::class, - LocaleProdModule::class, ActivityRecreatorProdModule::class, + LocaleProdModule::class, ActivityRecreatorProdModule::class, ActivityRouterModule::class, NumericExpressionInputModule::class, AlgebraicExpressionInputModule::class, MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, diff --git a/app/src/main/java/org/oppia/android/app/application/beta/BetaApplicationComponent.kt b/app/src/main/java/org/oppia/android/app/application/beta/BetaApplicationComponent.kt index a109569db89..a7789a14b0b 100644 --- a/app/src/main/java/org/oppia/android/app/application/beta/BetaApplicationComponent.kt +++ b/app/src/main/java/org/oppia/android/app/application/beta/BetaApplicationComponent.kt @@ -1,6 +1,7 @@ package org.oppia.android.app.application.beta import dagger.Component +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationModule import org.oppia.android.app.application.ApplicationStartupListenerModule @@ -96,7 +97,7 @@ import javax.inject.Singleton HintsAndSolutionProdModule::class, MetricLogSchedulerModule::class, ActivityLifecycleObserverModule::class, PerformanceMetricsAssessorModule::class, PerformanceMetricsConfigurationsModule::class, BetaBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface BetaApplicationComponent : ApplicationComponent { diff --git a/app/src/main/java/org/oppia/android/app/application/dev/DeveloperApplicationComponent.kt b/app/src/main/java/org/oppia/android/app/application/dev/DeveloperApplicationComponent.kt index ff9f8f32498..9608f2ada18 100644 --- a/app/src/main/java/org/oppia/android/app/application/dev/DeveloperApplicationComponent.kt +++ b/app/src/main/java/org/oppia/android/app/application/dev/DeveloperApplicationComponent.kt @@ -1,6 +1,7 @@ package org.oppia.android.app.application.dev import dagger.Component +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationModule import org.oppia.android.app.application.ApplicationStartupListenerModule @@ -90,7 +91,7 @@ import javax.inject.Singleton ExplorationStorageModule::class, DeveloperOptionsStarterModule::class, DeveloperOptionsModule::class, PlatformParameterSyncUpWorkerModule::class, NetworkConnectionUtilDebugModule::class, NetworkConfigProdModule::class, AssetModule::class, - LocaleProdModule::class, ActivityRecreatorProdModule::class, + LocaleProdModule::class, ActivityRecreatorProdModule::class, ActivityRouterModule::class, NumericExpressionInputModule::class, AlgebraicExpressionInputModule::class, MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, diff --git a/app/src/main/java/org/oppia/android/app/application/ga/GaApplicationComponent.kt b/app/src/main/java/org/oppia/android/app/application/ga/GaApplicationComponent.kt index 6f98fe998ae..d33378ccad2 100644 --- a/app/src/main/java/org/oppia/android/app/application/ga/GaApplicationComponent.kt +++ b/app/src/main/java/org/oppia/android/app/application/ga/GaApplicationComponent.kt @@ -1,6 +1,7 @@ package org.oppia.android.app.application.ga import dagger.Component +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationModule import org.oppia.android.app.application.ApplicationStartupListenerModule @@ -96,7 +97,7 @@ import javax.inject.Singleton HintsAndSolutionProdModule::class, MetricLogSchedulerModule::class, ActivityLifecycleObserverModule::class, PerformanceMetricsAssessorModule::class, PerformanceMetricsConfigurationsModule::class, GaBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface GaApplicationComponent : ApplicationComponent { diff --git a/app/src/main/java/org/oppia/android/app/home/HomeActivity.kt b/app/src/main/java/org/oppia/android/app/home/HomeActivity.kt index 7874aa44c8b..2828d9408bb 100644 --- a/app/src/main/java/org/oppia/android/app/home/HomeActivity.kt +++ b/app/src/main/java/org/oppia/android/app/home/HomeActivity.kt @@ -6,12 +6,16 @@ import android.os.Bundle import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponentImpl import org.oppia.android.app.activity.InjectableAppCompatActivity +import org.oppia.android.app.activity.route.ActivityRouter import org.oppia.android.app.drawer.ExitProfileDialogFragment import org.oppia.android.app.drawer.NAVIGATION_PROFILE_ID_ARGUMENT_KEY import org.oppia.android.app.drawer.TAG_SWITCH_PROFILE_DIALOG -import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity +import org.oppia.android.app.model.DestinationScreen import org.oppia.android.app.model.ExitProfileDialogArguments import org.oppia.android.app.model.HighlightItem +import org.oppia.android.app.model.ProfileId +import org.oppia.android.app.model.RecentlyPlayedActivityParams +import org.oppia.android.app.model.RecentlyPlayedActivityTitle import org.oppia.android.app.model.ScreenName.HOME_ACTIVITY import org.oppia.android.app.topic.TopicActivity import org.oppia.android.app.translation.AppLanguageResourceHandler @@ -30,6 +34,9 @@ class HomeActivity : @Inject lateinit var resourceHandler: AppLanguageResourceHandler + @Inject + lateinit var activityRouter: ActivityRouter + private var internalProfileId: Int = -1 companion object { @@ -85,12 +92,18 @@ class HomeActivity : ) } - override fun routeToRecentlyPlayed() { - startActivity( - RecentlyPlayedActivity.createRecentlyPlayedActivityIntent( - this, - internalProfileId - ) + override fun routeToRecentlyPlayed(recentlyPlayedActivityTitle: RecentlyPlayedActivityTitle) { + val recentlyPlayedActivityParams = + RecentlyPlayedActivityParams + .newBuilder() + .setProfileId(ProfileId.newBuilder().setInternalId(internalProfileId).build()) + .setActivityTitle(recentlyPlayedActivityTitle).build() + + activityRouter.routeToScreen( + DestinationScreen + .newBuilder() + .setRecentlyPlayedActivityParams(recentlyPlayedActivityParams) + .build() ) } } diff --git a/app/src/main/java/org/oppia/android/app/home/RouteToRecentlyPlayedListener.kt b/app/src/main/java/org/oppia/android/app/home/RouteToRecentlyPlayedListener.kt index 127ecdb5198..2cdb6e570df 100755 --- a/app/src/main/java/org/oppia/android/app/home/RouteToRecentlyPlayedListener.kt +++ b/app/src/main/java/org/oppia/android/app/home/RouteToRecentlyPlayedListener.kt @@ -1,6 +1,8 @@ package org.oppia.android.app.home +import org.oppia.android.app.model.RecentlyPlayedActivityTitle + /** Listener for when an activity should route to [RecentlyPlayedActivity]. */ interface RouteToRecentlyPlayedListener { - fun routeToRecentlyPlayed() + fun routeToRecentlyPlayed(recentlyPlayedActivityTitle: RecentlyPlayedActivityTitle) } diff --git a/app/src/main/java/org/oppia/android/app/home/promotedlist/PromotedStoryListViewModel.kt b/app/src/main/java/org/oppia/android/app/home/promotedlist/PromotedStoryListViewModel.kt index 052f11e8783..993212cdf41 100644 --- a/app/src/main/java/org/oppia/android/app/home/promotedlist/PromotedStoryListViewModel.kt +++ b/app/src/main/java/org/oppia/android/app/home/promotedlist/PromotedStoryListViewModel.kt @@ -9,6 +9,7 @@ import org.oppia.android.R import org.oppia.android.app.home.HomeItemViewModel import org.oppia.android.app.home.RouteToRecentlyPlayedListener import org.oppia.android.app.model.PromotedActivityList +import org.oppia.android.app.model.RecentlyPlayedActivityTitle import org.oppia.android.app.translation.AppLanguageResourceHandler import java.util.Objects @@ -49,6 +50,26 @@ class PromotedStoryListViewModel( } } + private fun getRecentlyPlayedActivityTitle(): RecentlyPlayedActivityTitle { + with(promotedActivityList.promotedStoryList) { + return when { + suggestedStoryList.isNotEmpty() -> { + if (recentlyPlayedStoryList.isEmpty() && olderPlayedStoryList.isEmpty()) { + RecentlyPlayedActivityTitle.RECOMMENDED_STORIES + } else { + RecentlyPlayedActivityTitle.STORIES_FOR_YOU + } + } + recentlyPlayedStoryList.isNotEmpty() -> { + RecentlyPlayedActivityTitle.RECENTLY_PLAYED_STORIES + } + else -> { + RecentlyPlayedActivityTitle.LAST_PLAYED_STORIES + } + } + } + } + /** Returns the visibility for the "View All" button. */ fun getViewAllButtonVisibility(): Int { if (activity.resources.getBoolean(R.bool.isTablet)) { @@ -72,7 +93,7 @@ class PromotedStoryListViewModel( } fun clickOnViewAll() { - routeToRecentlyPlayedListener.routeToRecentlyPlayed() + routeToRecentlyPlayedListener.routeToRecentlyPlayed(getRecentlyPlayedActivityTitle()) } // Overriding equals is needed so that DataProvider combine functions used in the HomeViewModel diff --git a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt index 8923766a520..e6f1e16d3a6 100644 --- a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt +++ b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity.kt @@ -11,10 +11,13 @@ import org.oppia.android.app.home.RouteToExplorationListener import org.oppia.android.app.model.ExplorationActivityParams import org.oppia.android.app.model.ExplorationCheckpoint import org.oppia.android.app.model.ProfileId -import org.oppia.android.app.model.ScreenName.RECENTLY_PLAYED_ACTIVITY +import org.oppia.android.app.model.RecentlyPlayedActivityParams +import org.oppia.android.app.model.ScreenName import org.oppia.android.app.player.exploration.ExplorationActivity import org.oppia.android.app.resumelesson.ResumeLessonActivity import org.oppia.android.app.topic.RouteToResumeLessonListener +import org.oppia.android.util.extensions.getProtoExtra +import org.oppia.android.util.extensions.putProtoExtra import org.oppia.android.util.logging.CurrentAppScreenNameIntentDecorator.decorateWithScreenName import javax.inject.Inject @@ -30,23 +33,29 @@ class RecentlyPlayedActivity : override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) (activityComponent as ActivityComponentImpl).inject(this) - val internalProfileId = intent.getIntExtra( - RECENTLY_PLAYED_ACTIVITY_INTERNAL_PROFILE_ID_KEY, - -1 + val recentlyPlayedActivityParams = intent.getProtoExtra( + RECENTLY_PLAYED_ACTIVITY_INTENT_EXTRAS_KEY, + RecentlyPlayedActivityParams.getDefaultInstance() ) - recentlyPlayedActivityPresenter.handleOnCreate(internalProfileId) + recentlyPlayedActivityPresenter.handleOnCreate(recentlyPlayedActivityParams) } companion object { // TODO(#1655): Re-restrict access to fields in tests post-Gradle. - const val RECENTLY_PLAYED_ACTIVITY_INTERNAL_PROFILE_ID_KEY = - "RecentlyPlayedActivity.internal_profile_id" + const val RECENTLY_PLAYED_ACTIVITY_INTENT_EXTRAS_KEY = + "RecentlyPlayedActivity.intent_extras" /** Returns a new [Intent] to route to [RecentlyPlayedActivity]. */ - fun createRecentlyPlayedActivityIntent(context: Context, internalProfileId: Int): Intent { + fun createRecentlyPlayedActivityIntent( + context: Context, + recentlyPlayedActivityParams: RecentlyPlayedActivityParams + ): Intent { return Intent(context, RecentlyPlayedActivity::class.java).apply { - putExtra(RECENTLY_PLAYED_ACTIVITY_INTERNAL_PROFILE_ID_KEY, internalProfileId) - decorateWithScreenName(RECENTLY_PLAYED_ACTIVITY) + putProtoExtra( + RECENTLY_PLAYED_ACTIVITY_INTENT_EXTRAS_KEY, + recentlyPlayedActivityParams + ) + decorateWithScreenName(ScreenName.RECENTLY_PLAYED_ACTIVITY) } } } @@ -96,7 +105,9 @@ class RecentlyPlayedActivity : class RecentlyPlayedActivityIntentFactoryImpl @Inject constructor( private val activity: AppCompatActivity ) : ActivityIntentFactories.RecentlyPlayedActivityIntentFactory { - override fun createIntent(profileId: ProfileId): Intent = - createRecentlyPlayedActivityIntent(activity, profileId.internalId) + override fun createIntent( + recentlyPlayedActivityParams: RecentlyPlayedActivityParams + ): Intent = + createRecentlyPlayedActivityIntent(activity, recentlyPlayedActivityParams) } } diff --git a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivityPresenter.kt b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivityPresenter.kt index 1826587f235..9eef029e29b 100644 --- a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivityPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivityPresenter.kt @@ -1,19 +1,38 @@ package org.oppia.android.app.home.recentlyplayed import androidx.appcompat.app.AppCompatActivity +import androidx.databinding.DataBindingUtil import org.oppia.android.R import org.oppia.android.app.activity.ActivityScope +import org.oppia.android.app.model.RecentlyPlayedActivityParams +import org.oppia.android.app.model.RecentlyPlayedActivityTitle +import org.oppia.android.app.translation.AppLanguageResourceHandler +import org.oppia.android.databinding.RecentlyPlayedActivityBinding import javax.inject.Inject /** The presenter for [RecentlyPlayedActivity]. */ @ActivityScope -class RecentlyPlayedActivityPresenter @Inject constructor(private val activity: AppCompatActivity) { - fun handleOnCreate(internalProfileId: Int) { - activity.setContentView(R.layout.recently_played_activity) +class RecentlyPlayedActivityPresenter @Inject constructor( + private val activity: AppCompatActivity, + private val resourceHandler: AppLanguageResourceHandler +) { + fun handleOnCreate(recentlyPlayedActivityParams: RecentlyPlayedActivityParams) { + activity.supportActionBar?.setDisplayHomeAsUpEnabled(true) + activity.supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_arrow_back_white_24dp) + activity.title = getTitle(recentlyPlayedActivityParams) + val binding = DataBindingUtil.setContentView( + activity, + R.layout.recently_played_activity + ) + + binding.recentlyPlayedToolbar.setNavigationOnClickListener { + (activity as RecentlyPlayedActivity).finish() + } + binding.recentlyPlayedToolbar.title = getTitle(recentlyPlayedActivityParams) if (getRecentlyPlayedFragment() == null) { activity.supportFragmentManager.beginTransaction().add( R.id.recently_played_fragment_placeholder, - RecentlyPlayedFragment.newInstance(internalProfileId), + RecentlyPlayedFragment.newInstance(recentlyPlayedActivityParams.profileId.internalId), RecentlyPlayedFragment.TAG_RECENTLY_PLAYED_FRAGMENT ).commitNow() } @@ -24,4 +43,21 @@ class RecentlyPlayedActivityPresenter @Inject constructor(private val activity: R.id.recently_played_fragment_placeholder ) as RecentlyPlayedFragment? } + + private fun getTitle(recentlyPlayedActivityParams: RecentlyPlayedActivityParams): String { + return when (recentlyPlayedActivityParams.activityTitle) { + RecentlyPlayedActivityTitle.STORIES_FOR_YOU -> { + resourceHandler.getStringInLocale(R.string.stories_for_you) + } + RecentlyPlayedActivityTitle.LAST_PLAYED_STORIES -> { + resourceHandler.getStringInLocale(R.string.last_played_stories) + } + RecentlyPlayedActivityTitle.RECOMMENDED_STORIES -> { + resourceHandler.getStringInLocale(R.string.recommended_stories) + } + else -> { + resourceHandler.getStringInLocale(R.string.recently_played_activity) + } + } + } } diff --git a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedFragmentPresenter.kt index 9c00b790290..c93a0de4e59 100755 --- a/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedFragmentPresenter.kt @@ -59,9 +59,6 @@ class RecentlyPlayedFragmentPresenter @Inject constructor( internalProfileId: Int ): View? { binding = RecentlyPlayedFragmentBinding.inflate(inflater, container, /* attachToRoot= */ false) - binding.recentlyPlayedToolbar.setNavigationOnClickListener { - (activity as RecentlyPlayedActivity).finish() - } this.internalProfileId = internalProfileId @@ -88,20 +85,14 @@ class RecentlyPlayedFragmentPresenter @Inject constructor( fragment, { if (it.promotedStoryList.recentlyPlayedStoryList.isNotEmpty()) { - binding.recentlyPlayedToolbar.title = - resourceHandler.getStringInLocale(R.string.recently_played_stories) addRecentlyPlayedStoryListSection(it.promotedStoryList.recentlyPlayedStoryList) } if (it.promotedStoryList.olderPlayedStoryList.isNotEmpty()) { - binding.recentlyPlayedToolbar.title = - resourceHandler.getStringInLocale(R.string.recently_played_stories) addOlderStoryListSection(it.promotedStoryList.olderPlayedStoryList) } if (it.promotedStoryList.suggestedStoryList.isNotEmpty()) { - binding.recentlyPlayedToolbar.title = - resourceHandler.getStringInLocale(R.string.stories_for_you) addRecommendedStoryListSection(it.promotedStoryList.suggestedStoryList) } diff --git a/app/src/main/java/org/oppia/android/app/profileprogress/ProfileProgressActivity.kt b/app/src/main/java/org/oppia/android/app/profileprogress/ProfileProgressActivity.kt index 938c4dd4454..e168349071d 100644 --- a/app/src/main/java/org/oppia/android/app/profileprogress/ProfileProgressActivity.kt +++ b/app/src/main/java/org/oppia/android/app/profileprogress/ProfileProgressActivity.kt @@ -5,11 +5,16 @@ import android.content.Intent import android.os.Bundle import org.oppia.android.app.activity.ActivityComponentImpl import org.oppia.android.app.activity.InjectableAppCompatActivity +import org.oppia.android.app.activity.route.ActivityRouter import org.oppia.android.app.completedstorylist.CompletedStoryListActivity import org.oppia.android.app.home.RouteToRecentlyPlayedListener -import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity +import org.oppia.android.app.model.DestinationScreen +import org.oppia.android.app.model.ProfileId +import org.oppia.android.app.model.RecentlyPlayedActivityParams +import org.oppia.android.app.model.RecentlyPlayedActivityTitle import org.oppia.android.app.model.ScreenName.PROFILE_PROGRESS_ACTIVITY import org.oppia.android.app.ongoingtopiclist.OngoingTopicListActivity +import org.oppia.android.app.translation.AppLanguageResourceHandler import org.oppia.android.util.logging.CurrentAppScreenNameIntentDecorator.decorateWithScreenName import javax.inject.Inject @@ -25,6 +30,12 @@ class ProfileProgressActivity : lateinit var profileProgressActivityPresenter: ProfileProgressActivityPresenter private var internalProfileId = -1 + @Inject + lateinit var activityRouter: ActivityRouter + + @Inject + lateinit var resourceHandler: AppLanguageResourceHandler + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) (activityComponent as ActivityComponentImpl).inject(this) @@ -32,12 +43,19 @@ class ProfileProgressActivity : profileProgressActivityPresenter.handleOnCreate(internalProfileId) } - override fun routeToRecentlyPlayed() { - startActivity( - RecentlyPlayedActivity.createRecentlyPlayedActivityIntent( - this, - internalProfileId - ) + override fun routeToRecentlyPlayed(recentlyPlayedActivityTitle: RecentlyPlayedActivityTitle) { + val recentlyPlayedActivityParams = + RecentlyPlayedActivityParams + .newBuilder() + .setProfileId(ProfileId.newBuilder().setInternalId(internalProfileId).build()) + .setActivityTitle(recentlyPlayedActivityTitle) + .build() + + activityRouter.routeToScreen( + DestinationScreen + .newBuilder() + .setRecentlyPlayedActivityParams(recentlyPlayedActivityParams) + .build() ) } diff --git a/app/src/main/java/org/oppia/android/app/profileprogress/ProfileProgressHeaderViewModel.kt b/app/src/main/java/org/oppia/android/app/profileprogress/ProfileProgressHeaderViewModel.kt index 37966be68f3..786502379bb 100644 --- a/app/src/main/java/org/oppia/android/app/profileprogress/ProfileProgressHeaderViewModel.kt +++ b/app/src/main/java/org/oppia/android/app/profileprogress/ProfileProgressHeaderViewModel.kt @@ -6,9 +6,13 @@ import androidx.databinding.ObservableField import androidx.fragment.app.Fragment import org.oppia.android.app.home.RouteToRecentlyPlayedListener import org.oppia.android.app.model.Profile +import org.oppia.android.app.model.RecentlyPlayedActivityTitle /** Header [ViewModel] for the recycler view in [ProfileProgressFragment]. */ -class ProfileProgressHeaderViewModel(activity: AppCompatActivity, fragment: Fragment) : +class ProfileProgressHeaderViewModel( + activity: AppCompatActivity, + fragment: Fragment, +) : ProfileProgressItemViewModel() { private val routeToCompletedStoryListListener = activity as RouteToCompletedStoryListListener private val routeToOngoingTopicListListener = activity as RouteToOngoingTopicListListener @@ -21,6 +25,13 @@ class ProfileProgressHeaderViewModel(activity: AppCompatActivity, fragment: Frag private var recentlyPlayedTopicCount: Int = 0 + private fun getRecentlyPlayedActivityTitle(): RecentlyPlayedActivityTitle { + return when (completedStoryCount.get()) { + in 2..Int.MAX_VALUE -> RecentlyPlayedActivityTitle.RECENTLY_PLAYED_STORIES + else -> RecentlyPlayedActivityTitle.STORIES_FOR_YOU + } + } + fun setProfile(currentProfile: Profile) { profile.set(currentProfile) } @@ -42,7 +53,7 @@ class ProfileProgressHeaderViewModel(activity: AppCompatActivity, fragment: Frag } fun clickOnViewAll() { - routeToRecentlyPlayedActivity.routeToRecentlyPlayed() + routeToRecentlyPlayedActivity.routeToRecentlyPlayed(getRecentlyPlayedActivityTitle()) } fun clickOnProfilePicture() { diff --git a/app/src/main/java/org/oppia/android/app/shim/IntentFactoryShim.kt b/app/src/main/java/org/oppia/android/app/shim/IntentFactoryShim.kt index 823647a301f..6bf989b0039 100644 --- a/app/src/main/java/org/oppia/android/app/shim/IntentFactoryShim.kt +++ b/app/src/main/java/org/oppia/android/app/shim/IntentFactoryShim.kt @@ -32,10 +32,4 @@ interface IntentFactoryShim { internalProfileId: Int, topicId: String ): Intent - - /** - * Creates a [RecentlyPlayedActivity] intent for [PromotedStoryListViewModel] and passes - * necessary string data. - * */ - fun createRecentlyPlayedActivityIntent(context: Context, internalProfileId: Int): Intent } diff --git a/app/src/main/java/org/oppia/android/app/shim/IntentFactoryShimImpl.kt b/app/src/main/java/org/oppia/android/app/shim/IntentFactoryShimImpl.kt index f8383f9f67b..cf342ba0ee9 100644 --- a/app/src/main/java/org/oppia/android/app/shim/IntentFactoryShimImpl.kt +++ b/app/src/main/java/org/oppia/android/app/shim/IntentFactoryShimImpl.kt @@ -54,19 +54,4 @@ class IntentFactoryShimImpl @Inject constructor( topicId ) } - - /** - * Creates a recently played activity intent for [PromotedStoryListViewModel] and passes - * necessary string data. - */ - override fun createRecentlyPlayedActivityIntent( - context: Context, - internalProfileId: Int - ): Intent { - return recentlyPlayedActivityIntentFactory.createIntent( - ProfileId.newBuilder().apply { - internalId = internalProfileId - }.build() - ) - } } diff --git a/app/src/main/java/org/oppia/android/app/testing/HomeFragmentTestActivity.kt b/app/src/main/java/org/oppia/android/app/testing/HomeFragmentTestActivity.kt index 7d338ca931b..691185772cc 100644 --- a/app/src/main/java/org/oppia/android/app/testing/HomeFragmentTestActivity.kt +++ b/app/src/main/java/org/oppia/android/app/testing/HomeFragmentTestActivity.kt @@ -8,6 +8,7 @@ import org.oppia.android.app.home.HomeFragment import org.oppia.android.app.home.RouteToRecentlyPlayedListener import org.oppia.android.app.home.RouteToTopicListener import org.oppia.android.app.home.RouteToTopicPlayStoryListener +import org.oppia.android.app.model.RecentlyPlayedActivityTitle import org.oppia.android.app.testing.activity.TestActivity /** @@ -34,5 +35,5 @@ class HomeFragmentTestActivity : // Override functions are needed to fulfill listener definitions. override fun routeToTopic(internalProfileId: Int, topicId: String) {} override fun routeToTopicPlayStory(internalProfileId: Int, topicId: String, storyId: String) {} - override fun routeToRecentlyPlayed() {} + override fun routeToRecentlyPlayed(recentlyPlayedActivityTitle: RecentlyPlayedActivityTitle) {} } diff --git a/app/src/main/java/org/oppia/android/app/testing/NavigationDrawerTestActivity.kt b/app/src/main/java/org/oppia/android/app/testing/NavigationDrawerTestActivity.kt index 27bde7e34bf..554c19474f9 100644 --- a/app/src/main/java/org/oppia/android/app/testing/NavigationDrawerTestActivity.kt +++ b/app/src/main/java/org/oppia/android/app/testing/NavigationDrawerTestActivity.kt @@ -6,12 +6,16 @@ import android.os.Bundle import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponentImpl import org.oppia.android.app.activity.InjectableAppCompatActivity +import org.oppia.android.app.activity.route.ActivityRouter import org.oppia.android.app.drawer.NAVIGATION_PROFILE_ID_ARGUMENT_KEY import org.oppia.android.app.home.HomeActivityPresenter import org.oppia.android.app.home.RouteToRecentlyPlayedListener import org.oppia.android.app.home.RouteToTopicListener import org.oppia.android.app.home.RouteToTopicPlayStoryListener -import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity +import org.oppia.android.app.model.DestinationScreen +import org.oppia.android.app.model.ProfileId +import org.oppia.android.app.model.RecentlyPlayedActivityParams +import org.oppia.android.app.model.RecentlyPlayedActivityTitle import org.oppia.android.app.topic.TopicActivity import org.oppia.android.app.translation.AppLanguageResourceHandler import javax.inject.Inject @@ -27,6 +31,9 @@ class NavigationDrawerTestActivity : @Inject lateinit var resourceHandler: AppLanguageResourceHandler + @Inject + lateinit var activityRouter: ActivityRouter + private var internalProfileId: Int = -1 companion object { @@ -65,12 +72,19 @@ class NavigationDrawerTestActivity : ) } - override fun routeToRecentlyPlayed() { - startActivity( - RecentlyPlayedActivity.createRecentlyPlayedActivityIntent( - this, - internalProfileId - ) + override fun routeToRecentlyPlayed(recentlyPlayedActivityTitle: RecentlyPlayedActivityTitle) { + val recentlyPlayedActivityParams = + RecentlyPlayedActivityParams + .newBuilder() + .setProfileId(ProfileId.newBuilder().setInternalId(internalProfileId).build()) + .setActivityTitle(recentlyPlayedActivityTitle) + .build() + + activityRouter.routeToScreen( + DestinationScreen + .newBuilder() + .setRecentlyPlayedActivityParams(recentlyPlayedActivityParams) + .build() ) } } diff --git a/app/src/main/java/org/oppia/android/app/testing/activity/BUILD.bazel b/app/src/main/java/org/oppia/android/app/testing/activity/BUILD.bazel index 856f98fd7fd..dee935d85d9 100644 --- a/app/src/main/java/org/oppia/android/app/testing/activity/BUILD.bazel +++ b/app/src/main/java/org/oppia/android/app/testing/activity/BUILD.bazel @@ -30,6 +30,7 @@ kt_android_library( "//app:databinding_resources", "//app/src/main/java/org/oppia/android/app/activity:activity_intent_factories_shim", "//app/src/main/java/org/oppia/android/app/activity:injectable_app_compat_activity", + "//app/src/main/java/org/oppia/android/app/activity/route:activity_router", "//app/src/main/java/org/oppia/android/app/utility/math:math_expression_accessibility_util", ], ) diff --git a/app/src/main/java/org/oppia/android/app/testing/activity/TestActivity.kt b/app/src/main/java/org/oppia/android/app/testing/activity/TestActivity.kt index 531cf3f0f82..23106626cdd 100644 --- a/app/src/main/java/org/oppia/android/app/testing/activity/TestActivity.kt +++ b/app/src/main/java/org/oppia/android/app/testing/activity/TestActivity.kt @@ -6,6 +6,7 @@ import android.os.Bundle import org.oppia.android.R import org.oppia.android.app.activity.ActivityIntentFactories import org.oppia.android.app.activity.InjectableAppCompatActivity +import org.oppia.android.app.activity.route.ActivityRouter import org.oppia.android.app.translation.AppLanguageResourceHandler import org.oppia.android.app.translation.AppLanguageWatcherMixin import org.oppia.android.app.utility.datetime.DateTimeUtil @@ -42,6 +43,9 @@ open class TestActivity : InjectableAppCompatActivity() { @Inject lateinit var mathExpressionAccessibilityUtil: MathExpressionAccessibilityUtil + @Inject + lateinit var activityRouter: ActivityRouter + override fun attachBaseContext(newBase: Context?) { super.attachBaseContext(newBase) (activityComponent as Injector).inject(this) diff --git a/app/src/main/res/layout/recently_played_activity.xml b/app/src/main/res/layout/recently_played_activity.xml index e130b320332..45681c01df7 100644 --- a/app/src/main/res/layout/recently_played_activity.xml +++ b/app/src/main/res/layout/recently_played_activity.xml @@ -1,7 +1,50 @@ - - + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/recently_played_fragment.xml b/app/src/main/res/layout/recently_played_fragment.xml index 97d24855129..fbd6bda9828 100644 --- a/app/src/main/res/layout/recently_played_fragment.xml +++ b/app/src/main/res/layout/recently_played_fragment.xml @@ -2,57 +2,29 @@ - + android:background="@color/color_def_white" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> - + - - - - - - - - - - + + diff --git a/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AdministratorControlsActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AdministratorControlsActivityTest.kt index 4c3ea8c5cba..46822f21a0a 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AdministratorControlsActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AdministratorControlsActivityTest.kt @@ -50,6 +50,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.administratorcontrols.appversion.AppVersionActivity import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector @@ -847,7 +848,7 @@ class AdministratorControlsActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AdministratorControlsFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AdministratorControlsFragmentTest.kt index fd1a2278ff0..a207829c2d4 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AdministratorControlsFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AdministratorControlsFragmentTest.kt @@ -42,6 +42,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -655,7 +656,7 @@ class AdministratorControlsFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AppVersionActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AppVersionActivityTest.kt index 153d2688e1e..1231cee1fa6 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AppVersionActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/AppVersionActivityTest.kt @@ -31,6 +31,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.administratorcontrols.appversion.AppVersionActivity import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector @@ -302,7 +303,7 @@ class AppVersionActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/learneranalytics/ProfileAndDeviceIdActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/learneranalytics/ProfileAndDeviceIdActivityTest.kt index 137a4babe7f..b56b06789cb 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/learneranalytics/ProfileAndDeviceIdActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/learneranalytics/ProfileAndDeviceIdActivityTest.kt @@ -23,6 +23,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -212,7 +213,8 @@ class ProfileAndDeviceIdActivityTest { SyncStatusModule::class, SplitScreenInteractionModule::class, NumericExpressionInputModule::class, AlgebraicExpressionInputModule::class, MathEquationInputModule::class, MetricLogSchedulerModule::class, - TestingBuildFlavorModule::class, EventLoggingConfigurationModule::class + TestingBuildFlavorModule::class, EventLoggingConfigurationModule::class, + ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/learneranalytics/ProfileAndDeviceIdFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/learneranalytics/ProfileAndDeviceIdFragmentTest.kt index cf733cdc228..871229964c6 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/learneranalytics/ProfileAndDeviceIdFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/administratorcontrols/learneranalytics/ProfileAndDeviceIdFragmentTest.kt @@ -37,6 +37,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -627,7 +628,8 @@ class ProfileAndDeviceIdFragmentTest { SyncStatusModule::class, SplitScreenInteractionModule::class, NumericExpressionInputModule::class, AlgebraicExpressionInputModule::class, MathEquationInputModule::class, MetricLogSchedulerModule::class, - TestingBuildFlavorModule::class, EventLoggingConfigurationModule::class + TestingBuildFlavorModule::class, EventLoggingConfigurationModule::class, + ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/completedstorylist/CompletedStoryListActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/completedstorylist/CompletedStoryListActivityTest.kt index 65c677c9edb..e90c2364da4 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/completedstorylist/CompletedStoryListActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/completedstorylist/CompletedStoryListActivityTest.kt @@ -32,6 +32,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -526,7 +527,7 @@ class CompletedStoryListActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/customview/LessonThumbnailImageViewTest.kt b/app/src/sharedTest/java/org/oppia/android/app/customview/LessonThumbnailImageViewTest.kt index 1438501e65d..9ca7bca188b 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/customview/LessonThumbnailImageViewTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/customview/LessonThumbnailImageViewTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -174,7 +175,7 @@ class LessonThumbnailImageViewTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/customview/interaction/MathExpressionInteractionsViewTest.kt b/app/src/sharedTest/java/org/oppia/android/app/customview/interaction/MathExpressionInteractionsViewTest.kt index 7a26df2af2b..98f94fa8513 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/customview/interaction/MathExpressionInteractionsViewTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/customview/interaction/MathExpressionInteractionsViewTest.kt @@ -21,6 +21,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1776,7 +1777,7 @@ class MathExpressionInteractionsViewTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/databinding/DrawableBindingAdaptersTest.kt b/app/src/sharedTest/java/org/oppia/android/app/databinding/DrawableBindingAdaptersTest.kt index 8af1f595d51..d65aab6f807 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/databinding/DrawableBindingAdaptersTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/databinding/DrawableBindingAdaptersTest.kt @@ -21,6 +21,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -185,7 +186,7 @@ class DrawableBindingAdaptersTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/databinding/ImageViewBindingAdaptersTest.kt b/app/src/sharedTest/java/org/oppia/android/app/databinding/ImageViewBindingAdaptersTest.kt index 7053f88a134..0728c9fbe2e 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/databinding/ImageViewBindingAdaptersTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/databinding/ImageViewBindingAdaptersTest.kt @@ -25,6 +25,7 @@ import org.mockito.Mockito.verify import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -227,7 +228,7 @@ class ImageViewBindingAdaptersTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) /** Create a TestApplicationComponent. */ diff --git a/app/src/sharedTest/java/org/oppia/android/app/databinding/MarginBindingAdaptersTest.kt b/app/src/sharedTest/java/org/oppia/android/app/databinding/MarginBindingAdaptersTest.kt index 5281a290837..eba64502f3d 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/databinding/MarginBindingAdaptersTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/databinding/MarginBindingAdaptersTest.kt @@ -27,6 +27,7 @@ import org.mockito.Mockito.verify import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -315,7 +316,7 @@ class MarginBindingAdaptersTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) /** Create a TestApplicationComponent. */ diff --git a/app/src/sharedTest/java/org/oppia/android/app/databinding/StateAssemblerMarginBindingAdaptersTest.kt b/app/src/sharedTest/java/org/oppia/android/app/databinding/StateAssemblerMarginBindingAdaptersTest.kt index edb673a07f3..a63e5549193 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/databinding/StateAssemblerMarginBindingAdaptersTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/databinding/StateAssemblerMarginBindingAdaptersTest.kt @@ -27,6 +27,7 @@ import org.mockito.Mockito.verify import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -503,7 +504,7 @@ class StateAssemblerMarginBindingAdaptersTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) /** Create a TestApplicationComponent. */ diff --git a/app/src/sharedTest/java/org/oppia/android/app/databinding/StateAssemblerPaddingBindingAdaptersTest.kt b/app/src/sharedTest/java/org/oppia/android/app/databinding/StateAssemblerPaddingBindingAdaptersTest.kt index d2c314b160b..3166c10cffb 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/databinding/StateAssemblerPaddingBindingAdaptersTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/databinding/StateAssemblerPaddingBindingAdaptersTest.kt @@ -25,6 +25,7 @@ import org.mockito.Mockito.verify import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -501,7 +502,7 @@ class StateAssemblerPaddingBindingAdaptersTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) diff --git a/app/src/sharedTest/java/org/oppia/android/app/databinding/TextViewBindingAdaptersTest.kt b/app/src/sharedTest/java/org/oppia/android/app/databinding/TextViewBindingAdaptersTest.kt index 63bbb54c9b9..b20ef9842ee 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/databinding/TextViewBindingAdaptersTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/databinding/TextViewBindingAdaptersTest.kt @@ -19,6 +19,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -334,7 +335,7 @@ class TextViewBindingAdaptersTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/databinding/ViewBindingAdaptersTest.kt b/app/src/sharedTest/java/org/oppia/android/app/databinding/ViewBindingAdaptersTest.kt index 5121c6dbf3b..a12e1072adc 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/databinding/ViewBindingAdaptersTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/databinding/ViewBindingAdaptersTest.kt @@ -25,6 +25,7 @@ import org.mockito.Mockito.verify import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -235,7 +236,7 @@ class ViewBindingAdaptersTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) /** Create a TestApplicationComponent. */ diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/DeveloperOptionsActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/DeveloperOptionsActivityTest.kt index dbc0261feae..e9c3d4a6c0f 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/DeveloperOptionsActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/DeveloperOptionsActivityTest.kt @@ -44,6 +44,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -337,7 +338,7 @@ class DeveloperOptionsActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/DeveloperOptionsFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/DeveloperOptionsFragmentTest.kt index ef3738ab1bc..509ab083eca 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/DeveloperOptionsFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/DeveloperOptionsFragmentTest.kt @@ -33,6 +33,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -658,7 +659,7 @@ class DeveloperOptionsFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkChaptersCompletedActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkChaptersCompletedActivityTest.kt index 4a25a0d07ac..a51d49ac9ab 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkChaptersCompletedActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkChaptersCompletedActivityTest.kt @@ -22,6 +22,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -199,7 +200,7 @@ class MarkChaptersCompletedActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkChaptersCompletedFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkChaptersCompletedFragmentTest.kt index e048c79beb6..6caea7b53c9 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkChaptersCompletedFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkChaptersCompletedFragmentTest.kt @@ -29,6 +29,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -917,7 +918,7 @@ class MarkChaptersCompletedFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkStoriesCompletedActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkStoriesCompletedActivityTest.kt index 7826de68167..8068c60af69 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkStoriesCompletedActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkStoriesCompletedActivityTest.kt @@ -22,6 +22,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -199,7 +200,7 @@ class MarkStoriesCompletedActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkStoriesCompletedFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkStoriesCompletedFragmentTest.kt index 97b87cde791..c5a5a35a458 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkStoriesCompletedFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkStoriesCompletedFragmentTest.kt @@ -29,6 +29,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -594,7 +595,7 @@ class MarkStoriesCompletedFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkTopicsCompletedActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkTopicsCompletedActivityTest.kt index ee1be8e72c5..a596f87c06d 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkTopicsCompletedActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkTopicsCompletedActivityTest.kt @@ -22,6 +22,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -199,7 +200,7 @@ class MarkTopicsCompletedActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkTopicsCompletedFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkTopicsCompletedFragmentTest.kt index e0a4015a1c4..c8e1a1a6873 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkTopicsCompletedFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/MarkTopicsCompletedFragmentTest.kt @@ -29,6 +29,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -564,7 +565,7 @@ class MarkTopicsCompletedFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/ViewEventLogsActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/ViewEventLogsActivityTest.kt index a4372e1fef3..b3bc95cd971 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/ViewEventLogsActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/ViewEventLogsActivityTest.kt @@ -23,6 +23,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -189,7 +190,8 @@ class ViewEventLogsActivityTest { LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, PerformanceMetricsAssessorModule::class, PerformanceMetricsConfigurationsModule::class, - TestingBuildFlavorModule::class, EventLoggingConfigurationModule::class + TestingBuildFlavorModule::class, EventLoggingConfigurationModule::class, + ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/ViewEventLogsFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/ViewEventLogsFragmentTest.kt index b7231952ec5..4ab640a5d24 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/ViewEventLogsFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/ViewEventLogsFragmentTest.kt @@ -25,6 +25,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -580,7 +581,7 @@ class ViewEventLogsFragmentTest { LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, PerformanceMetricsAssessorModule::class, PerformanceMetricsConfigurationsModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/forcenetworktype/ForceNetworkTypeActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/forcenetworktype/ForceNetworkTypeActivityTest.kt index 2291589ecb2..922f7f1ce05 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/forcenetworktype/ForceNetworkTypeActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/forcenetworktype/ForceNetworkTypeActivityTest.kt @@ -22,6 +22,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -190,7 +191,7 @@ class ForceNetworkTypeActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) /** [ApplicationComponent] for [ForceNetworkTypeActivityTest]. */ diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/forcenetworktype/ForceNetworkTypeFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/forcenetworktype/ForceNetworkTypeFragmentTest.kt index d2165f4b2ef..b99da448de8 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/forcenetworktype/ForceNetworkTypeFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/forcenetworktype/ForceNetworkTypeFragmentTest.kt @@ -25,6 +25,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -397,7 +398,7 @@ class ForceNetworkTypeFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) /** [ApplicationComponent] for [ForceNetworkTypeFragmentTest]. */ diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/mathexpressionparser/MathExpressionParserActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/mathexpressionparser/MathExpressionParserActivityTest.kt index ba81e5bb1fc..c24a328b65e 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/mathexpressionparser/MathExpressionParserActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/mathexpressionparser/MathExpressionParserActivityTest.kt @@ -20,6 +20,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -175,7 +176,7 @@ class MathExpressionParserActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/devoptions/mathexpressionparser/MathExpressionParserFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/devoptions/mathexpressionparser/MathExpressionParserFragmentTest.kt index a540d935ab6..d0ce319aa76 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/devoptions/mathexpressionparser/MathExpressionParserFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/devoptions/mathexpressionparser/MathExpressionParserFragmentTest.kt @@ -29,6 +29,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1415,7 +1416,7 @@ class MathExpressionParserFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/faq/FAQListFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/faq/FAQListFragmentTest.kt index b8ed8f6c174..3265712e306 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/faq/FAQListFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/faq/FAQListFragmentTest.kt @@ -29,6 +29,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -249,7 +250,7 @@ class FAQListFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/faq/FAQSingleActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/faq/FAQSingleActivityTest.kt index f3ab17ca753..7b46d1c9a2d 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/faq/FAQSingleActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/faq/FAQSingleActivityTest.kt @@ -27,6 +27,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -236,7 +237,7 @@ class FAQSingleActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/faq/FaqListActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/faq/FaqListActivityTest.kt index ba555d53740..608e41e367e 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/faq/FaqListActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/faq/FaqListActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -163,7 +164,7 @@ class FaqListActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/help/HelpActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/help/HelpActivityTest.kt index 015004880fa..26499ab1ab2 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/help/HelpActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/help/HelpActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -165,7 +166,7 @@ class HelpActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/help/HelpFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/help/HelpFragmentTest.kt index 9ab904dd100..8e3d0c50a80 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/help/HelpFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/help/HelpFragmentTest.kt @@ -39,6 +39,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1444,7 +1445,7 @@ class HelpFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt index ee6eb92d460..6d4ecf49330 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt @@ -45,6 +45,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1842,7 +1843,7 @@ class HomeActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/home/RecentlyPlayedFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/home/RecentlyPlayedFragmentTest.kt index 4ee67706f8f..08c73555952 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/home/RecentlyPlayedFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/home/RecentlyPlayedFragmentTest.kt @@ -18,7 +18,6 @@ import androidx.test.espresso.contrib.RecyclerViewActions.scrollToPosition import androidx.test.espresso.intent.Intents import androidx.test.espresso.intent.Intents.intended import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent -import androidx.test.espresso.intent.matcher.IntentMatchers.hasExtra import androidx.test.espresso.matcher.ViewMatchers.isDisplayed import androidx.test.espresso.matcher.ViewMatchers.isRoot import androidx.test.espresso.matcher.ViewMatchers.withContentDescription @@ -45,6 +44,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -58,6 +58,8 @@ import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedFragment import org.oppia.android.app.model.ExplorationActivityParams import org.oppia.android.app.model.ExplorationCheckpoint import org.oppia.android.app.model.ProfileId +import org.oppia.android.app.model.RecentlyPlayedActivityParams +import org.oppia.android.app.model.RecentlyPlayedActivityTitle import org.oppia.android.app.model.ResumeLessonActivityParams import org.oppia.android.app.model.ScreenName import org.oppia.android.app.player.exploration.ExplorationActivity @@ -204,10 +206,20 @@ class RecentlyPlayedFragmentTest { ApplicationProvider.getApplicationContext().inject(this) } - private fun createRecentlyPlayedActivityIntent(internalProfileId: Int): Intent { + private fun createRecentlyPlayedActivityIntent( + internalProfileId: Int, + recentlyPlayedActivityTitle: RecentlyPlayedActivityTitle = + RecentlyPlayedActivityTitle.RECENTLY_PLAYED_STORIES + ): Intent { + val recentlyPlayedActivityParams = + RecentlyPlayedActivityParams + .newBuilder() + .setProfileId(ProfileId.newBuilder().setInternalId(internalProfileId).build()) + .setActivityTitle(recentlyPlayedActivityTitle) + .build() return RecentlyPlayedActivity.createRecentlyPlayedActivityIntent( context = context, - internalProfileId = internalProfileId + recentlyPlayedActivityParams = recentlyPlayedActivityParams ) } @@ -358,7 +370,8 @@ class RecentlyPlayedFragmentTest { ) ActivityScenario.launch( createRecentlyPlayedActivityIntent( - internalProfileId = internalProfileId + internalProfileId = internalProfileId, + RecentlyPlayedActivityTitle.STORIES_FOR_YOU ) ).use { testCoroutineDispatchers.runCurrent() @@ -1493,7 +1506,7 @@ class RecentlyPlayedFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/home/TopicSummaryViewModelTest.kt b/app/src/sharedTest/java/org/oppia/android/app/home/TopicSummaryViewModelTest.kt index 5781c34108e..94c45083019 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/home/TopicSummaryViewModelTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/home/TopicSummaryViewModelTest.kt @@ -14,6 +14,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -386,7 +387,7 @@ class TopicSummaryViewModelTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/home/WelcomeViewModelTest.kt b/app/src/sharedTest/java/org/oppia/android/app/home/WelcomeViewModelTest.kt index f1b43a8cae1..b950b6ef853 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/home/WelcomeViewModelTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/home/WelcomeViewModelTest.kt @@ -15,6 +15,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -359,7 +360,7 @@ class WelcomeViewModelTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/home/promotedlist/PromotedStoryListViewModelTest.kt b/app/src/sharedTest/java/org/oppia/android/app/home/promotedlist/PromotedStoryListViewModelTest.kt index 3ede52bd2d7..6480ab29fb9 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/home/promotedlist/PromotedStoryListViewModelTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/home/promotedlist/PromotedStoryListViewModelTest.kt @@ -14,6 +14,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -371,7 +372,7 @@ class PromotedStoryListViewModelTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/home/promotedlist/PromotedStoryViewModelTest.kt b/app/src/sharedTest/java/org/oppia/android/app/home/promotedlist/PromotedStoryViewModelTest.kt index d14ad879996..3066d3f7671 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/home/promotedlist/PromotedStoryViewModelTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/home/promotedlist/PromotedStoryViewModelTest.kt @@ -14,6 +14,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -389,7 +390,7 @@ class PromotedStoryViewModelTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/mydownloads/MyDownloadsActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/mydownloads/MyDownloadsActivityTest.kt index 315e6b3833e..a53ded6b5de 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/mydownloads/MyDownloadsActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/mydownloads/MyDownloadsActivityTest.kt @@ -15,6 +15,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -156,7 +157,7 @@ class MyDownloadsActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/mydownloads/MyDownloadsFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/mydownloads/MyDownloadsFragmentTest.kt index d13394cfb7a..7122fae10c5 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/mydownloads/MyDownloadsFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/mydownloads/MyDownloadsFragmentTest.kt @@ -25,6 +25,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -235,7 +236,7 @@ class MyDownloadsFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/notice/BetaNoticeDialogFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/notice/BetaNoticeDialogFragmentTest.kt index 035790ca824..0daad1ed8d4 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/notice/BetaNoticeDialogFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/notice/BetaNoticeDialogFragmentTest.kt @@ -28,6 +28,7 @@ import org.mockito.junit.MockitoRule import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -246,7 +247,7 @@ class BetaNoticeDialogFragmentTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, TestingBuildFlavorModule::class, CachingTestModule::class, MetricLogSchedulerModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/notice/GeneralAvailabilityUpgradeNoticeDialogFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/notice/GeneralAvailabilityUpgradeNoticeDialogFragmentTest.kt index b5e5e3450e7..d60da9c176d 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/notice/GeneralAvailabilityUpgradeNoticeDialogFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/notice/GeneralAvailabilityUpgradeNoticeDialogFragmentTest.kt @@ -28,6 +28,7 @@ import org.mockito.junit.MockitoRule import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -253,7 +254,7 @@ class GeneralAvailabilityUpgradeNoticeDialogFragmentTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, TestingBuildFlavorModule::class, CachingTestModule::class, MetricLogSchedulerModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingActivityTest.kt index 501924d9e4f..a35f4d18999 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -162,7 +163,7 @@ class OnboardingActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt index c3a5de0f2f4..9116a556f27 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/onboarding/OnboardingFragmentTest.kt @@ -41,6 +41,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -725,7 +726,7 @@ class OnboardingFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/ongoingtopiclist/OngoingTopicListActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/ongoingtopiclist/OngoingTopicListActivityTest.kt index 3f8c335087a..2697b0bc999 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/ongoingtopiclist/OngoingTopicListActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/ongoingtopiclist/OngoingTopicListActivityTest.kt @@ -31,6 +31,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -470,7 +471,7 @@ class OngoingTopicListActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/options/AppLanguageActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/options/AppLanguageActivityTest.kt index 669f4916e8b..2d0201ee318 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/options/AppLanguageActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/options/AppLanguageActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -172,7 +173,7 @@ class AppLanguageActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/options/AppLanguageFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/options/AppLanguageFragmentTest.kt index 17c8ee02ba4..cf0c1cc3af2 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/options/AppLanguageFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/options/AppLanguageFragmentTest.kt @@ -23,6 +23,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -258,7 +259,7 @@ class AppLanguageFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/options/AudioLanguageActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/options/AudioLanguageActivityTest.kt index ca3738b35a3..5406fe632bb 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/options/AudioLanguageActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/options/AudioLanguageActivityTest.kt @@ -15,6 +15,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -161,7 +162,7 @@ class AudioLanguageActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/options/AudioLanguageFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/options/AudioLanguageFragmentTest.kt index f2791837fb7..57db9c5bb88 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/options/AudioLanguageFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/options/AudioLanguageFragmentTest.kt @@ -23,6 +23,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -296,7 +297,7 @@ class AudioLanguageFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/options/OptionsActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/options/OptionsActivityTest.kt index 0ec2267f90e..244db7a2275 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/options/OptionsActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/options/OptionsActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -164,7 +165,7 @@ class OptionsActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/options/OptionsFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/options/OptionsFragmentTest.kt index 14170ca4d8b..965dfd25f1d 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/options/OptionsFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/options/OptionsFragmentTest.kt @@ -38,6 +38,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -670,7 +671,7 @@ class OptionsFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/options/ReadingTextSizeActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/options/ReadingTextSizeActivityTest.kt index 85df686dfc2..8aed5d4cb1f 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/options/ReadingTextSizeActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/options/ReadingTextSizeActivityTest.kt @@ -15,6 +15,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -161,7 +162,7 @@ class ReadingTextSizeActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/options/ReadingTextSizeFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/options/ReadingTextSizeFragmentTest.kt index 8c16be1d460..a57fe74dd4c 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/options/ReadingTextSizeFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/options/ReadingTextSizeFragmentTest.kt @@ -29,6 +29,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -313,7 +314,7 @@ class ReadingTextSizeFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/parser/HtmlParserTest.kt b/app/src/sharedTest/java/org/oppia/android/app/parser/HtmlParserTest.kt index 627641ee52c..2b39ef109be 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/parser/HtmlParserTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/parser/HtmlParserTest.kt @@ -49,6 +49,7 @@ import org.mockito.junit.MockitoRule import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -909,7 +910,7 @@ class HtmlParserTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/player/audio/AudioFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/player/audio/AudioFragmentTest.kt index 11d4004a462..f45fb12cb31 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/player/audio/AudioFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/player/audio/AudioFragmentTest.kt @@ -36,6 +36,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -480,7 +481,7 @@ class AudioFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/player/exploration/BottomSheetOptionsMenuTest.kt b/app/src/sharedTest/java/org/oppia/android/app/player/exploration/BottomSheetOptionsMenuTest.kt index 4aab249b20c..917d12c0abe 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/player/exploration/BottomSheetOptionsMenuTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/player/exploration/BottomSheetOptionsMenuTest.kt @@ -24,6 +24,7 @@ import org.mockito.junit.MockitoRule import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -189,7 +190,7 @@ class BottomSheetOptionsMenuTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, TestingBuildFlavorModule::class, CachingTestModule::class, MetricLogSchedulerModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/player/exploration/ExplorationActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/player/exploration/ExplorationActivityTest.kt index 23618f3e5a0..f5f96f666ab 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/player/exploration/ExplorationActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/player/exploration/ExplorationActivityTest.kt @@ -61,6 +61,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -2021,7 +2022,7 @@ class ExplorationActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) diff --git a/app/src/sharedTest/java/org/oppia/android/app/player/state/StateFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/player/state/StateFragmentTest.kt index dc3a5a0220e..5ef1a4e5853 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/player/state/StateFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/player/state/StateFragmentTest.kt @@ -65,6 +65,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -4321,7 +4322,7 @@ class StateFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/policies/PoliciesActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/policies/PoliciesActivityTest.kt index 19ab2f21baf..0d6c930f9bc 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/policies/PoliciesActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/policies/PoliciesActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -198,7 +199,7 @@ class PoliciesActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/policies/PoliciesFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/policies/PoliciesFragmentTest.kt index 68b2cd6cec0..57c7bb4ff05 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/policies/PoliciesFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/policies/PoliciesFragmentTest.kt @@ -38,6 +38,7 @@ import org.mockito.Mockito.verify import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -339,7 +340,7 @@ class PoliciesFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/profile/AddProfileActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/profile/AddProfileActivityTest.kt index 52cbbcef642..207bb529915 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/profile/AddProfileActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/profile/AddProfileActivityTest.kt @@ -49,6 +49,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1743,7 +1744,7 @@ class AddProfileActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/profile/AdminAuthActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/profile/AdminAuthActivityTest.kt index 2ddb5a91a42..f303890bc4d 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/profile/AdminAuthActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/profile/AdminAuthActivityTest.kt @@ -34,6 +34,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.administratorcontrols.AdministratorControlsActivity import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector @@ -689,7 +690,7 @@ class AdminAuthActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/profile/AdminPinActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/profile/AdminPinActivityTest.kt index ba8c2a64e1e..f4d41e0a7cc 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/profile/AdminPinActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/profile/AdminPinActivityTest.kt @@ -43,6 +43,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.administratorcontrols.AdministratorControlsActivity import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector @@ -1106,7 +1107,7 @@ class AdminPinActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/profile/PinPasswordActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/profile/PinPasswordActivityTest.kt index a9e7bd27c0f..4a6313b819f 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/profile/PinPasswordActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/profile/PinPasswordActivityTest.kt @@ -37,6 +37,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1199,7 +1200,7 @@ class PinPasswordActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/profile/ProfileChooserActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/profile/ProfileChooserActivityTest.kt index 328dc3d68cf..86a2794b546 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/profile/ProfileChooserActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/profile/ProfileChooserActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -160,7 +161,7 @@ class ProfileChooserActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/profile/ProfileChooserFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/profile/ProfileChooserFragmentTest.kt index 491577a46c5..203cdc3f94f 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/profile/ProfileChooserFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/profile/ProfileChooserFragmentTest.kt @@ -33,6 +33,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.administratorcontrols.AdministratorControlsActivity import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector @@ -531,7 +532,7 @@ class ProfileChooserFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfilePictureActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfilePictureActivityTest.kt index d9acab18dec..76b7ccfc861 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfilePictureActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfilePictureActivityTest.kt @@ -24,6 +24,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -216,7 +217,7 @@ class ProfilePictureActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfileProgressActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfileProgressActivityTest.kt index 02c6de5268d..bcb8fd90041 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfileProgressActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfileProgressActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -166,7 +167,7 @@ class ProfileProgressActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfileProgressFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfileProgressFragmentTest.kt index 6ced814a501..d7f9505d58c 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfileProgressFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/profileprogress/ProfileProgressFragmentTest.kt @@ -35,12 +35,15 @@ import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.android.material.card.MaterialCardView import com.google.common.truth.Truth.assertThat +import com.google.protobuf.MessageLite import dagger.Component import dagger.Module import dagger.Provides import org.hamcrest.CoreMatchers.allOf import org.hamcrest.CoreMatchers.not +import org.hamcrest.Description import org.hamcrest.Matcher +import org.hamcrest.TypeSafeMatcher import org.junit.After import org.junit.Before import org.junit.Rule @@ -49,6 +52,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -59,7 +63,10 @@ import org.oppia.android.app.completedstorylist.CompletedStoryListActivity import org.oppia.android.app.devoptions.DeveloperOptionsModule import org.oppia.android.app.devoptions.DeveloperOptionsStarterModule import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity +import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity.Companion.RECENTLY_PLAYED_ACTIVITY_INTENT_EXTRAS_KEY import org.oppia.android.app.model.ProfileId +import org.oppia.android.app.model.RecentlyPlayedActivityParams +import org.oppia.android.app.model.RecentlyPlayedActivityTitle import org.oppia.android.app.ongoingtopiclist.OngoingTopicListActivity import org.oppia.android.app.player.state.itemviewmodel.SplitScreenInteractionModule import org.oppia.android.app.recyclerview.RecyclerViewMatcher.Companion.atPositionOnView @@ -112,6 +119,7 @@ import org.oppia.android.testing.time.FakeOppiaClockModule import org.oppia.android.util.accessibility.AccessibilityTestModule import org.oppia.android.util.caching.AssetModule import org.oppia.android.util.caching.testing.CachingTestModule +import org.oppia.android.util.extensions.getProtoExtra import org.oppia.android.util.gcsresource.GcsResourceModule import org.oppia.android.util.locale.LocaleProdModule import org.oppia.android.util.logging.EnableConsoleLog @@ -650,7 +658,7 @@ class ProfileProgressFragmentTest { } @Test - fun testProfileProgressFragment_clickViewAll_opensRecentlyPlayedActivity() { + fun testClickViewAll_withLessThanTwoStories_opensRecentlyPlayedActivityWithStoriesForYouTitle() { storyProgressTestHelper.markInProgressSavedFractionsStory0Exp0( profileId = ProfileId.newBuilder().setInternalId(internalProfileId).build(), timestampOlderThanOneWeek = false @@ -662,12 +670,52 @@ class ProfileProgressFragmentTest { targetViewId = R.id.view_all_text_view, stringToMatch = "View All" ) + val recentlyPlayedActivityParams = RecentlyPlayedActivityParams + .newBuilder() + .setProfileId(ProfileId.newBuilder().setInternalId(internalProfileId).build()) + .setActivityTitle(RecentlyPlayedActivityTitle.STORIES_FOR_YOU) + .build() clickProfileProgressItem(itemPosition = 0, targetViewId = R.id.view_all_text_view) - intended(hasComponent(RecentlyPlayedActivity::class.java.name)) intended( - hasExtra( - RecentlyPlayedActivity.RECENTLY_PLAYED_ACTIVITY_INTERNAL_PROFILE_ID_KEY, - internalProfileId + allOf( + hasProtoExtra(RECENTLY_PLAYED_ACTIVITY_INTENT_EXTRAS_KEY, recentlyPlayedActivityParams), + hasComponent(RecentlyPlayedActivity::class.java.name) + ) + ) + } + } + + @Test + fun testClickViewAll_threeStoriesStarted_opensRecentlyPlayedActivityWithRecentlyPlayedTitle() { + storyProgressTestHelper.markCompletedFractionsStory0( + profileId = ProfileId.newBuilder().setInternalId(internalProfileId).build(), + timestampOlderThanOneWeek = false + ) + storyProgressTestHelper.markCompletedRatiosStory0( + profileId = ProfileId.newBuilder().setInternalId(internalProfileId).build(), + timestampOlderThanOneWeek = false + ) + storyProgressTestHelper.markInProgressNotSavedTestTopic0Story0( + profileId = ProfileId.newBuilder().setInternalId(internalProfileId).build(), + timestampOlderThanOneWeek = false + ) + launch(createProfileProgressActivityIntent(internalProfileId)).use { + testCoroutineDispatchers.runCurrent() + verifyItemDisplayedOnProfileProgressListItem( + itemPosition = 0, + targetViewId = R.id.view_all_text_view, + stringToMatch = "View All" + ) + val recentlyPlayedActivityParams = RecentlyPlayedActivityParams + .newBuilder() + .setProfileId(ProfileId.newBuilder().setInternalId(internalProfileId).build()) + .setActivityTitle(RecentlyPlayedActivityTitle.RECENTLY_PLAYED_STORIES) + .build() + clickProfileProgressItem(itemPosition = 0, targetViewId = R.id.view_all_text_view) + intended( + allOf( + hasProtoExtra(RECENTLY_PLAYED_ACTIVITY_INTENT_EXTRAS_KEY, recentlyPlayedActivityParams), + hasComponent(RecentlyPlayedActivity::class.java.name) ) ) } @@ -814,6 +862,20 @@ class ProfileProgressFragmentTest { .check(matches(isDisplayed())) } + private fun hasProtoExtra(keyName: String, expectedProto: T): Matcher { + val defaultProto = expectedProto.newBuilderForType().build() + return object : TypeSafeMatcher() { + override fun describeTo(description: Description) { + description.appendText("Intent with extra: $keyName and proto value: $expectedProto") + } + + override fun matchesSafely(intent: Intent): Boolean { + return intent.hasExtra(keyName) && + intent.getProtoExtra(keyName, defaultProto) == expectedProto + } + } + } + @Module class TestModule { // TODO(#59): Either isolate these to their own shared test module, or use the real logging @@ -858,7 +920,7 @@ class ProfileProgressFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/recyclerview/BindableAdapterTest.kt b/app/src/sharedTest/java/org/oppia/android/app/recyclerview/BindableAdapterTest.kt index 979b7860692..945d185bcc1 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/recyclerview/BindableAdapterTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/recyclerview/BindableAdapterTest.kt @@ -32,6 +32,7 @@ import org.oppia.android.app.activity.ActivityComponentFactory import org.oppia.android.app.activity.ActivityComponentImpl import org.oppia.android.app.activity.ActivityIntentFactoriesModule import org.oppia.android.app.activity.ActivityScope +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -679,7 +680,7 @@ class BindableAdapterTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/resumelesson/ResumeLessonActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/resumelesson/ResumeLessonActivityTest.kt index a49ce748f37..8a81395fe4e 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/resumelesson/ResumeLessonActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/resumelesson/ResumeLessonActivityTest.kt @@ -29,6 +29,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -236,7 +237,7 @@ class ResumeLessonActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/resumelesson/ResumeLessonFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/resumelesson/ResumeLessonFragmentTest.kt index 1cd74515a67..36dc8256b60 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/resumelesson/ResumeLessonFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/resumelesson/ResumeLessonFragmentTest.kt @@ -28,6 +28,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -316,7 +317,7 @@ class ResumeLessonFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileEditActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileEditActivityTest.kt index 80f3f1a12fe..c82ecbdceba 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileEditActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileEditActivityTest.kt @@ -30,6 +30,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.administratorcontrols.AdministratorControlsActivity import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector @@ -392,7 +393,7 @@ class ProfileEditActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileEditFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileEditFragmentTest.kt index 765c7624f72..68fc525d6a5 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileEditFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileEditFragmentTest.kt @@ -30,6 +30,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -362,7 +363,7 @@ class ProfileEditFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) diff --git a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileListActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileListActivityTest.kt index e25fb28a68a..cfe3fa7d134 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileListActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileListActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -162,7 +163,7 @@ class ProfileListActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileListFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileListFragmentTest.kt index 271f41f70b2..935a4b654f0 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileListFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileListFragmentTest.kt @@ -28,6 +28,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -391,7 +392,7 @@ class ProfileListFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileRenameActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileRenameActivityTest.kt index 70d6cc61378..481d510a8eb 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileRenameActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileRenameActivityTest.kt @@ -17,6 +17,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -188,7 +189,7 @@ class ProfileRenameActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileRenameFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileRenameFragmentTest.kt index fb3b57ffb3b..c97ff75adf2 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileRenameFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileRenameFragmentTest.kt @@ -32,6 +32,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -465,7 +466,7 @@ class ProfileRenameFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileResetPinActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileResetPinActivityTest.kt index e2ad07369ea..d68bc4a09de 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileResetPinActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileResetPinActivityTest.kt @@ -18,6 +18,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -197,7 +198,7 @@ class ProfileResetPinActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileResetPinFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileResetPinFragmentTest.kt index 9a43767dc8a..671a2e6e5bb 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileResetPinFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/settings/profile/ProfileResetPinFragmentTest.kt @@ -33,6 +33,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1029,7 +1030,7 @@ class ProfileResetPinFragmentTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/splash/SplashActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/splash/SplashActivityTest.kt index 4330f0192d2..7eed3e3e8c8 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/splash/SplashActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/splash/SplashActivityTest.kt @@ -35,6 +35,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1218,7 +1219,7 @@ class SplashActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/story/StoryActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/story/StoryActivityTest.kt index 40a4ae3c082..18949814fa8 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/story/StoryActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/story/StoryActivityTest.kt @@ -33,6 +33,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -276,7 +277,7 @@ class StoryActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/story/StoryFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/story/StoryFragmentTest.kt index b3adcc635f8..56b13f6c727 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/story/StoryFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/story/StoryFragmentTest.kt @@ -58,6 +58,7 @@ import org.mockito.junit.MockitoRule import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -962,7 +963,7 @@ class StoryFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/testing/DragDropTestActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/testing/DragDropTestActivityTest.kt index 1bbe062736e..2b84966d8cc 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/testing/DragDropTestActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/testing/DragDropTestActivityTest.kt @@ -19,6 +19,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -233,7 +234,7 @@ class DragDropTestActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/testing/ImageRegionSelectionInteractionViewTest.kt b/app/src/sharedTest/java/org/oppia/android/app/testing/ImageRegionSelectionInteractionViewTest.kt index e9f7111f323..f9c25835bca 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/testing/ImageRegionSelectionInteractionViewTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/testing/ImageRegionSelectionInteractionViewTest.kt @@ -31,6 +31,7 @@ import org.mockito.junit.MockitoJUnit import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -400,7 +401,7 @@ class ImageRegionSelectionInteractionViewTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/testing/InputInteractionViewTestActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/testing/InputInteractionViewTestActivityTest.kt index 775aeea8b92..a782d5699fe 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/testing/InputInteractionViewTestActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/testing/InputInteractionViewTestActivityTest.kt @@ -31,6 +31,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1128,7 +1129,7 @@ class InputInteractionViewTestActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/testing/NavigationDrawerActivityDebugTest.kt b/app/src/sharedTest/java/org/oppia/android/app/testing/NavigationDrawerActivityDebugTest.kt index 01509474963..024b739a251 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/testing/NavigationDrawerActivityDebugTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/testing/NavigationDrawerActivityDebugTest.kt @@ -50,6 +50,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -441,7 +442,7 @@ class NavigationDrawerActivityDebugTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/testing/NavigationDrawerActivityProdTest.kt b/app/src/sharedTest/java/org/oppia/android/app/testing/NavigationDrawerActivityProdTest.kt index 9db71a8d209..d3a39fd703a 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/testing/NavigationDrawerActivityProdTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/testing/NavigationDrawerActivityProdTest.kt @@ -54,6 +54,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.administratorcontrols.AdministratorControlsActivity import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector @@ -990,7 +991,7 @@ class NavigationDrawerActivityProdTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/testing/TestFontScaleConfigurationUtilActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/testing/TestFontScaleConfigurationUtilActivityTest.kt index d594b1dc296..1d9a2c4616f 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/testing/TestFontScaleConfigurationUtilActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/testing/TestFontScaleConfigurationUtilActivityTest.kt @@ -20,6 +20,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -208,7 +209,7 @@ class TestFontScaleConfigurationUtilActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/testing/TopicTestActivityForStoryTest.kt b/app/src/sharedTest/java/org/oppia/android/app/testing/TopicTestActivityForStoryTest.kt index fbe75718717..3558c7d1a24 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/testing/TopicTestActivityForStoryTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/testing/TopicTestActivityForStoryTest.kt @@ -23,6 +23,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -209,7 +210,7 @@ class TopicTestActivityForStoryTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseListActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseListActivityTest.kt index b5546bc739e..2f3f58b1843 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseListActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseListActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -175,7 +176,7 @@ class LicenseListActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) diff --git a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseListFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseListFragmentTest.kt index fa731e23c92..5170d5c4daa 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseListFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseListFragmentTest.kt @@ -29,6 +29,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -375,7 +376,7 @@ class LicenseListFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) diff --git a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseTextViewerActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseTextViewerActivityTest.kt index 0713bdc6aa2..f2719021d0d 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseTextViewerActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseTextViewerActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -184,7 +185,7 @@ class LicenseTextViewerActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) diff --git a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseTextViewerFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseTextViewerFragmentTest.kt index 4bcbe80f24b..747896b0272 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseTextViewerFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/LicenseTextViewerFragmentTest.kt @@ -21,6 +21,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -353,7 +354,7 @@ class LicenseTextViewerFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) diff --git a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/ThirdPartyDependencyListActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/ThirdPartyDependencyListActivityTest.kt index e0254d12acd..8fb026e3051 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/ThirdPartyDependencyListActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/ThirdPartyDependencyListActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -172,7 +173,7 @@ class ThirdPartyDependencyListActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) diff --git a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/ThirdPartyDependencyListFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/ThirdPartyDependencyListFragmentTest.kt index 158470b85fa..ac8ca64d358 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/thirdparty/ThirdPartyDependencyListFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/thirdparty/ThirdPartyDependencyListFragmentTest.kt @@ -28,6 +28,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -485,7 +486,7 @@ class ThirdPartyDependencyListFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/TopicActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/TopicActivityTest.kt index 893b5020245..da5075c8edb 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/TopicActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/TopicActivityTest.kt @@ -28,6 +28,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -231,7 +232,7 @@ class TopicActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt index 7518b034d07..775d03f0949 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/TopicFragmentTest.kt @@ -38,6 +38,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -693,7 +694,7 @@ class TopicFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/conceptcard/ConceptCardFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/conceptcard/ConceptCardFragmentTest.kt index 9768f45f472..fd15e2b92a4 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/conceptcard/ConceptCardFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/conceptcard/ConceptCardFragmentTest.kt @@ -33,6 +33,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -437,7 +438,7 @@ class ConceptCardFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/info/TopicInfoFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/info/TopicInfoFragmentTest.kt index 6854f0a2fdf..66a2f96f365 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/info/TopicInfoFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/info/TopicInfoFragmentTest.kt @@ -38,6 +38,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -494,7 +495,7 @@ class TopicInfoFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentTest.kt index afdd2dbb348..d01401649b9 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentTest.kt @@ -42,6 +42,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1090,7 +1091,7 @@ class TopicLessonsFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/practice/TopicPracticeFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/practice/TopicPracticeFragmentTest.kt index 6c45c6bd485..1cf3ad6e30d 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/practice/TopicPracticeFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/practice/TopicPracticeFragmentTest.kt @@ -32,6 +32,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -439,7 +440,7 @@ class TopicPracticeFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerActivityTest.kt index 50c7fed000b..7f57ce460ce 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerActivityTest.kt @@ -50,6 +50,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -740,7 +741,7 @@ class QuestionPlayerActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/revision/TopicRevisionFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/revision/TopicRevisionFragmentTest.kt index 4be3f038b9e..7f3707175dd 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/revision/TopicRevisionFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/revision/TopicRevisionFragmentTest.kt @@ -32,6 +32,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -335,7 +336,7 @@ class TopicRevisionFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivityTest.kt index 81782910e0c..aeacb5b49e7 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivityTest.kt @@ -29,6 +29,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -307,7 +308,7 @@ class RevisionCardActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/topic/revisioncard/RevisionCardFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/topic/revisioncard/RevisionCardFragmentTest.kt index 819453de52f..33d19e2f5d5 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/topic/revisioncard/RevisionCardFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/topic/revisioncard/RevisionCardFragmentTest.kt @@ -42,6 +42,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -717,7 +718,7 @@ class RevisionCardFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/utility/RatioExtensionsTest.kt b/app/src/sharedTest/java/org/oppia/android/app/utility/RatioExtensionsTest.kt index e8aa77b22a2..2cbefc007df 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/utility/RatioExtensionsTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/utility/RatioExtensionsTest.kt @@ -13,6 +13,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -161,7 +162,7 @@ class RatioExtensionsTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughActivityTest.kt index c1abca398aa..59db9b5fdc2 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughActivityTest.kt @@ -26,6 +26,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -250,7 +251,7 @@ class WalkthroughActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughFinalFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughFinalFragmentTest.kt index f9e454fbcda..06a4b77f6c9 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughFinalFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughFinalFragmentTest.kt @@ -28,6 +28,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -296,7 +297,7 @@ class WalkthroughFinalFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughTopicListFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughTopicListFragmentTest.kt index e25d9cf1e63..3877ab5e72c 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughTopicListFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughTopicListFragmentTest.kt @@ -29,6 +29,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -322,7 +323,7 @@ class WalkthroughTopicListFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughWelcomeFragmentTest.kt b/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughWelcomeFragmentTest.kt index 3bdf71ce92e..a7b1edf7733 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughWelcomeFragmentTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/walkthrough/WalkthroughWelcomeFragmentTest.kt @@ -24,6 +24,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -219,7 +220,7 @@ class WalkthroughWelcomeFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/activity/ActivityIntentFactoriesTest.kt b/app/src/test/java/org/oppia/android/app/activity/ActivityIntentFactoriesTest.kt index a737c33e48a..beea5020a25 100644 --- a/app/src/test/java/org/oppia/android/app/activity/ActivityIntentFactoriesTest.kt +++ b/app/src/test/java/org/oppia/android/app/activity/ActivityIntentFactoriesTest.kt @@ -14,6 +14,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityIntentFactories.RecentlyPlayedActivityIntentFactory import org.oppia.android.app.activity.ActivityIntentFactories.TopicActivityIntentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -24,6 +25,7 @@ import org.oppia.android.app.devoptions.DeveloperOptionsModule import org.oppia.android.app.devoptions.DeveloperOptionsStarterModule import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity import org.oppia.android.app.model.ProfileId +import org.oppia.android.app.model.RecentlyPlayedActivityParams import org.oppia.android.app.player.state.itemviewmodel.SplitScreenInteractionModule import org.oppia.android.app.shim.ViewBindingShimModule import org.oppia.android.app.testing.activity.TestActivity @@ -132,7 +134,9 @@ class ActivityIntentFactoriesTest { @Test fun testRecentlyPlayedActivityIntentFactory_createIntent_returnsIntentToStartCorrectActivity() { val intent = - getRecentlyPlayedActivityIntentFactory().createIntent(ProfileId.getDefaultInstance()) + getRecentlyPlayedActivityIntentFactory().createIntent( + RecentlyPlayedActivityParams.getDefaultInstance() + ) assertThat(intent).hasComponentClass(RecentlyPlayedActivity::class.java) assertThat(intent).extras().integer(RECENTLY_PLAYED_PROFILE_ID_KEY).isEqualTo(0) @@ -184,7 +188,7 @@ class ActivityIntentFactoriesTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/activity/BUILD.bazel b/app/src/test/java/org/oppia/android/app/activity/BUILD.bazel index ba122153187..db0a93ddfc3 100644 --- a/app/src/test/java/org/oppia/android/app/activity/BUILD.bazel +++ b/app/src/test/java/org/oppia/android/app/activity/BUILD.bazel @@ -1,5 +1,5 @@ """ -Tests for root activity Dagger configuration classes. +Tests for general activity routing functionality. """ load("@dagger//:workspace_defs.bzl", "dagger_rules") diff --git a/app/src/test/java/org/oppia/android/app/activity/route/ActivityRouterModuleTest.kt b/app/src/test/java/org/oppia/android/app/activity/route/ActivityRouterModuleTest.kt new file mode 100644 index 00000000000..418d633c793 --- /dev/null +++ b/app/src/test/java/org/oppia/android/app/activity/route/ActivityRouterModuleTest.kt @@ -0,0 +1,193 @@ +package org.oppia.android.app.activity.route + +import android.app.Application +import android.content.Context +import androidx.appcompat.app.AppCompatActivity +import androidx.test.core.app.ApplicationProvider +import androidx.test.ext.junit.rules.ActivityScenarioRule +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.ext.truth.content.IntentSubject.assertThat +import com.google.common.truth.Truth.assertThat +import dagger.BindsInstance +import dagger.Component +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.oppia.android.app.activity.ActivityComponent +import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.ActivityIntentFactoriesModule +import org.oppia.android.app.application.ApplicationComponent +import org.oppia.android.app.application.ApplicationInjector +import org.oppia.android.app.application.ApplicationInjectorProvider +import org.oppia.android.app.application.ApplicationModule +import org.oppia.android.app.application.ApplicationStartupListenerModule +import org.oppia.android.app.application.testing.TestingBuildFlavorModule +import org.oppia.android.app.devoptions.DeveloperOptionsModule +import org.oppia.android.app.devoptions.DeveloperOptionsStarterModule +import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity +import org.oppia.android.app.model.DestinationScreen +import org.oppia.android.app.model.DestinationScreen.DestinationScreenCase +import org.oppia.android.app.player.state.itemviewmodel.SplitScreenInteractionModule +import org.oppia.android.app.shim.ViewBindingShimModule +import org.oppia.android.app.testing.activity.TestActivity +import org.oppia.android.app.translation.testing.ActivityRecreatorTestModule +import org.oppia.android.data.backends.gae.NetworkConfigProdModule +import org.oppia.android.data.backends.gae.NetworkModule +import org.oppia.android.domain.classify.InteractionsModule +import org.oppia.android.domain.classify.rules.algebraicexpressioninput.AlgebraicExpressionInputModule +import org.oppia.android.domain.classify.rules.continueinteraction.ContinueModule +import org.oppia.android.domain.classify.rules.dragAndDropSortInput.DragDropSortInputModule +import org.oppia.android.domain.classify.rules.fractioninput.FractionInputModule +import org.oppia.android.domain.classify.rules.imageClickInput.ImageClickInputModule +import org.oppia.android.domain.classify.rules.itemselectioninput.ItemSelectionInputModule +import org.oppia.android.domain.classify.rules.mathequationinput.MathEquationInputModule +import org.oppia.android.domain.classify.rules.multiplechoiceinput.MultipleChoiceInputModule +import org.oppia.android.domain.classify.rules.numberwithunits.NumberWithUnitsRuleModule +import org.oppia.android.domain.classify.rules.numericexpressioninput.NumericExpressionInputModule +import org.oppia.android.domain.classify.rules.numericinput.NumericInputRuleModule +import org.oppia.android.domain.classify.rules.ratioinput.RatioInputModule +import org.oppia.android.domain.classify.rules.textinput.TextInputRuleModule +import org.oppia.android.domain.exploration.lightweightcheckpointing.ExplorationStorageModule +import org.oppia.android.domain.hintsandsolution.HintsAndSolutionConfigModule +import org.oppia.android.domain.hintsandsolution.HintsAndSolutionProdModule +import org.oppia.android.domain.onboarding.testing.ExpirationMetaDataRetrieverTestModule +import org.oppia.android.domain.oppialogger.LogStorageModule +import org.oppia.android.domain.oppialogger.LoggingIdentifierModule +import org.oppia.android.domain.oppialogger.analytics.ApplicationLifecycleModule +import org.oppia.android.domain.oppialogger.logscheduler.MetricLogSchedulerModule +import org.oppia.android.domain.oppialogger.loguploader.LogReportWorkerModule +import org.oppia.android.domain.platformparameter.PlatformParameterModule +import org.oppia.android.domain.platformparameter.PlatformParameterSingletonModule +import org.oppia.android.domain.question.QuestionModule +import org.oppia.android.domain.topic.PrimeTopicAssetsControllerModule +import org.oppia.android.domain.workmanager.WorkManagerConfigurationModule +import org.oppia.android.testing.TestLogReportingModule +import org.oppia.android.testing.junit.InitializeDefaultLocaleRule +import org.oppia.android.testing.robolectric.RobolectricModule +import org.oppia.android.testing.threading.TestDispatcherModule +import org.oppia.android.testing.time.FakeOppiaClockModule +import org.oppia.android.util.accessibility.AccessibilityTestModule +import org.oppia.android.util.caching.AssetModule +import org.oppia.android.util.caching.testing.CachingTestModule +import org.oppia.android.util.gcsresource.GcsResourceModule +import org.oppia.android.util.locale.LocaleProdModule +import org.oppia.android.util.logging.EventLoggingConfigurationModule +import org.oppia.android.util.logging.LoggerModule +import org.oppia.android.util.logging.SyncStatusModule +import org.oppia.android.util.logging.firebase.FirebaseLogUploaderModule +import org.oppia.android.util.networking.NetworkConnectionDebugUtilModule +import org.oppia.android.util.networking.NetworkConnectionUtilDebugModule +import org.oppia.android.util.parser.html.HtmlParserEntityTypeModule +import org.oppia.android.util.parser.image.GlideImageLoaderModule +import org.oppia.android.util.parser.image.ImageParsingModule +import org.robolectric.annotation.Config +import org.robolectric.annotation.LooperMode +import javax.inject.Inject +import javax.inject.Singleton + +/** Tests for [ActivityRouterModule]. */ +// FunctionName: test names are conventionally named with underscores. +@Suppress("FunctionName") +@RunWith(AndroidJUnit4::class) +@LooperMode(LooperMode.Mode.PAUSED) +@Config(application = ActivityRouterModuleTest.TestApplication::class) +class ActivityRouterModuleTest { + @get:Rule + val initializeDefaultLocaleRule = InitializeDefaultLocaleRule() + + @Inject + lateinit var destinationRoutes: + Map + + @Inject + lateinit var context: Context + + @get:Rule + var activityRule = + ActivityScenarioRule( + TestActivity.createIntent(ApplicationProvider.getApplicationContext()) + ) + + @Before + fun setUp() { + setUpTestApplicationComponent() + } + + @Test + fun testInjectDestinationRoutes_hasRouteForRecentlyPlayedActivity() { + assertThat(destinationRoutes).containsKey(DestinationScreenCase.RECENTLY_PLAYED_ACTIVITY_PARAMS) + val route = destinationRoutes[DestinationScreenCase.RECENTLY_PLAYED_ACTIVITY_PARAMS] + val intent = route?.createIntent(context, DestinationScreen.getDefaultInstance()) + assertThat(intent).hasComponentClass(RecentlyPlayedActivity::class.java) + } + + @Test + fun testInjectDestinationRoutes_doesNotHaveRouteForDestinationScreenNotSet() { + assertThat(destinationRoutes) + .doesNotContainKey(DestinationScreenCase.DESTINATIONSCREEN_NOT_SET) + } + + private fun setUpTestApplicationComponent() { + ApplicationProvider.getApplicationContext().inject(this) + } + + // TODO(#89): Move this to a common test application component. + @Singleton + @Component( + modules = [ + RobolectricModule::class, TestDispatcherModule::class, ApplicationModule::class, + PlatformParameterModule::class, LoggerModule::class, ContinueModule::class, + FractionInputModule::class, ItemSelectionInputModule::class, MultipleChoiceInputModule::class, + NumberWithUnitsRuleModule::class, NumericInputRuleModule::class, TextInputRuleModule::class, + DragDropSortInputModule::class, ImageClickInputModule::class, InteractionsModule::class, + GcsResourceModule::class, GlideImageLoaderModule::class, ImageParsingModule::class, + HtmlParserEntityTypeModule::class, QuestionModule::class, TestLogReportingModule::class, + AccessibilityTestModule::class, LogStorageModule::class, CachingTestModule::class, + PrimeTopicAssetsControllerModule::class, ExpirationMetaDataRetrieverTestModule::class, + ViewBindingShimModule::class, RatioInputModule::class, NetworkConfigProdModule::class, + ApplicationStartupListenerModule::class, HintsAndSolutionConfigModule::class, + LogReportWorkerModule::class, WorkManagerConfigurationModule::class, + FirebaseLogUploaderModule::class, FakeOppiaClockModule::class, + DeveloperOptionsStarterModule::class, DeveloperOptionsModule::class, + ExplorationStorageModule::class, NetworkModule::class, HintsAndSolutionProdModule::class, + NetworkConnectionUtilDebugModule::class, NetworkConnectionDebugUtilModule::class, + AssetModule::class, LocaleProdModule::class, ActivityRecreatorTestModule::class, + ActivityIntentFactoriesModule::class, PlatformParameterSingletonModule::class, + NumericExpressionInputModule::class, AlgebraicExpressionInputModule::class, + MathEquationInputModule::class, SplitScreenInteractionModule::class, + LoggingIdentifierModule::class, ApplicationLifecycleModule::class, + SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, + EventLoggingConfigurationModule::class, ActivityRouterModule::class + ] + ) + interface TestApplicationComponent : ApplicationComponent { + @Component.Builder + interface Builder { + @BindsInstance + fun setApplication(application: Application): Builder + + fun build(): TestApplicationComponent + } + + fun inject(activityRouterModuleTest: ActivityRouterModuleTest) + } + + class TestApplication : Application(), ActivityComponentFactory, ApplicationInjectorProvider { + private val component: TestApplicationComponent by lazy { + DaggerActivityRouterModuleTest_TestApplicationComponent.builder() + .setApplication(this) + .build() + } + + fun inject(activityRouterModuleTest: ActivityRouterModuleTest) { + component.inject(activityRouterModuleTest) + } + + override fun createActivityComponent(activity: AppCompatActivity): ActivityComponent { + return component.getActivityComponentBuilderProvider().get().setActivity(activity).build() + } + + override fun getApplicationInjector(): ApplicationInjector = component + } +} diff --git a/app/src/test/java/org/oppia/android/app/activity/route/ActivityRouterTest.kt b/app/src/test/java/org/oppia/android/app/activity/route/ActivityRouterTest.kt new file mode 100644 index 00000000000..c965118576b --- /dev/null +++ b/app/src/test/java/org/oppia/android/app/activity/route/ActivityRouterTest.kt @@ -0,0 +1,243 @@ +package org.oppia.android.app.activity.route + +import android.app.Application +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import androidx.test.core.app.ApplicationProvider +import androidx.test.espresso.intent.Intents +import androidx.test.espresso.intent.Intents.intended +import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent +import androidx.test.ext.junit.rules.ActivityScenarioRule +import androidx.test.ext.junit.runners.AndroidJUnit4 +import com.google.common.truth.Truth.assertThat +import com.google.protobuf.MessageLite +import dagger.BindsInstance +import dagger.Component +import org.hamcrest.CoreMatchers.allOf +import org.hamcrest.Description +import org.hamcrest.Matcher +import org.hamcrest.TypeSafeMatcher +import org.junit.After +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.oppia.android.app.activity.ActivityComponent +import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.ActivityIntentFactoriesModule +import org.oppia.android.app.application.ApplicationComponent +import org.oppia.android.app.application.ApplicationInjector +import org.oppia.android.app.application.ApplicationInjectorProvider +import org.oppia.android.app.application.ApplicationModule +import org.oppia.android.app.application.ApplicationStartupListenerModule +import org.oppia.android.app.application.testing.TestingBuildFlavorModule +import org.oppia.android.app.devoptions.DeveloperOptionsModule +import org.oppia.android.app.devoptions.DeveloperOptionsStarterModule +import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity +import org.oppia.android.app.model.DestinationScreen +import org.oppia.android.app.model.ProfileId +import org.oppia.android.app.model.RecentlyPlayedActivityParams +import org.oppia.android.app.model.RecentlyPlayedActivityTitle +import org.oppia.android.app.player.state.itemviewmodel.SplitScreenInteractionModule +import org.oppia.android.app.shim.ViewBindingShimModule +import org.oppia.android.app.testing.activity.TestActivity +import org.oppia.android.app.translation.testing.ActivityRecreatorTestModule +import org.oppia.android.data.backends.gae.NetworkConfigProdModule +import org.oppia.android.data.backends.gae.NetworkModule +import org.oppia.android.domain.classify.InteractionsModule +import org.oppia.android.domain.classify.rules.algebraicexpressioninput.AlgebraicExpressionInputModule +import org.oppia.android.domain.classify.rules.continueinteraction.ContinueModule +import org.oppia.android.domain.classify.rules.dragAndDropSortInput.DragDropSortInputModule +import org.oppia.android.domain.classify.rules.fractioninput.FractionInputModule +import org.oppia.android.domain.classify.rules.imageClickInput.ImageClickInputModule +import org.oppia.android.domain.classify.rules.itemselectioninput.ItemSelectionInputModule +import org.oppia.android.domain.classify.rules.mathequationinput.MathEquationInputModule +import org.oppia.android.domain.classify.rules.multiplechoiceinput.MultipleChoiceInputModule +import org.oppia.android.domain.classify.rules.numberwithunits.NumberWithUnitsRuleModule +import org.oppia.android.domain.classify.rules.numericexpressioninput.NumericExpressionInputModule +import org.oppia.android.domain.classify.rules.numericinput.NumericInputRuleModule +import org.oppia.android.domain.classify.rules.ratioinput.RatioInputModule +import org.oppia.android.domain.classify.rules.textinput.TextInputRuleModule +import org.oppia.android.domain.exploration.lightweightcheckpointing.ExplorationStorageModule +import org.oppia.android.domain.hintsandsolution.HintsAndSolutionConfigModule +import org.oppia.android.domain.hintsandsolution.HintsAndSolutionProdModule +import org.oppia.android.domain.onboarding.testing.ExpirationMetaDataRetrieverTestModule +import org.oppia.android.domain.oppialogger.LogStorageModule +import org.oppia.android.domain.oppialogger.LoggingIdentifierModule +import org.oppia.android.domain.oppialogger.analytics.ApplicationLifecycleModule +import org.oppia.android.domain.oppialogger.logscheduler.MetricLogSchedulerModule +import org.oppia.android.domain.oppialogger.loguploader.LogReportWorkerModule +import org.oppia.android.domain.platformparameter.PlatformParameterModule +import org.oppia.android.domain.platformparameter.PlatformParameterSingletonModule +import org.oppia.android.domain.question.QuestionModule +import org.oppia.android.domain.topic.PrimeTopicAssetsControllerModule +import org.oppia.android.domain.workmanager.WorkManagerConfigurationModule +import org.oppia.android.testing.TestLogReportingModule +import org.oppia.android.testing.junit.InitializeDefaultLocaleRule +import org.oppia.android.testing.robolectric.RobolectricModule +import org.oppia.android.testing.threading.TestDispatcherModule +import org.oppia.android.testing.time.FakeOppiaClockModule +import org.oppia.android.util.accessibility.AccessibilityTestModule +import org.oppia.android.util.caching.AssetModule +import org.oppia.android.util.caching.testing.CachingTestModule +import org.oppia.android.util.extensions.getProtoExtra +import org.oppia.android.util.gcsresource.GcsResourceModule +import org.oppia.android.util.locale.LocaleProdModule +import org.oppia.android.util.logging.EventLoggingConfigurationModule +import org.oppia.android.util.logging.LoggerModule +import org.oppia.android.util.logging.SyncStatusModule +import org.oppia.android.util.logging.firebase.FirebaseLogUploaderModule +import org.oppia.android.util.networking.NetworkConnectionDebugUtilModule +import org.oppia.android.util.networking.NetworkConnectionUtilDebugModule +import org.oppia.android.util.parser.html.HtmlParserEntityTypeModule +import org.oppia.android.util.parser.image.GlideImageLoaderModule +import org.oppia.android.util.parser.image.ImageParsingModule +import org.robolectric.annotation.Config +import org.robolectric.annotation.LooperMode +import org.robolectric.shadows.ShadowLog +import javax.inject.Singleton + +private const val internalProfileId = 1 + +/** Tests for [ActivityRouter]. */ +// FunctionName: test names are conventionally named with underscores. +@Suppress("FunctionName") +@RunWith(AndroidJUnit4::class) +@LooperMode(LooperMode.Mode.PAUSED) +@Config(application = ActivityRouterTest.TestApplication::class) +class ActivityRouterTest { + @get:Rule + val initializeDefaultLocaleRule = InitializeDefaultLocaleRule() + + @get:Rule + var activityRule = + ActivityScenarioRule( + TestActivity.createIntent(ApplicationProvider.getApplicationContext()) + ) + + @Before + fun setUp() { + Intents.init() + setUpTestApplicationComponent() + } + + @After + fun tearDown() { + Intents.release() + } + + @Test + fun testActivityRouter_canRouteToRecentlyPlayedActivity() { + activityRule.scenario.onActivity { activity -> + val activityRouter = activity.activityRouter + val recentlyPlayedActivityParams = + RecentlyPlayedActivityParams + .newBuilder() + .setProfileId(ProfileId.newBuilder().setInternalId(internalProfileId).build()) + .setActivityTitle(RecentlyPlayedActivityTitle.RECENTLY_PLAYED_STORIES).build() + activityRouter.routeToScreen( + DestinationScreen + .newBuilder() + .setRecentlyPlayedActivityParams(recentlyPlayedActivityParams) + .build() + ) + intended( + allOf( + hasProtoExtra( + RecentlyPlayedActivity.RECENTLY_PLAYED_ACTIVITY_INTENT_EXTRAS_KEY, + recentlyPlayedActivityParams + ), + hasComponent(RecentlyPlayedActivity::class.java.name) + ) + ) + } + } + + @Test + fun testActivityRouter_destinationScreenNotSet_showsError() { + activityRule.scenario.onActivity { activity -> + val activityRouter = activity.activityRouter + activityRouter.routeToScreen(DestinationScreen.getDefaultInstance()) + val log = ShadowLog.getLogs().last() + assertThat(log.tag).isEqualTo("ActivityRouter") + assertThat(log.msg).isEqualTo("Destination screen case is not identified.") + } + } + + private fun hasProtoExtra(keyName: String, expectedProto: T): Matcher { + val defaultProto = expectedProto.newBuilderForType().build() + return object : TypeSafeMatcher() { + override fun describeTo(description: Description) { + description.appendText("Intent with extra: $keyName and proto value: $expectedProto") + } + + override fun matchesSafely(intent: Intent): Boolean { + return intent.hasExtra(keyName) && + intent.getProtoExtra(keyName, defaultProto) == expectedProto + } + } + } + + private fun setUpTestApplicationComponent() { + ApplicationProvider.getApplicationContext().inject(this) + } + + // TODO(#89): Move this to a common test application component. + @Singleton + @Component( + modules = [ + RobolectricModule::class, TestDispatcherModule::class, ApplicationModule::class, + PlatformParameterModule::class, LoggerModule::class, ContinueModule::class, + FractionInputModule::class, ItemSelectionInputModule::class, MultipleChoiceInputModule::class, + NumberWithUnitsRuleModule::class, NumericInputRuleModule::class, TextInputRuleModule::class, + DragDropSortInputModule::class, ImageClickInputModule::class, InteractionsModule::class, + GcsResourceModule::class, GlideImageLoaderModule::class, ImageParsingModule::class, + HtmlParserEntityTypeModule::class, QuestionModule::class, TestLogReportingModule::class, + AccessibilityTestModule::class, LogStorageModule::class, CachingTestModule::class, + PrimeTopicAssetsControllerModule::class, ExpirationMetaDataRetrieverTestModule::class, + ViewBindingShimModule::class, RatioInputModule::class, NetworkConfigProdModule::class, + ApplicationStartupListenerModule::class, HintsAndSolutionConfigModule::class, + LogReportWorkerModule::class, WorkManagerConfigurationModule::class, + FirebaseLogUploaderModule::class, FakeOppiaClockModule::class, + DeveloperOptionsStarterModule::class, DeveloperOptionsModule::class, + ExplorationStorageModule::class, NetworkModule::class, HintsAndSolutionProdModule::class, + NetworkConnectionUtilDebugModule::class, NetworkConnectionDebugUtilModule::class, + AssetModule::class, LocaleProdModule::class, ActivityRecreatorTestModule::class, + ActivityIntentFactoriesModule::class, PlatformParameterSingletonModule::class, + NumericExpressionInputModule::class, AlgebraicExpressionInputModule::class, + MathEquationInputModule::class, SplitScreenInteractionModule::class, + LoggingIdentifierModule::class, ApplicationLifecycleModule::class, + SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, + EventLoggingConfigurationModule::class, ActivityRouterModule::class + ] + ) + interface TestApplicationComponent : ApplicationComponent { + @Component.Builder + interface Builder { + @BindsInstance + fun setApplication(application: Application): Builder + + fun build(): TestApplicationComponent + } + + fun inject(activityRouterTest: ActivityRouterTest) + } + + class TestApplication : Application(), ActivityComponentFactory, ApplicationInjectorProvider { + private val component: TestApplicationComponent by lazy { + DaggerActivityRouterTest_TestApplicationComponent.builder() + .setApplication(this) + .build() + } + + fun inject(activityRouterTest: ActivityRouterTest) { + component.inject(activityRouterTest) + } + + override fun createActivityComponent(activity: AppCompatActivity): ActivityComponent { + return component.getActivityComponentBuilderProvider().get().setActivity(activity).build() + } + + override fun getApplicationInjector(): ApplicationInjector = component + } +} diff --git a/app/src/test/java/org/oppia/android/app/activity/route/BUILD.bazel b/app/src/test/java/org/oppia/android/app/activity/route/BUILD.bazel new file mode 100644 index 00000000000..cb29f885f98 --- /dev/null +++ b/app/src/test/java/org/oppia/android/app/activity/route/BUILD.bazel @@ -0,0 +1,90 @@ +""" +Tests for general activity routing functionality. +""" + +load("@dagger//:workspace_defs.bzl", "dagger_rules") +load("//:oppia_android_test.bzl", "oppia_android_test") + +oppia_android_test( + name = "ActivityRouterTest", + srcs = ["ActivityRouterTest.kt"], + custom_package = "org.oppia.android.app.activity.route", + test_class = "org.oppia.android.app.activity.route.ActivityRouterTest", + test_manifest = "//app:test_manifest", + deps = [ + ":dagger", + "//app", + "//app/src/main/java/org/oppia/android/app/activity:activity_intent_factories_shim", + "//app/src/main/java/org/oppia/android/app/application:application_component", + "//app/src/main/java/org/oppia/android/app/application:application_injector", + "//app/src/main/java/org/oppia/android/app/application:application_injector_provider", + "//app/src/main/java/org/oppia/android/app/application:common_application_modules", + "//app/src/main/java/org/oppia/android/app/application/testing:testing_build_flavor_module", + "//app/src/main/java/org/oppia/android/app/translation/testing:test_module", + "//domain", + "//domain/src/main/java/org/oppia/android/domain/classify:interactions_module", + "//domain/src/main/java/org/oppia/android/domain/onboarding/testing:retriever_test_module", + "//model/src/main/proto:arguments_java_proto_lite", + "//testing", + "//testing/src/main/java/org/oppia/android/testing/junit:initialize_default_locale_rule", + "//testing/src/main/java/org/oppia/android/testing/robolectric:test_module", + "//testing/src/main/java/org/oppia/android/testing/threading:test_module", + "//testing/src/main/java/org/oppia/android/testing/time:test_module", + "//third_party:androidx_test_ext_junit", + "//third_party:androidx_test_ext_truth", + "//third_party:com_google_truth_truth", + "//third_party:junit_junit", + "//third_party:org_robolectric_robolectric", + "//third_party:robolectric_android-all", + "//utility/src/main/java/org/oppia/android/util/accessibility:test_module", + "//utility/src/main/java/org/oppia/android/util/caching/testing:caching_test_module", + "//utility/src/main/java/org/oppia/android/util/data:data_providers", + "//utility/src/main/java/org/oppia/android/util/extensions:bundle_extensions", + "//utility/src/main/java/org/oppia/android/util/logging:prod_module", + "//utility/src/main/java/org/oppia/android/util/logging:standard_event_logging_configuration_module", + "//utility/src/main/java/org/oppia/android/util/logging/firebase:debug_module", + "//utility/src/main/java/org/oppia/android/util/networking:debug_module", + ], +) + +oppia_android_test( + name = "ActivityRouterModuleTest", + srcs = ["ActivityRouterModuleTest.kt"], + custom_package = "org.oppia.android.app.activity.route", + test_class = "org.oppia.android.app.activity.route.ActivityRouterModuleTest", + test_manifest = "//app:test_manifest", + deps = [ + ":dagger", + "//app", + "//app/src/main/java/org/oppia/android/app/activity:activity_intent_factories_shim", + "//app/src/main/java/org/oppia/android/app/application:application_component", + "//app/src/main/java/org/oppia/android/app/application:application_injector", + "//app/src/main/java/org/oppia/android/app/application:application_injector_provider", + "//app/src/main/java/org/oppia/android/app/application:common_application_modules", + "//app/src/main/java/org/oppia/android/app/application/testing:testing_build_flavor_module", + "//app/src/main/java/org/oppia/android/app/translation/testing:test_module", + "//domain", + "//domain/src/main/java/org/oppia/android/domain/classify:interactions_module", + "//domain/src/main/java/org/oppia/android/domain/onboarding/testing:retriever_test_module", + "//testing", + "//testing/src/main/java/org/oppia/android/testing/junit:initialize_default_locale_rule", + "//testing/src/main/java/org/oppia/android/testing/robolectric:test_module", + "//testing/src/main/java/org/oppia/android/testing/threading:test_module", + "//testing/src/main/java/org/oppia/android/testing/time:test_module", + "//third_party:androidx_test_ext_junit", + "//third_party:androidx_test_ext_truth", + "//third_party:com_google_truth_truth", + "//third_party:junit_junit", + "//third_party:org_robolectric_robolectric", + "//third_party:robolectric_android-all", + "//utility/src/main/java/org/oppia/android/util/accessibility:test_module", + "//utility/src/main/java/org/oppia/android/util/caching/testing:caching_test_module", + "//utility/src/main/java/org/oppia/android/util/data:data_providers", + "//utility/src/main/java/org/oppia/android/util/logging:prod_module", + "//utility/src/main/java/org/oppia/android/util/logging:standard_event_logging_configuration_module", + "//utility/src/main/java/org/oppia/android/util/logging/firebase:debug_module", + "//utility/src/main/java/org/oppia/android/util/networking:debug_module", + ], +) + +dagger_rules() diff --git a/app/src/test/java/org/oppia/android/app/home/HomeActivityLocalTest.kt b/app/src/test/java/org/oppia/android/app/home/HomeActivityLocalTest.kt index 43f3eee7e4f..f16e45210b0 100644 --- a/app/src/test/java/org/oppia/android/app/home/HomeActivityLocalTest.kt +++ b/app/src/test/java/org/oppia/android/app/home/HomeActivityLocalTest.kt @@ -16,6 +16,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -156,7 +157,7 @@ class HomeActivityLocalTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/parser/FractionParsingUiErrorTest.kt b/app/src/test/java/org/oppia/android/app/parser/FractionParsingUiErrorTest.kt index 0b9c9059949..840327b63b2 100644 --- a/app/src/test/java/org/oppia/android/app/parser/FractionParsingUiErrorTest.kt +++ b/app/src/test/java/org/oppia/android/app/parser/FractionParsingUiErrorTest.kt @@ -13,6 +13,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -266,7 +267,7 @@ class FractionParsingUiErrorTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/parser/ListItemLeadingMarginSpanTest.kt b/app/src/test/java/org/oppia/android/app/parser/ListItemLeadingMarginSpanTest.kt index 0da8b71bd3b..2010b9aa233 100644 --- a/app/src/test/java/org/oppia/android/app/parser/ListItemLeadingMarginSpanTest.kt +++ b/app/src/test/java/org/oppia/android/app/parser/ListItemLeadingMarginSpanTest.kt @@ -31,6 +31,7 @@ import org.mockito.Mockito.mock import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1108,7 +1109,7 @@ class ListItemLeadingMarginSpanTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) diff --git a/app/src/test/java/org/oppia/android/app/parser/StringToRatioParserTest.kt b/app/src/test/java/org/oppia/android/app/parser/StringToRatioParserTest.kt index 2091191b233..86f8de98dc8 100644 --- a/app/src/test/java/org/oppia/android/app/parser/StringToRatioParserTest.kt +++ b/app/src/test/java/org/oppia/android/app/parser/StringToRatioParserTest.kt @@ -13,6 +13,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -270,7 +271,7 @@ class StringToRatioParserTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/player/exploration/ExplorationActivityLocalTest.kt b/app/src/test/java/org/oppia/android/app/player/exploration/ExplorationActivityLocalTest.kt index e68ca34e73f..86a5a423082 100644 --- a/app/src/test/java/org/oppia/android/app/player/exploration/ExplorationActivityLocalTest.kt +++ b/app/src/test/java/org/oppia/android/app/player/exploration/ExplorationActivityLocalTest.kt @@ -15,6 +15,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -219,7 +220,7 @@ class ExplorationActivityLocalTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/player/state/StateFragmentLocalTest.kt b/app/src/test/java/org/oppia/android/app/player/state/StateFragmentLocalTest.kt index 1213ef83b81..fa723a44081 100644 --- a/app/src/test/java/org/oppia/android/app/player/state/StateFragmentLocalTest.kt +++ b/app/src/test/java/org/oppia/android/app/player/state/StateFragmentLocalTest.kt @@ -53,6 +53,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -2299,7 +2300,7 @@ class StateFragmentLocalTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/profile/ProfileChooserFragmentLocalTest.kt b/app/src/test/java/org/oppia/android/app/profile/ProfileChooserFragmentLocalTest.kt index c8daf026de9..a4b85a75ce3 100644 --- a/app/src/test/java/org/oppia/android/app/profile/ProfileChooserFragmentLocalTest.kt +++ b/app/src/test/java/org/oppia/android/app/profile/ProfileChooserFragmentLocalTest.kt @@ -14,6 +14,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -145,7 +146,7 @@ class ProfileChooserFragmentLocalTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/story/StoryActivityLocalTest.kt b/app/src/test/java/org/oppia/android/app/story/StoryActivityLocalTest.kt index 9f8a4b5e03e..e6240b78e77 100644 --- a/app/src/test/java/org/oppia/android/app/story/StoryActivityLocalTest.kt +++ b/app/src/test/java/org/oppia/android/app/story/StoryActivityLocalTest.kt @@ -16,6 +16,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -170,7 +171,7 @@ class StoryActivityLocalTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/CompletedStoryListSpanTest.kt b/app/src/test/java/org/oppia/android/app/testing/CompletedStoryListSpanTest.kt index d7271431154..2eb63996148 100644 --- a/app/src/test/java/org/oppia/android/app/testing/CompletedStoryListSpanTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/CompletedStoryListSpanTest.kt @@ -17,6 +17,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -179,7 +180,7 @@ class CompletedStoryListSpanTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/HomeSpanTest.kt b/app/src/test/java/org/oppia/android/app/testing/HomeSpanTest.kt index bdaab7cbd11..c88cb0cbc8e 100644 --- a/app/src/test/java/org/oppia/android/app/testing/HomeSpanTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/HomeSpanTest.kt @@ -17,6 +17,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -193,7 +194,7 @@ class HomeSpanTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/OngoingTopicListSpanTest.kt b/app/src/test/java/org/oppia/android/app/testing/OngoingTopicListSpanTest.kt index 013b7eb00d0..7c898df1d96 100644 --- a/app/src/test/java/org/oppia/android/app/testing/OngoingTopicListSpanTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/OngoingTopicListSpanTest.kt @@ -18,6 +18,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -190,7 +191,7 @@ class OngoingTopicListSpanTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/PlatformParameterIntegrationTest.kt b/app/src/test/java/org/oppia/android/app/testing/PlatformParameterIntegrationTest.kt index a02b323e9d1..e846e10a3f7 100644 --- a/app/src/test/java/org/oppia/android/app/testing/PlatformParameterIntegrationTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/PlatformParameterIntegrationTest.kt @@ -28,6 +28,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -363,7 +364,7 @@ class PlatformParameterIntegrationTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/ProfileChooserSpanTest.kt b/app/src/test/java/org/oppia/android/app/testing/ProfileChooserSpanTest.kt index 35d203c98d9..c8e15e825ba 100644 --- a/app/src/test/java/org/oppia/android/app/testing/ProfileChooserSpanTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/ProfileChooserSpanTest.kt @@ -17,6 +17,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -392,7 +393,7 @@ class ProfileChooserSpanTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/ProfileProgressSpanCountTest.kt b/app/src/test/java/org/oppia/android/app/testing/ProfileProgressSpanCountTest.kt index e39871cd3f9..1520034bd75 100644 --- a/app/src/test/java/org/oppia/android/app/testing/ProfileProgressSpanCountTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/ProfileProgressSpanCountTest.kt @@ -17,6 +17,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -176,7 +177,7 @@ class ProfileProgressSpanCountTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/RecentlyPlayedSpanTest.kt b/app/src/test/java/org/oppia/android/app/testing/RecentlyPlayedSpanTest.kt index 0f829eb00bb..08e90feb8d7 100644 --- a/app/src/test/java/org/oppia/android/app/testing/RecentlyPlayedSpanTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/RecentlyPlayedSpanTest.kt @@ -18,6 +18,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -28,6 +29,7 @@ import org.oppia.android.app.devoptions.DeveloperOptionsModule import org.oppia.android.app.devoptions.DeveloperOptionsStarterModule import org.oppia.android.app.home.recentlyplayed.RecentlyPlayedActivity import org.oppia.android.app.model.ProfileId +import org.oppia.android.app.model.RecentlyPlayedActivityParams import org.oppia.android.app.player.state.itemviewmodel.SplitScreenInteractionModule import org.oppia.android.app.recyclerview.RecyclerViewMatcher.Companion.hasGridItemCount import org.oppia.android.app.shim.IntentFactoryShimModule @@ -278,9 +280,14 @@ class RecentlyPlayedSpanTest { } private fun createRecentlyPlayedActivityIntent(profileId: Int): Intent { + val recentlyPlayedActivityParams = + RecentlyPlayedActivityParams + .newBuilder() + .setProfileId(ProfileId.newBuilder().setInternalId(internalProfileId).build()) + .build() return RecentlyPlayedActivity.createRecentlyPlayedActivityIntent( context, - profileId + recentlyPlayedActivityParams ) } @@ -311,7 +318,7 @@ class RecentlyPlayedSpanTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/TopicRevisionSpanTest.kt b/app/src/test/java/org/oppia/android/app/testing/TopicRevisionSpanTest.kt index 3d52410c6b3..6ece8232c80 100644 --- a/app/src/test/java/org/oppia/android/app/testing/TopicRevisionSpanTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/TopicRevisionSpanTest.kt @@ -17,6 +17,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -176,7 +177,7 @@ class TopicRevisionSpanTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/activity/TestActivityTest.kt b/app/src/test/java/org/oppia/android/app/testing/activity/TestActivityTest.kt index 401ae5670f9..e3545555406 100644 --- a/app/src/test/java/org/oppia/android/app/testing/activity/TestActivityTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/activity/TestActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -201,7 +202,7 @@ class TestActivityTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/administratorcontrols/AdministratorControlsFragmentTest.kt b/app/src/test/java/org/oppia/android/app/testing/administratorcontrols/AdministratorControlsFragmentTest.kt index 1ab00f0162b..875948b5972 100644 --- a/app/src/test/java/org/oppia/android/app/testing/administratorcontrols/AdministratorControlsFragmentTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/administratorcontrols/AdministratorControlsFragmentTest.kt @@ -23,6 +23,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.administratorcontrols.AdministratorControlsActivity import org.oppia.android.app.administratorcontrols.appversion.AppVersionFragment import org.oppia.android.app.application.ApplicationComponent @@ -200,7 +201,7 @@ class AdministratorControlsFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/options/OptionsFragmentTest.kt b/app/src/test/java/org/oppia/android/app/testing/options/OptionsFragmentTest.kt index 361d18457cd..dfe70b6302e 100644 --- a/app/src/test/java/org/oppia/android/app/testing/options/OptionsFragmentTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/options/OptionsFragmentTest.kt @@ -22,6 +22,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -254,7 +255,7 @@ class OptionsFragmentTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/player/split/PlayerSplitScreenTest.kt b/app/src/test/java/org/oppia/android/app/testing/player/split/PlayerSplitScreenTest.kt index 1a339014414..6afa85f8b18 100644 --- a/app/src/test/java/org/oppia/android/app/testing/player/split/PlayerSplitScreenTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/player/split/PlayerSplitScreenTest.kt @@ -15,6 +15,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -209,7 +210,7 @@ class PlayerSplitScreenTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/testing/player/state/StateFragmentAccessibilityTest.kt b/app/src/test/java/org/oppia/android/app/testing/player/state/StateFragmentAccessibilityTest.kt index 2638000322d..c078cdd37bf 100644 --- a/app/src/test/java/org/oppia/android/app/testing/player/state/StateFragmentAccessibilityTest.kt +++ b/app/src/test/java/org/oppia/android/app/testing/player/state/StateFragmentAccessibilityTest.kt @@ -19,6 +19,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -216,7 +217,7 @@ class StateFragmentAccessibilityTest { SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/topic/info/TopicInfoFragmentLocalTest.kt b/app/src/test/java/org/oppia/android/app/topic/info/TopicInfoFragmentLocalTest.kt index f148e68a7d0..595e72420a5 100644 --- a/app/src/test/java/org/oppia/android/app/topic/info/TopicInfoFragmentLocalTest.kt +++ b/app/src/test/java/org/oppia/android/app/topic/info/TopicInfoFragmentLocalTest.kt @@ -13,6 +13,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -159,7 +160,7 @@ class TopicInfoFragmentLocalTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentLocalTest.kt b/app/src/test/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentLocalTest.kt index 7d8995a8757..6148973bf37 100644 --- a/app/src/test/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentLocalTest.kt +++ b/app/src/test/java/org/oppia/android/app/topic/lessons/TopicLessonsFragmentLocalTest.kt @@ -13,6 +13,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -161,7 +162,7 @@ class TopicLessonsFragmentLocalTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerActivityLocalTest.kt b/app/src/test/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerActivityLocalTest.kt index 51156df21be..fe6978aa3da 100644 --- a/app/src/test/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerActivityLocalTest.kt +++ b/app/src/test/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerActivityLocalTest.kt @@ -30,6 +30,7 @@ import org.junit.runner.RunWith import org.oppia.android.R import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -509,7 +510,7 @@ class QuestionPlayerActivityLocalTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivityLocalTest.kt b/app/src/test/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivityLocalTest.kt index b2456d3675d..d0ec6228a14 100644 --- a/app/src/test/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivityLocalTest.kt +++ b/app/src/test/java/org/oppia/android/app/topic/revisioncard/RevisionCardActivityLocalTest.kt @@ -13,6 +13,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -152,7 +153,7 @@ class RevisionCardActivityLocalTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/translation/AppLanguageResourceHandlerTest.kt b/app/src/test/java/org/oppia/android/app/translation/AppLanguageResourceHandlerTest.kt index 13fedb07923..3bedbfe268a 100644 --- a/app/src/test/java/org/oppia/android/app/translation/AppLanguageResourceHandlerTest.kt +++ b/app/src/test/java/org/oppia/android/app/translation/AppLanguageResourceHandlerTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory import org.oppia.android.app.activity.ActivityIntentFactoriesModule +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -585,7 +586,7 @@ class AppLanguageResourceHandlerTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/translation/AppLanguageWatcherMixinTest.kt b/app/src/test/java/org/oppia/android/app/translation/AppLanguageWatcherMixinTest.kt index 9f41057787a..651f35655b0 100644 --- a/app/src/test/java/org/oppia/android/app/translation/AppLanguageWatcherMixinTest.kt +++ b/app/src/test/java/org/oppia/android/app/translation/AppLanguageWatcherMixinTest.kt @@ -18,6 +18,7 @@ import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory import org.oppia.android.app.activity.ActivityIntentFactoriesModule +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -274,7 +275,7 @@ class AppLanguageWatcherMixinTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/utility/datetime/DateTimeUtilTest.kt b/app/src/test/java/org/oppia/android/app/utility/datetime/DateTimeUtilTest.kt index 1298a660964..83b3c576bb9 100644 --- a/app/src/test/java/org/oppia/android/app/utility/datetime/DateTimeUtilTest.kt +++ b/app/src/test/java/org/oppia/android/app/utility/datetime/DateTimeUtilTest.kt @@ -17,6 +17,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -187,7 +188,7 @@ class DateTimeUtilTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/app/src/test/java/org/oppia/android/app/utility/math/MathExpressionAccessibilityUtilTest.kt b/app/src/test/java/org/oppia/android/app/utility/math/MathExpressionAccessibilityUtilTest.kt index 3a5c50ce728..139f75cb62d 100644 --- a/app/src/test/java/org/oppia/android/app/utility/math/MathExpressionAccessibilityUtilTest.kt +++ b/app/src/test/java/org/oppia/android/app/utility/math/MathExpressionAccessibilityUtilTest.kt @@ -16,6 +16,7 @@ import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory import org.oppia.android.app.activity.ActivityIntentFactoriesModule +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -1333,7 +1334,7 @@ class MathExpressionAccessibilityUtilTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/instrumentation/src/java/org/oppia/android/instrumentation/application/TestApplicationComponent.kt b/instrumentation/src/java/org/oppia/android/instrumentation/application/TestApplicationComponent.kt index 8967a958c56..44571c46d54 100644 --- a/instrumentation/src/java/org/oppia/android/instrumentation/application/TestApplicationComponent.kt +++ b/instrumentation/src/java/org/oppia/android/instrumentation/application/TestApplicationComponent.kt @@ -1,6 +1,7 @@ package org.oppia.android.instrumentation.application import dagger.Component +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationModule import org.oppia.android.app.application.ApplicationStartupListenerModule @@ -98,7 +99,8 @@ import javax.inject.Singleton SyncStatusModule::class, NetworkConnectionDebugUtilModule::class, MetricLogSchedulerModule::class, ActivityLifecycleObserverModule::class, PerformanceMetricsAssessorModule::class, PerformanceMetricsConfigurationsModule::class, - TestingBuildFlavorModule::class, EventLoggingConfigurationModule::class + TestingBuildFlavorModule::class, EventLoggingConfigurationModule::class, + ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/model/src/main/proto/arguments.proto b/model/src/main/proto/arguments.proto index c7526995c81..b719dc649dc 100644 --- a/model/src/main/proto/arguments.proto +++ b/model/src/main/proto/arguments.proto @@ -66,6 +66,42 @@ message InputInteractionViewTestActivityParams { } } +// Corresponds to intent extras of destination activity. +message DestinationScreen { + // Indicates destination screen which we send in intent extras with RecentlyPlayedActivityParams. + oneof destination_screen { + // Indicates information about the RecentlyPlayedActivity. + RecentlyPlayedActivityParams recently_played_activity_params = 1; + } +} + +// Intent extras for RecentlyPlayedActivity. +message RecentlyPlayedActivityParams { + // The ID of current profile. + ProfileId profile_id = 1; + + // The title which should be displayed for the activity. + RecentlyPlayedActivityTitle activity_title = 2; +} + +// Corresponds to activity title of RecentlyPlayedActivity. +enum RecentlyPlayedActivityTitle { + // Activity title is not specified. + TITLE_UNSPECIFIED = 0; + + // Corresponds to activity title as "Recently played stories". + RECENTLY_PLAYED_STORIES = 1; + + // Corresponds to activity title as "Stories for you". + STORIES_FOR_YOU = 2; + + // Corresponds to activity title as "Recommended Stories". + RECOMMENDED_STORIES = 3; + + // Corresponds to activity title as "Last-Played Stories". + LAST_PLAYED_STORIES = 4; +} + // Params required when creating a new ExplorationActivity. message ExplorationActivityParams { // The ID of the profile that wants to start an exploration play session. diff --git a/scripts/assets/test_file_exemptions.textproto b/scripts/assets/test_file_exemptions.textproto index 640526ad661..fa6d09b9ce1 100644 --- a/scripts/assets/test_file_exemptions.textproto +++ b/scripts/assets/test_file_exemptions.textproto @@ -5,6 +5,8 @@ exempted_file_path: "app/src/main/java/org/oppia/android/app/activity/ActivityIn exempted_file_path: "app/src/main/java/org/oppia/android/app/activity/ActivityModule.kt" exempted_file_path: "app/src/main/java/org/oppia/android/app/activity/ActivityScope.kt" exempted_file_path: "app/src/main/java/org/oppia/android/app/activity/InjectableAppCompatActivity.kt" +exempted_file_path: "app/src/main/java/org/oppia/android/app/activity/route/Route.kt" +exempted_file_path: "app/src/main/java/org/oppia/android/app/activity/route/RouteKey.kt" exempted_file_path: "app/src/main/java/org/oppia/android/app/administratorcontrols/AdministratorControlsActivityPresenter.kt" exempted_file_path: "app/src/main/java/org/oppia/android/app/administratorcontrols/AdministratorControlsFragmentPresenter.kt" exempted_file_path: "app/src/main/java/org/oppia/android/app/testing/AdministratorControlsFragmentTestActivity.kt" diff --git a/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleCustomContextTest.kt b/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleCustomContextTest.kt index 3268132586b..5080fcae353 100644 --- a/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleCustomContextTest.kt +++ b/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleCustomContextTest.kt @@ -13,6 +13,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -267,7 +268,7 @@ class InitializeDefaultLocaleRuleCustomContextTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleOmissionTest.kt b/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleOmissionTest.kt index a231a557703..a0870ac98ba 100644 --- a/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleOmissionTest.kt +++ b/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleOmissionTest.kt @@ -12,6 +12,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -143,7 +144,7 @@ class InitializeDefaultLocaleRuleOmissionTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent { diff --git a/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleTest.kt b/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleTest.kt index 23f74d78424..6b689b3766c 100644 --- a/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleTest.kt +++ b/testing/src/test/java/org/oppia/android/testing/junit/InitializeDefaultLocaleRuleTest.kt @@ -13,6 +13,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.oppia.android.app.activity.ActivityComponent import org.oppia.android.app.activity.ActivityComponentFactory +import org.oppia.android.app.activity.route.ActivityRouterModule import org.oppia.android.app.application.ApplicationComponent import org.oppia.android.app.application.ApplicationInjector import org.oppia.android.app.application.ApplicationInjectorProvider @@ -147,7 +148,7 @@ class InitializeDefaultLocaleRuleTest { MathEquationInputModule::class, SplitScreenInteractionModule::class, LoggingIdentifierModule::class, ApplicationLifecycleModule::class, SyncStatusModule::class, MetricLogSchedulerModule::class, TestingBuildFlavorModule::class, - EventLoggingConfigurationModule::class + EventLoggingConfigurationModule::class, ActivityRouterModule::class ] ) interface TestApplicationComponent : ApplicationComponent {