paug / AndroidMakersApp

📱Official companion app for Android Makers by droidcon 🇫🇷
https://androidmakers.droidcon.com/
117 stars 27 forks source link

Use PlatformContext to pass Android Activity Context to use cases #310

Closed cbeyls closed 1 month ago

cbeyls commented 1 month ago

Since many use cases should use an Activity Context rather than the Application Context on Android to work properly (mostly to launch Intents), refactor these use cases to take a PlatformContext argument and use it to wrap the Android Context on Android.

martinbonnin commented 1 month ago

Replace LocalPlatformContext CompositionLocal with an expect getPlatformContext() composable function.

Much better 👍 . Also another use case for expect/actual classes.