Skip to content

Conversation

abolfazlimahdi
Copy link
Contributor

This is a request by Atruvia. We were using a Koin API, which required us to use @OptIn(KoinInternalApi::class)
which is not recommended to do, especially when developing an SDK. I resolved the issue by using a Factory method to provide the ViewModel for dependency injection.

Ticket: https://ginis.atlassian.net/browse/PP-1725

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the AndroidFragmentExt.kt file to remove dependency on Koin's internal APIs, specifically eliminating the use of @OptIn(KoinInternalApi::class) and resolveViewModel function. The change improves SDK compliance by avoiding deprecated internal APIs as requested by Atruvia.

  • Replaced Koin's internal resolveViewModel with a custom ViewModelProvider.Factory implementation
  • Removed @OptIn(KoinInternalApi::class) annotation and related internal API imports
  • Simplified function signatures by removing the extrasProducer parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

sonarqubecloud bot commented Oct 6, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@abolfazlimahdi abolfazlimahdi force-pushed the PP-1725-remove-resolveViewModel-function branch from 0bc56f7 to adc5912 Compare October 6, 2025 14:41
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