Commit Graph

15 Commits

Author SHA1 Message Date
Cole Faust ad78da873d Replace .toList() with .collect()
.toList() was only introduced to android in api level 34, which is newer than
this module's min_sdk_version. Replace it with .collect().

This was found while updating android lint.

Flag: EXEMPT refactor
Bug: 394096385
Test: Presubmits
Change-Id: I71fd1435b7645ea4f1f653c05fef1ddc47adbc14
Merged-In: Id8d1de1531b67a7daf448e45592b7ef78f685fc2
2025-02-03 14:19:57 -08:00
Charlie Anderson 4612239a61 Fixes bug where app suggestions incorrectly calculate available space when bottom row is full
Bug: 318417510
Flag: N/A
Test: manually tested toggling app suggestions with the bottom row filled / not filled
Change-Id: I25461aefa8db93a1c2548604c0ea15c9a12ae688
2024-01-19 13:07:11 -05:00
Sebastian Franco 5cb2c646f0 Simplify attemptPushInDirection
Flag: NA
Bug: 229292911
Test: ReorderAlgorithmUnitTest
Change-Id: I0d8cda2534592a8efce25d254579c4580d645e42
2023-12-06 13:43:27 -06:00
Sebastian Franco 25f8e406a7 Adding ReorderParameters to ReorderAlgorithm
No logic change made.

Flag: NA
Bug: 229292911
Test: ReorderAlgorithmUnitTest
Change-Id: Iababd2fba688a482cffe6d2243c987b0c022c6a5
2023-12-03 22:39:50 -06:00
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
Sebastian Franco a7ff1558c9 Move logic only used on the reorder from the cellLayout to ReorderAlgorithm
This is a no-op thoroughly tested by ReorderAlgorithmUnitTest.

Flag: NA
Bug: 229292911
Test: ReorderAlgorithmUnitTest
Change-Id: I9909477274aadbbf928c9fdeb4157d697c4c7175
2023-11-30 11:14:57 -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 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