Refactor how split ratios are stored and passed between Launcher and Shell
Split ratios are now stored as an int enum called @SnapPosition. For example, there is a snap position representing a 50-50 split, one for a 70-30 split, and so on. Previously, split ratios were calculated once by the DividerSnapAlgorithm and stored only as int positions on each SnapTarget, meaning that if you wanted to know the screen split ratio, you would have to calculate it manually from the bounds of each RemoteAnimationTarget and pass it around as a float (differing across devices with different screen sizes). With SnapPosition, screen ratios are more available and less device dependent. The change should lead to cleaner (and hopefully more readable) code. - SnapTargets now know their snapPosition in addition to their pixel position - Launcher now requests split launches using the snapPosition rather than a float splitRatio Bug: 274189428 Bug: 182839788 Test: Existing tests still pass Change-Id: I50d109ee67993629c277ec65d42b68fae18082b3
Loading
Please register or sign in to comment