screen capture: fix the RegionBoxButton's position for different cases
Previously, the caption button `RegionBoxButton` was either inside the selection box or directly on top of it if the box was too small. The new logic introduces an OutsideLocation enum (TOP, BOTTOM, LEFT, RIGHT) and a more robust placement strategy: 1. It first checks if the button can fit inside the selection box. 2. If not, it determines the best outside position by checking available space in a specific order: * Top: if it fit above the selection box * Bottom: Otherwise, if it fit below the selection box and the dimensions pill * Right: Otherwise, if it fit to the right of the selection box * Left: If none of the above, it defaults to the left. This ensures the button remains visible and accessible on the screen, even when the user draws a selection box near the screen edges. Bug: 437975890 Test: Manual Flag: com.android.systemui.large_screen_screencapture Change-Id: I505166d64b3c6775c8b79ee1b2be9b587fef5142
Loading
Please register or sign in to comment