Commit Graph

13 Commits

Author SHA1 Message Date
Sebastian Franco
dcf6bf2311 Moving the remainder of reorder logic to ReorderAlgorithm
This is a no-op thoroughly tested by ReorderAlgorithmUnitTest.

Flag: NA
Bug: 229292911
Test: ReorderAlgorithmUnitTest
Change-Id: I7203444df289cd3b67794fc570a2cd46e64549a2
2023-12-01 12:50:13 -06:00
Sebastián Franco
61fbd18e5d Revert^2 "Moving rearrangementExists to ReorderLogic since it's only used there"
This reverts commit 484a7ea4f3.

Reason for revert: Fixing build error 

Change-Id: I00dcbb831dc40a90d43ada7315969251413bb88b
2023-11-29 21:54:51 +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
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
9ea36d429c Adding animation so the CellLayout is properly spaced on Foldables
Flag: LEGACY FOLDABLE_SINGLE_PAGE DISABLED
Fix: 294841331
Test: atest HomeScreenEditStateImageTest
Change-Id: I5dc94b63ca322748b952ce4bd55b6951d51d190f
2023-10-20 13:59:40 -07:00
Sebastian Franco
96c46e7fba Add seam space for performReorder in MultipageCellLayout
In the other method createAreaForResize we add 1 to the cellX
to account for the seam in the Multipace CellLayout but we don't
account for that on performReorder and we need to add a cellWidth

Also, some methods are not running when the seam is added so their
result are wrong. Now all methods are being accounted for.

Fix: 277709417
Test: atest ReorderAlgorithm
Test: atest MulticellReorderAlgorithm
Change-Id: I7a4ca55f7b9cd7cf94481c880fe152e0a3bb3cf3
2023-05-18 14:47:47 -07:00
Sebastian Franco
25423867af Fixing test that fail when FOLDABLE_SINGLE_PAGE is set to true
We need to change the result of REQUEST_IS_TWO_PANELS when the
flag is on because now we don't have two panels only 1.

Another of the issues is a rounding error when calling
getUnusedHorizontalSpace().

And lastly updating workspaceToBoards so that it maps the coordinate
of workspace items to their right position.

Bug: 270395274
Test: atest ReorderWidgets
Change-Id: I2620e5bf1ba132f984e00d2a6c21081953d259fd
2023-03-20 17:06:20 +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
Sebastian Franco
c515d02f28 Fix widget resize if it last for too long on Multipage CellLayout
We need to make sure the seam is added when the countX is even
checking for => and if you reszie for a while the occupied grid
starts to have incorrect values.

Fix: 270227019
Test: atest FoldableItemsIntegrity
Test: atest ReorderWidgets
Change-Id: I3faf5d23427dc966c48ce5c613e68e42a101f45b
2023-03-01 13:51:24 -08:00
Sebastian Franco
ee1baba8f4 Accoutning for the seam on createAreaForResize for cellX position
I fix the left side resize issues but that broke right side resizes
because I wasn't accounting for the seam and the other functions don't
need to because they don't receive x,y cell position but they receive
pixel position which are already accounted for by simulateSeam.

Fix: 270227019
Test: atest FoldableItemsIntegrity
Test: atest ReorderWidgets
Change-Id: Ida09629111ea6f78a089f19a14bd806bd10bbff8
2023-02-22 19:30:11 +00:00
Sebastian Franco
317c4faeea Correctly add seam to MultipageCellLayout when resizing widget
Fix: 270227019
Test: atest FoldableItemsIntegrity
Test: atest ReorderWidgets
Change-Id: Idf3d820112fe53202f0dab00c78682c31a692bc1
2023-02-21 17:09:45 -08:00
Sebastian Franco
09589326db Simulating a split screen CellLayout using one CellLayout
Test: atest ReorderWidget
Fix: 188081026
Change-Id: I8eda5f77c11dc2625ae1f028d07539c28018fb55
2023-02-07 17:03:22 -08:00