desktop-exploded-view: Implement layout algorithm
It was ported over from ChromeOS Overview layout algorithm. In overview,
the layout is done in two stages:
1. Optimal height is determined. In this stage height is bisected to
find maximum height which still allows all the windows to fit.
2. Row widths are balanced. In this stage the available width is reduced
until some windows are no longer fitting or until the difference
between the narrowest and the widest rows starts growing. Overall
this achieves the goals of maximum size for previews (or maximum
row height which is equivalent assuming fixed height), balanced rows
and minimal wasted space.
Flag: com.android.launcher3.enable_desktop_exploded_view
Test: Manual
Bug: b:367353392, b:353948965
Change-Id: I1d0fd2b30ffa5bbc0853650884cf85b519be4227
2 files changed