android / android/nowinandroid

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

Open
#1,471 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Kotlin
Stars
21.8k
Forks
4.6k
Avg merge
19h 20m
Merged PRs (30d)
2

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### 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

- [X] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start by reading analytics/AnalyticsModule and the current CompositionLocal injection path, then inspect MainActivity to understand the existing injection code. Compare that flow with the proposed Hilt EntryPoint approach and determine whether Analytics can remove its Compose dependency and become a singleton. Done means the injection design is agreed and the affected analytics and UI integration paths are updated consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.