Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 70719529 authored by Jeremy Sim's avatar Jeremy Sim
Browse files

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
parent 26facd1a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment