2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

Bug 1822109 - Refactor OnboardingState into its own file

This commit is contained in:
Gabriel Luong 2023-03-13 13:12:42 -04:00 committed by mergify[bot]
parent afe774111e
commit 5103a82d9b
4 changed files with 23 additions and 12 deletions

View File

@ -13,6 +13,7 @@ import org.mozilla.fenix.browser.browsingmode.BrowsingMode
import org.mozilla.fenix.browser.browsingmode.BrowsingModeManager
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.onboarding.FenixOnboarding
import org.mozilla.fenix.onboarding.OnboardingState
import org.mozilla.fenix.nimbus.Onboarding as OnboardingConfig
/**
@ -31,17 +32,6 @@ sealed class Mode {
}
}
/**
* Describes various onboarding states.
*/
sealed class OnboardingState {
// Signed out, without an option to auto-login using a shared FxA account.
object SignedOutNoAutoSignIn : OnboardingState()
// Signed in.
object SignedIn : OnboardingState()
}
class CurrentMode(
private val context: Context,
private val onboarding: FenixOnboarding,

View File

@ -20,12 +20,12 @@ import org.mozilla.fenix.ext.shouldShowRecentSyncedTabs
import org.mozilla.fenix.ext.shouldShowRecentTabs
import org.mozilla.fenix.gleanplumb.Message
import org.mozilla.fenix.home.Mode
import org.mozilla.fenix.home.OnboardingState
import org.mozilla.fenix.home.recentbookmarks.RecentBookmark
import org.mozilla.fenix.home.recentvisits.RecentlyVisitedItem
import org.mozilla.fenix.nimbus.MessageSurfaceId
import org.mozilla.fenix.nimbus.OnboardingPanel
import org.mozilla.fenix.onboarding.HomeCFRPresenter
import org.mozilla.fenix.onboarding.OnboardingState
import org.mozilla.fenix.utils.Settings
import org.mozilla.fenix.nimbus.Onboarding as OnboardingConfig

View File

@ -0,0 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.onboarding
/**
* Describes various onboarding states.
*/
sealed class OnboardingState {
/**
* Signed out, without an option to auto-login using a shared FxA account.
*/
object SignedOutNoAutoSignIn : OnboardingState()
/**
* Signed in.
*/
object SignedIn : OnboardingState()
}

View File

@ -17,6 +17,7 @@ import org.mozilla.fenix.browser.browsingmode.BrowsingMode
import org.mozilla.fenix.browser.browsingmode.BrowsingModeManager
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.onboarding.FenixOnboarding
import org.mozilla.fenix.onboarding.OnboardingState
class ModeTest {