Commit Graph

8 Commits

Author SHA1 Message Date
Greg Kaiser 4144564af6 Merge "Revert "Moving rearrangementExists to ReorderLogic since it's only used there"" into main 2023-11-29 20:36:54 +00:00
Greg Kaiser 484a7ea4f3 Revert "Moving rearrangementExists to ReorderLogic since it's only used there"
This reverts commit 6890893a24.

Reason for revert: Many build breaks, like https://android-build.corp.google.com/artifact/submitted/11157014/mokey_go32-trunk_staging-userdebug/latest/view/logs%2Fbuild_error.log , seem related to this.

Change-Id: I049c94fbd1e089c65fd4e0abb4ac2c165f228c92
2023-11-29 20:26:47 +00:00
Sebastián Franco 1c1c18ca28 Merge "Moving rearrangementExists to ReorderLogic since it's only used there" into main 2023-11-29 19:18:18 +00:00
Sebastian Franco 6c7d817bc7 Add unit test for CellLayout making sure the reorder are valid and fix Multipage CellLyout
The new test generate hundreds of new boards using a fixed seed so the
test cases can be recreated if there is an error.

Some of the new clases where inside of CellLayoutBoard and moved
outside.

Flag: LEGACY FOLDABLE_SINGLE_PAGE DISABLED
Bug: 270395274
Test: ReorderAlgorithmUnitTest
Change-Id: I083fb6701b02b7c0b2cf24634ca71acb0c75902e
2023-11-27 17:12:43 -06:00
Sebastian Franco 6890893a24 Moving rearrangementExists to ReorderLogic since it's only used there
Also, simplify copyCurrentStateToSolution since it always gets false
as the second parameter.

Flag: NA
Bug: 229292911
Test: ReorderAlgorithmUnitTest
Change-Id: I025566897246fa59ca513cb7de9a12465054498f
2023-11-27 16:36:44 -06:00
Sebastian Franco 5f0af4f633 Moving classes inside of CellLayout to their own file
This is a no-op change ensure this we have ReorderAlgorithmUnitTest.

Flag: NA
Bug: 229292911
Test: ReorderAlgorithmUnitTest
Change-Id: I6ffe2a1260f869a4686a9f1e652dd1ab6d406269
2023-11-23 23:13:56 +00:00
Sebastian Franco 6336f9bca3 Make sure ReorderAlgorithm only work on the logic layer and not on the view layer
The method isNearestDropLocationOccupied finds the NearestDrop location
using the view models (i.e. the CellLayoutLayoutParams) and the new
method isConfigurationRegionOccupied run over the logic models (i.e. the
CellAndSpan or ItemConfiguration) ensuring a separation between them.

Test: ReorderAlgorithmUnitTest
Flag: LEGACY FOLDABLE_SINGLE_PAGE DISABLED
Bug: 270395274
Change-Id: I0b3c6606ee6934ea3a5e41d110677c496d4a4330
2023-11-17 17:02:39 +00:00
Sebastian Franco e4c0345747 Decoupling the reorder logic from the CellLayout view
ReorderAlgorithm will now handle all the logic associated with the
reorder. Basically all the logic associated with a reorder in CellLayout
was copy and pasted into ReorderAlgorithm.java.

Test: atest TestReorderAlgorithm
Bug: 229292911
Change-Id: Ie096abc346bf705414e47452a42d1dec5be0a041
2023-03-03 16:57:02 -08:00