diff --git a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt index dbdab4e7e450..b88de6a32bf8 100644 --- a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt +++ b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt @@ -25,7 +25,6 @@ import androidx.core.view.isVisible import androidx.lifecycle.Lifecycle import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope -import com.duckduckgo.anvil.annotations.ContributeToActivityStarter import com.duckduckgo.anvil.annotations.InjectWith import com.duckduckgo.app.about.AboutScreenNoParams import com.duckduckgo.app.accessibility.AccessibilityScreens @@ -49,7 +48,6 @@ import com.duckduckgo.appbuildconfig.api.AppBuildConfig import com.duckduckgo.autoconsent.impl.ui.AutoconsentSettingsActivity import com.duckduckgo.autofill.api.AutofillScreens.AutofillSettingsScreen import com.duckduckgo.autofill.api.AutofillSettingsLaunchSource -import com.duckduckgo.browser.api.ui.BrowserScreens.NewSettingsScreenNoParams import com.duckduckgo.common.ui.DuckDuckGoActivity import com.duckduckgo.common.ui.view.gone import com.duckduckgo.common.ui.view.listitem.CheckListItem @@ -74,7 +72,6 @@ import kotlinx.coroutines.flow.onEach import timber.log.Timber @InjectWith(ActivityScope::class) -@ContributeToActivityStarter(NewSettingsScreenNoParams::class, screenName = "newSettings") class NewSettingsActivity : DuckDuckGoActivity() { private val viewModel: NewSettingsViewModel by bindViewModel() diff --git a/app/src/main/java/com/duckduckgo/app/settings/SettingsActivity.kt b/app/src/main/java/com/duckduckgo/app/settings/SettingsActivity.kt index 6e61b03c914f..2414b4520263 100644 --- a/app/src/main/java/com/duckduckgo/app/settings/SettingsActivity.kt +++ b/app/src/main/java/com/duckduckgo/app/settings/SettingsActivity.kt @@ -22,15 +22,29 @@ import android.os.Bundle import com.duckduckgo.anvil.annotations.ContributeToActivityStarter import com.duckduckgo.anvil.annotations.InjectWith import com.duckduckgo.browser.api.ui.BrowserScreens.SettingsScreenNoParams +import com.duckduckgo.common.ui.DuckDuckGoActivity import com.duckduckgo.di.scopes.ActivityScope +import com.duckduckgo.settings.api.NewSettingsFeature +import javax.inject.Inject @InjectWith(ActivityScope::class) @ContributeToActivityStarter(SettingsScreenNoParams::class, screenName = "settings") class SettingsActivity : DuckDuckGoActivity() { + @Inject + lateinit var newSettingsFeature: NewSettingsFeature + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + if (newSettingsFeature.self().isEnabled()) { + startActivity(NewSettingsActivity.intent(this)) + } else { + startActivity(LegacySettingsActivity.intent(this)) + } + finish() + } + companion object { const val LAUNCH_FROM_NOTIFICATION_PIXEL_NAME = "LAUNCH_FROM_NOTIFICATION_PIXEL_NAME"