Skip to content

Replace MLKit with Optimaize for FOSS flavor and add fallback#139

Merged
menny merged 4 commits intomainfrom
support-foss-mlkit-replacement-15535654450169405782
Mar 4, 2026
Merged

Replace MLKit with Optimaize for FOSS flavor and add fallback#139
menny merged 4 commits intomainfrom
support-foss-mlkit-replacement-15535654450169405782

Conversation

@menny
Copy link
Copy Markdown
Member

@menny menny commented Feb 8, 2026

Replaced MLKit dependency with Optimaize Language Detector for a FOSS-compliant build flavor. The google flavor continues to use MLKit but now falls back to Optimaize if detection fails. This involved creating flavor-specific source sets, refactoring dependency injection, and handling dependency conflicts.

fixes: #129


PR created automatically by Jules for task 15535654450169405782 started by @menny

@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 3 commits March 3, 2026 21:32
- Add `google` and `foss` build flavors.
- Use `optimaize-language-detector` for the `foss` flavor.
- Use `google-mlkit-genai-prompt` for the `google` flavor, with a fallback to `Optimaize` if MLKit fails.
- Refactor `LanguageDetector` dependency injection into flavor-specific modules.
- Ensure `TranslateViewModel` works with the injected `LanguageDetector`.
- Resolve duplicate class issues by excluding conflicting dependencies from `optimaize`.
- Fix duplicate binding in `MainActivityTest`.

Co-authored-by: menny <481272+menny@users.noreply.github.com>
Replace fully qualified package names with proper imports to follow
project code style guidelines.

- OptimaizeLanguageDetector: Use import alias to avoid name collision
  with the app's LanguageDetector interface
- TranslateViewModel: Add imports for DetectionResult and LanguageDetector

AI Agent: Claude
@menny menny force-pushed the support-foss-mlkit-replacement-15535654450169405782 branch from 69cd796 to a52ff8b Compare March 4, 2026 03:22
@menny menny mentioned this pull request Mar 4, 2026
@menny menny merged commit c897687 into main Mar 4, 2026
1 check passed
@menny menny deleted the support-foss-mlkit-replacement-15535654450169405782 branch March 4, 2026 17:17
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.

F-Droid build failed

1 participant