From 048a6f18322709c85c99e15985a03f2d55a2deab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Paczos?= Date: Fri, 17 Jan 2025 14:48:33 +0100 Subject: [PATCH] Additional "default browser" prompts: variant 3 --- ...DefaultBrowserPromptsExperimentVariants.kt | 29 +++++++++++++++++++ .../DefaultBrowserPromptsFeatureToggles.kt | 1 + 2 files changed, 30 insertions(+) diff --git a/app/src/main/java/com/duckduckgo/app/browser/defaultbrowsing/prompts/DefaultBrowserPromptsExperimentVariants.kt b/app/src/main/java/com/duckduckgo/app/browser/defaultbrowsing/prompts/DefaultBrowserPromptsExperimentVariants.kt index 4dd46d049dc2..fc848b5268ba 100644 --- a/app/src/main/java/com/duckduckgo/app/browser/defaultbrowsing/prompts/DefaultBrowserPromptsExperimentVariants.kt +++ b/app/src/main/java/com/duckduckgo/app/browser/defaultbrowsing/prompts/DefaultBrowserPromptsExperimentVariants.kt @@ -76,4 +76,33 @@ interface DefaultBrowserPromptsExperimentStageEvaluator { CONVERTED -> DefaultBrowserPromptsExperimentStageAction.disableAll } } + + @ContributesMultibinding(scope = AppScope::class) + class Variant3 @Inject constructor() : DefaultBrowserPromptsExperimentStageEvaluator { + + override val targetCohort = AdditionalPromptsCohortName.VARIANT_3 + + override suspend fun evaluate(newStage: ExperimentStage): DefaultBrowserPromptsExperimentStageAction = + when (newStage) { + NOT_ENROLLED -> DefaultBrowserPromptsExperimentStageAction.disableAll + + ENROLLED -> DefaultBrowserPromptsExperimentStageAction.disableAll + + STAGE_1 -> DefaultBrowserPromptsExperimentStageAction( + showMessageDialog = true, + showOverflowMenuItem = true, + highlightOverflowMenu = true, + ) + + STAGE_2 -> DefaultBrowserPromptsExperimentStageAction( + showMessageDialog = true, + showOverflowMenuItem = true, + highlightOverflowMenu = true, + ) + + STOPPED -> DefaultBrowserPromptsExperimentStageAction.disableAll + + CONVERTED -> DefaultBrowserPromptsExperimentStageAction.disableAll + } + } } diff --git a/app/src/main/java/com/duckduckgo/app/browser/defaultbrowsing/prompts/DefaultBrowserPromptsFeatureToggles.kt b/app/src/main/java/com/duckduckgo/app/browser/defaultbrowsing/prompts/DefaultBrowserPromptsFeatureToggles.kt index a02f0b3d6dd0..0297a94e38e2 100644 --- a/app/src/main/java/com/duckduckgo/app/browser/defaultbrowsing/prompts/DefaultBrowserPromptsFeatureToggles.kt +++ b/app/src/main/java/com/duckduckgo/app/browser/defaultbrowsing/prompts/DefaultBrowserPromptsFeatureToggles.kt @@ -35,5 +35,6 @@ interface DefaultBrowserPromptsFeatureToggles { enum class AdditionalPromptsCohortName(override val cohortName: String) : CohortName { VARIANT_2("variant_2"), + VARIANT_3("variant_3"), } }