android / nowinandroid

A fully functional Android app built entirely with Kotlin and Jetpack Compose
Apache License 2.0
15.92k stars 2.81k forks source link

[FR]: Suggest changing the UI layer injection method of Analytics Instance in Analytics Module. #1471

Open rhkrwngud445 opened 1 month ago

rhkrwngud445 commented 1 month ago

Is there an existing issue for this?

Describe the problem

Suggest changing the UI layer injection method of Analytics Instance in Analytics Module.

Instead of using CompositionLocal, how about using Hilt's EntryPoint?

It has these advantages.

  1. It has the advantage of reducing MainActivity injection code.
  2. Management outside HiltScope can be reduced.
  3. Analytics can eliminate compose dependency.

Additionally, in analytics/AnalyticsModule, how about creating an instance as a singleton?

Describe the solution

Change Injection of CompositionLocal to Hilt's EntryPoint

Additional context

No response

Code of Conduct

Pandabar007 commented 1 month ago

Get newer