Instant Selection, Smart OCR and UI/UX polish#62
Open
Art-ovv wants to merge 13 commits into
Open
Conversation
added 13 commits
June 12, 2026 23:08
Include dependencies for Text Recognition, Translation, and Language Identification. Added kotlinx-coroutines-play-services for Task API support.
Implement automated screen translation pipeline using ML Kit Translation and Language ID. Added intelligent background color sampling and WCAG-compliant text contrast calculation.
Create a dedicated dialog for selecting target translation languages, supporting all ML Kit languages with a searchable interface.
Add logic to automatically detect and highlight interactive entities on the screen using OCR data and regex patterns.
Enable automatic text recognition when the overlay opens. Added Tesseract caching for 5-10x performance boost and simplified the scanning UI.
Switch to dual-language 'rus+eng' mode by default. Added a character un-mixer and refined vertical/horizontal clustering to prevent word fragmentation.
Ensure all inline documentation is in English. Cleaned up redundant code in AccessibilityService and updated UI preferences.
Improved Cyrillic character disambiguation with a custom un-mixer. Refined line clustering with multi-column detection and added intelligent case correction for OCR errors.
Updated WCAG contrast formula to correctly alternate between light and dark text based on background luminance. Added background sampling padding to avoid font-edge color bleeding.
Implemented allocation-free drawing logic with Canvas scaling and Path caching in CopyTextOverlayManager. Refined bitmap lifecycle management in OverlayActivity.
Panels now automatically slide out of the way during drawing or resizing and return upon release. Added background tap gesture to manually toggle top and bottom bar visibility.
Optimized Tesseract scanning by implementing smart binarization, automatic inversion for dark mode, and high-contrast preprocessing. Added TessBaseAPI instance caching and removed redundant tiling for a 5-10x speed boost. All remaining Russian code comments have been translated to English.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces a major architectural overhaul of the text selection and translation pipelines. The primary goals are to bring the text selection experience closer to Google Lens (Instant Selection), significantly improve OCR accuracy for mixed Cyrillic/Latin text, fix rendering bugs in the translation module, and eliminate UI stuttering.
Key Features and Improvements
Instant Text Selection
OCR Accuracy & Smart Pre-processing
Performance & Memory
onDrawinto a state-update method, preventing garbage collection churn and ensuring smooth UI..recycle()calls tied to Compose states to fix random crashes related to recycled bitmaps.Translation Quality
UI and UX Polish