Package-level declarations

The onboarding package contains the main onboarding screens, guiding users through the initial setup and introduction to the app. The Screen can be used anywhere after providing the OnboardingData via an implementation of the OnboardingRepository interface.

Example implementation:

class EngageOnboardingRepository @Inject constructor(
private val navigator: Navigator,
) : OnboardingRepository {

override suspend fun getOnboardingData(): Result<OnboardingData> = Result.success(
OnboardingData(
areas = listOf(
Area(
title = "Join the Study",
iconId = R.drawable.ic_groups,
description = "Connect to your study via an invitation code from the researchers."
),
Area(
title = "Complete Health Checks",
iconId = R.drawable.ic_assignment,
description = "Record and report health data automatically according to a schedule set by the research team."
),
Area(
title = "Visualize Data",
iconId = R.drawable.ic_vital_signs,
description = "Visualize your heart health progress throughout participation in the study."
)
),
title = "Welcome to ENGAGE-HF",
subTitle = "Remote study participation made easy.",
continueButtonText = "Learn more",
continueButtonAction = { navigator.navigateTo(OnboardingNavigationEvent.SequentialOnboardingScreen) }
)
)
}

Types

Link copied to clipboard
data class Area(val title: String, val iconId: Int, val description: String)

Represents an area of the onboarding screen.

Link copied to clipboard
sealed interface OnboardingAction

A sealed class representing the actions that can be performed on the onboarding screen.

Link copied to clipboard
data class OnboardingData(val areas: List<Area> = emptyList(), val title: String = "Title", val subTitle: String = "SubTitle", val continueButtonText: String = "Learn more", val continueButtonAction: () -> Unit = {})
Link copied to clipboard

Repository for fetching onboarding data.

Link copied to clipboard
data class OnboardingUiState(val areas: List<Area> = emptyList(), val title: String = "Title", val subtitle: String = "Subtitle", val continueButtonText: String = "Continue", val continueAction: () -> Unit = {}, val error: String? = null)

The UI state for the onboarding screen.

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard

The onboarding screen.