Skip to content

Lift Koin out of ConferenceMaterialTheme#1695

Merged
yschimke merged 1 commit into
mainfrom
agent/lift-koin-out-of-conference-theme
May 28, 2026
Merged

Lift Koin out of ConferenceMaterialTheme#1695
yschimke merged 1 commit into
mainfrom
agent/lift-koin-out-of-conference-theme

Conversation

@yschimke
Copy link
Copy Markdown
Collaborator

Summary

  • Refactor ConferenceMaterialTheme to take useDynamicColor and darkThemeConfig as plain parameters with sensible defaults; remove the in-theme koinInject and LocalInspectionMode branch.
  • Add a thin ConferenceMaterialThemeFromSettings wrapper that performs the Koin lookup (with a LocalInspectionMode fallback) and forwards plain values into the pure theme function.
  • Switch production call sites (ConferenceView, ConferenceCard, iOS SessionDetailsViewController) to the wrapper so behaviour is preserved.

Motivation: ConferenceMaterialTheme was reaching into Koin via currentKoinScope(), which made it unrenderable in any context that hadn't run the consumer Application's onCreate (notably the wearApp's ThemePreview, where ConferenceCard transitively pulled in the shared theme). With the DI lookup moved into the wrapper, the theme function itself is self-contained and preview-safe.

Test plan

  • ./gradlew :shared:compileDebugKotlinAndroid — clean build (only pre-existing deprecation warnings).
  • Run the Android app and switch between dark/light/system themes in settings; confirm ConferenceView and per-card theming behave as before.
  • Verify iOS SessionDetailsViewController still themes correctly.
  • Render wearApp ThemePreview (Compose preview / screenshot test) — should no longer require a started Koin container.

Make ConferenceMaterialTheme a pure Composable that takes
useDynamicColor and darkThemeConfig as parameters. The settings
lookup moves into a new ConferenceMaterialThemeFromSettings wrapper,
so the theme function itself no longer requires a Koin container
and can render under previews/tests without one.

Production call sites (ConferenceView, ConferenceCard, iOS
SessionDetailsViewController) switch to the wrapper to preserve
existing behaviour.
@yschimke yschimke merged commit 9a638f0 into main May 28, 2026
5 checks passed
@yschimke yschimke deleted the agent/lift-koin-out-of-conference-theme branch May 28, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant