Commit Graph

10 Commits

Author SHA1 Message Date
Sebastian Franco
f7654252b1 Moving ReorderPreviewAnimation into it's own file and rewrite to Kotlin.
This will make it easier to write unit testing.

Fix: 294473336
Test: manual testing
Flag: NA
Change-Id: I2d6cfd8110c5c2ef09c49150a0bd071bc948995c
2024-01-24 14:04:48 -08: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
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
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
Sebastián Franco
525b0343f8 Merge "Moving classes inside of CellLayout to their own file" into main 2023-11-24 01:27:13 +00: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
d30100eaa9 Move classes inside of CellLayoutBoard to their own file
Previous step for adding unit testing for MultipageCellLayout.

Flag: LEGACY FOLDABLE_SINGLE_PAGE DISABLED
Bug: 270395274
Test: ReorderAlgorithmUnitTest
Change-Id: Ia5ca0b10481d7a21883594434b3406fb3a5ccf0b
2023-11-20 17:58:24 -06:00
Alex Chau
36c3880b6b Fix ReorderAlgorithmUnitTest not restoring numRows properly
Fix: 289191222
Test: ReorderAlgorithmUnitTest
Change-Id: I4e8a8afc6bd043c3983b19220bca0e50c26eab69
2023-06-28 18:44:59 +00:00
Sebastian Franco
d3f6522ebb Stopp Cell height from changing when running ReorderUnitTest
Fix: 280683994
Test: atest ReorderAlgorithmUnitTest
Change-Id: Iee6336e11387a637e3fe52722d4f30a15e58aca9
2023-05-11 13:12:55 -06:00
Sebastian Franco
45b39b50e5 Adding unit test to ReorderAlgorithm
Adding 100 different test cases for the ReorderAlgorithm.
The test cases are randomly generated using generateRandomTestCase()
the boards are generated once and then written in the file
reorder_algorithm_test_cases. I will leave the code to generate
the boards in the Test even though is not used anymore in case
we need to generate more boards later on.

Also, I found that the ReorderAlgorithm was not deterministic,
meaning that it could generate two different results with the same
inputs (views positions and view being drag positions), because
it was traversing a map whose has was the object id which is
random. So I sort the views before traversing them.

Bug: 229292911
Test: atest ReorderAlgorithmUnitTestCase

Change-Id: I196eb8f1dafcb57d5259969268c458129ae4f46b
2023-05-03 11:22:09 -06:00