Skip to content

Instantly share code, notes, and snippets.

@zerobranch
Created September 5, 2020 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerobranch/debda645f2e31c1ea3b5b3411a407c48 to your computer and use it in GitHub Desktop.
Save zerobranch/debda645f2e31c1ea3b5b3411a407c48 to your computer and use it in GitHub Desktop.
AppLauncher
class AppLauncher @Inject constructor(
private val launchUseCase: LaunchUseCase,
private val router: Router
) {
fun launch() {
val rootScreen =
if (launchUseCase.hasAccount) Screens.Home
else Screens.Auth
if (launchUseCase.isFirstLaunch) {
router.newRootChain(rootScreen, Screens.PrivacyPolicy)
} else {
router.newRootScreen(rootScreen)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment