Summary
All ViewModel classes across the project are currently declared as public, even though they are only used within their respective feature modules. This can lead to unintended usages across modules and violates encapsulation principles.
Proposal
Change the visibility modifier of each ViewModel from public to internal if it is not used outside the module it belongs to.
This adjustment:
- Prevents accidental access from other modules
- Reinforces module boundaries
- Keeps internal logic private to its domain
- Makes the codebase more maintainable and intention-revealing
Example
// Current (public by default)
@HiltViewModel
class BookmarksViewModel @Inject constructor(...) : ViewModel() {
...
}
// Suggested
@HiltViewModel
internal class BookmarksViewModel @Inject constructor(...) : ViewModel() {
...
}