Improve NSSL `start` positioning for Dual Shade & Connected Displays.
So far, NSSL's start edge was positioned either at the beginning of the screen (single shade) or at the half-width (split shade). Dual Shade requires more fine-grained positioning, tied to the width of the shade itself; the NSSL should be full-width on narrow screens, and a smaller portion of the screen (either fixed size or a percentage) on wider screens. Summary of changes in this CL: 1. Define dual shade dimens in resource configuration files, instead of code constants. The final values for each config are still TBD, but the tentative spec is: * Pixel portrait/landscape: 412dp * Folded foldable portrait/landscape: 412dp * Unfolded foldable portrait/landscape: 392dp * Tablet portrait/landscape: 474dp 2. Replace `useSplitShade` with `horizontalPosition`. For unflagged code, this is a mechanical refactor where `useSplitShade == true` is equivalent to `horizontalPosition is HorizontalPosition.MiddleToEdge`. I added dedicated unit test cases to verify this. 3. Change the guideline percentage to match the ratio specified in `HorizontalPosition.MiddleToEdge`. This is still 50% at the moment, but will likely change soon for some Dual Shade configurations. 4. Under `HorizontalPosition.FloatAtEnd` (only enabled in SceneContainer and DualShade), do not constrain the NSSL start edge and instead constrain the width. This achieves a fixed-width, end-aligned panel. Bug: 338033836 Flag: com.android.systemui.scene_container Test: Verified manually by observing that notifications placement is unaffected on SceneContainer mode without dual shade, and narrower than half-screen when dual shade is enabled. Test: Added unit tests. Test: Existing unit tests still pass. Change-Id: Ia2b03a3c0376c8490e15c8238ecd89a2eb7dae4f
Loading
Please register or sign in to comment