Android
Library that implements onboarding flow - a consequent flow of screens launched before going to the main screen (usually once - after signing in).
Getting Started
- Example
- Installing
- Readme
- Changelog
- Define onboarding steps
class GetStartedOnboardingStep : OnboardingStep {
private fun shouldBeShown(params: OnboardingStepParams): Boolean {
return params.preferencesManager.isGetStartedCompleted.not()
}
override suspend fun getActivityIntent(
context: Context,
params: OnboardingStepParams,
): Intent? {
if (!shouldBeShown(params)) {
return null
}
return GetStartedActivity.getLauncherIntent(context)
}
override fun getAnalyticsName() = "Get started"
}
- Initialize HumaOnboardingManager:
HumaOnboardingManager.init(
// list of onboarding steps
onboardingSteps = listOf(GetStartedOnboardingStep()),
// if true - onboarding will consist of [onboardingSteps], if false - onboarding will consist of default steps (described in readme) + [onboardingSteps]
overrideDefault = true
)
- Start OnboardingActivity:
startActivity(OnboardingActivity.getIntent(context))
- Add the dependency in your local build.gradle file:
implementation("com.huma.sdk:onboarding:<latest-version>")
- Initialize
HumaOnboardingManager
in your Application class:
HumaOnboardingManager.init(/*..*/)
Basics
Onboarding flow - a consequent flow of screens launched before going to the main screen (usually once - after signing in).
OnboardingStep - interface that onboarding flow step is required to implement.
OnboardingStepParams - data class that contains useful instances that may be required for a step.
Customization
A list of steps is provided during initialization (note that order is important, conditions are checked sequentially):
HumaOnboardingManager.init(onboardingSteps = listOf(FirstStep(), SecondStep()))
overrideDefault
- if true - onboarding will consist of [onboardingSteps], if false - onboarding will consist of default steps + [onboardingSteps]
HumaOnboardingManager.init(onboardingSteps = listOf(), overrideDefault = false)
Default steps
- OnboardingQuestionnaireOnboardingStep - baseline questionnaire - opens questionnaires that are marked as
isOnboarding=true
- ProfileQuestionnaireOnboadingStep - questionnaire used to fill user profile data
- PreferredUnitsOnboardingStep - preferred units setup
Documentation
Dependencies
[0.2.1]
- #142 Profile questionnaire unit tests; onboarding module improvements
- #141 Added E-Consent Onboarding module
- #137 Onboarding profile questionnaire; fixes, onboarding/questionnaire improvements
- #136 Added onboarding Consent module
- #134 Added Onboarding Questionnaire
- #129 Added Identity Verification
- #127 Huma Onboarding core, onboarding preferred units setup