Skip to content

Extract overlap detection mechanism - #557

Open
temcguir wants to merge 15 commits into
mainfrom
temcguir/extract_overlap_detection
Open

Extract overlap detection mechanism#557
temcguir wants to merge 15 commits into
mainfrom
temcguir/extract_overlap_detection

Conversation

@temcguir

@temcguir temcguir commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

This PR extracts the overlap detection logic into a generic component instead of tightly coupling it to CaptureLayout. Bounding box resolution is computed directly from PreviewDisplay, correctly representing inner viewfinder constraints.

Introduces OverlapAwareStyleProvider and generic background style tracking, correctly resolving overlap based on the dynamic interior bounds of the CameraX Preview.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an overlap-aware styling mechanism for camera controls, allowing their background style to adapt dynamically based on their spatial overlap with the viewfinder. The feedback highlights a compilation error and style guide violation in the newly added unit tests, the need to explicitly provide the LocalOverlapTargetBounds in the production layout to prevent state-sharing bugs, and a request to add KDoc documentation to the new enum class.

@temcguir
temcguir force-pushed the temcguir/extract_overlap_detection branch from 07ab7a0 to 66585e4 Compare August 7, 2026 22:09
@temcguir

temcguir commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a mechanism to dynamically adjust the background style of camera controls based on their spatial overlap with a target region, such as the viewfinder. It adds CameraControlBackgroundStyle, OverlapAwareStyleProvider, and associated CompositionLocals, along with Robolectric tests to verify the overlap logic. The feedback focuses on ensuring the unit tests are density-independent to prevent flakiness, restricting the visibility of the new components to internal per the repository style guide, adding parameter documentation to KDocs, and cleaning up unused imports.

@temcguir
temcguir requested a review from Kimblebee August 10, 2026 18:19
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.

2 participants