Skip to content

Instantly share code, notes, and snippets.

@saqib-github-commits
Created January 18, 2024 20:18
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 saqib-github-commits/c7db97b57ca6500f98b1bab26ca4bcda to your computer and use it in GitHub Desktop.
Save saqib-github-commits/c7db97b57ca6500f98b1bab26ca4bcda to your computer and use it in GitHub Desktop.
// analyticsLogger created inside MainActivity using hilt,
// It will take actual implementation binded inside Hilt Module
@Inject
protected lateinit var analyticsLogger: AnalyticsLogger
// Assigning value inside setContent lambda of MainActivity
CompositionLocalProvider(LocalAnalyticsLogger provides analyticsLogger) {
CompositionLocalSampleTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
WelcomeScreen()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment