Cherry pick needed for changes on workspace lily
Bug: 188081026
Test: no op change, should compile
Test: ReorderWidgets
Change-Id: I20367974e5a4cead406e18eb66dafd4d59651b2a
The previous reorder solution is not peropperly cleaned and
that leads to wrong solution being used. For example when
longpressing an icon, it triggers a drag but the drag never
finishes.
Fix: 261122618
Test: You can no longer overlap a shortcut in the same app icon (see attached bug)
Test: atest ReorderWidget
Change-Id: Iff8651926cc4179561761c7ce0ac5007f13fc9af
* changes:
Fixing the revert by not continuing the reorder if the solution is null.
Revert "Revert "Reorder widgets no longer overlaps when no space..."
Revert "Revert "Reorder widgets no longer overlaps when no space..."
Revert submission 20479526-revert-20427045-258023561-BPDASTWITO
Reason for revert: Fix the issue that caused the first revert.
Reverted Changes:
Icecfd1d34:Revert "Reorder widgets no longer overlaps when no...
I4cc552588:Revert "Reorder widgets no longer overlaps when no...
Change-Id: I47c4cde42c19f50e2834660d843a8e2ae571c03c
Revert "Reorder widgets no longer overlaps when no space is avai..."
Revert submission 20427045-258023561
Reason for revert: Likely causing NPE while running launcher shortcut tests (Part of DM+Platinum monitor rotation. The revert won't be submitted if proven otherwise)
Bug: 259234533
Reverted Changes:
Ie599f7cb7:Reorder widgets no longer overlaps when no space i...
I04b262ecc:Reorder widgets no longer overlaps when no space i...
Change-Id: I4cc552588c8099356bc3f05c4c63d17a524f2a24
In the previous refactor I got confused between findNearestVacantArea
and findNearestArea thinking the later did the former. So it ignored the occupied spaces and treat it as a solution.
Changed the names to prevent further confusion.
Fix: 258023561
Test: manual, need to add this case to ReorderWidgets
Change-Id: I04b262ecce168d5c93a9d66ef62d5b0e148e38b6
Design doc: https://docs.google.com/document/d/1RsId9OFGgkcImkkmDwWZBBvITWnGlxKVqniE3cimkqY/edit#heading=h.xzptrog8pyxf
As can be seen in the diagram in b/256770363 on every reorder the
first call in the process is MODE_SHOW_REORDER_HINT so if we make
sure that only then a solution is calculated and we reuse that
solution in the rest of the calls in the same reorder then we would
have more consistency and the animation will always be the same and
the logic state.
Fix: 256770363
Bug: 188081026
Test: atest ReorderWidgets
Change-Id: I93a1d09f5b8cbfbc461043ee3fc41b1cab294fed
Using the stack was more efficient because it prevented the creation
of new rectangles but it makes the code harder to read and prone to
bugs if the global state of the stack of rectangles gets corrupted
in any way.
When this optimization was written in 2008 it was necessary but now I
don't think it would have a big impact. The stack size is on average
of 30 and the rectangles are only created when doing the reorder which
runs about once per second if the user moves the finger too quickly.
Bug: 188081026
Test: atest ReorderWidgets
Change-Id: I35d8ee8d92f01035e72fe5763a7de47f4b6a73de
This is done such that future cls are easier to visualize.
Bug: 188081026
Test: atest ReorderWidgets
Change-Id: I749d21b517dada97887d5b5e7cb5e2ac644d0030
Currently the radius is only one cell but in the case of a widget
we want the radius of the whole widget.
Fix: 255421400
Test: this case only happens when dagging comming from outside of the cell layuot in the corners dragging a widget
Change-Id: I3fe294d18283dbecb27df1a2d4748dd44db9b956
Adding new functions to CellLayout, two of them return a solution
(calculateReorder, getSimpleReorder) and the other one takes a
solution and animates that solution (void performReorder) and it can
either submit the solution or just show it for a preview.
Right now this two things are done under the same function:
int[] performReorder. The need to separate this two functions is
because to add this functionality b/188081026 which needs to find
soluion without animation and animation solutions that can be
calculated in another place.
Bug: 188081026
Test: atest ReorderWidgets
Change-Id: Ib519d4346f58f9b55aff5008cd3ccbcfe8443d2d
For the new home gardening mode, we plan on not having a spring loaded mode where the overlay shrinks, so when we have the flag for home gardening on, we won't be having the workspace have the green overlay and the icons shrink
Bug: 251259222
Test: Hold on an icon in workspace to enter edit workspace mode, notice how we no longer shrink the workspace
Change-Id: Ibf1c38eecc117a838eca20a860d47c355955b513
I'm moving the LayoutParams to another file to start the decoupling
of the Reorder outside of the CellLayout.
Also, I change the name from LayoutParams to LauncherLayoutParams to prevent confusion with ViewGroup.LayoutParams making it explicit that this are different LayoutParams.
Bug: 188081026
Test: atest ReorderWidget
Change-Id: I92251c5540ffcf5ece7b933e6f6c836eb825c997
Fix: 239963678
Test: Making sure the reorder preview is being drawn when moving a widget
Test: atest ReorderWidgets
Change-Id: Id32919821ac9177b3428261354d361c52b8f9e2d
The function findNearestArea calculates the corner of the
cell but in that calculation it doesn't account for the padding
in the cells.
Also, change ignoreOccupied because the name says one thing and
the code does the oposite so I change all true calls for false
calls and change the if to !ignoreOccupied so the description of
the parameter match the behaviour of the method.
Also, removing unused method.
Fix: 236134208
Fix: 236129504
Test: visualizing the components of findNearestArea in ag/19248816.
Change-Id: Iac50fbc76b4fa2acda21894ecb976ba612d468fe
Adding a third argument for the talkback string.
Fix: 230593493
Test: Move an item using Talkback and it should mention the row,
column and page where you can drop the item.
Change-Id: Id3d4435e9ef3348278643e6e2a1cd1e8bf5157b7
- Apply additional translation on TaskbarView to account for difference between taskbar icon to bottom spacing compared to hotseat icon to bottom spacing
- Call updateIconAlignment outside of synchronizeNextDraw's then block, which get run after the synchronization
Bug: 204850744
Test: manual
Change-Id: Id65842f506eb342105082649446eb694cd5c33a4
With the introduction of LauncherAppWidgetHostView, CellLayout
no longer reorder correctly when dragging a widget.
Fix: 221495448
Test: When dragging a widget and all spaces are occupied, other icons
should move to the place the widget being dragged used to occupy.
Change-Id: I59ab21eb2717b56a216900049bb4546504e773ba
These are review comments followup from ag/17399997
Bug: b/218187058
Test: manually test thet Launcher3 features work correctly
Change-Id: I9865a37c1ed663370dc28e7678994f3d961e3cd1
Test: manual
Revert submission 17004675-edit-state
Reason for revert: b/226274309
Reverted Changes:
Ib50509b6f:Adjust edit state drop targets per device type and...
Id1817cd3c:Adjust edit state drop targets, workspace scaling,...
Change-Id: I22863d7735f49f6a040a17cf56cc66f20a3e0986
When resetting the hotseat layout, the size of cells also can be changed based on changes in DeviceProfile. In this case, the border size changes when rotating the device.
Fixes 216071526
Test: manual and HSV
Change-Id: Idf7b7972e7be347a991cad1cb8ee8cf95cbc4a87
- Divide total pages by panelCount if two panel is active
- Increment target column when moving an item to right panel
Test: manual
Bug: 200009004
Change-Id: Ia8d2d760dc5e8b413e5b1150c049f7fa3ec26513
Create more attributes for landscape and fix the space between icons in the hotseat. The dimensions are correct but some size might differ from mocks because of device scaling, qsb position and insets not finalized.
Bug: 210118169
Test: visual, using HSV and Window
Change-Id: Ie505923dce2e30133eb1e5c9c83c33a2895147f2
- Before, dragging anywhere in the cell (including space between cells) would trigger a reorder. Now, we compute the radius to the closest cell edge
- For creating folders on icons, we split the difference between the reorder circle (above) and the icon size
Test: enable DEBUG_VISUALIZE_OCCUPIED and manually drag to ensure works as described above
Bug: 204406063
Change-Id: I368714634ed42a930fd16849f2bde1589df1aa63
Previously, the folder creation distance was based on the center of the cell, rather than the *visual* center, i.e. around the icon. Updated to use existing getWorkspaceVisualDragBounds() to handle this.
Test: with DEBUG_VISUALIZE_OCCUPIED=true, ensure green circles are centered around the app icons; manually drag and drop to check the drawn regions are correct
Bug: 204406063
Change-Id: I691a5cbbfc18c88436b88b7bda42f7920b9a5750
Instead of just drawing the occupied cells in red, now we draw the occupied cells based on drag over regions:
- Dragging over the red regions will reorder the cell
- Dragging over the green regions will create/add to a folder
Test: visual with internal flag on
Bug: 204406063
Change-Id: I62105c1c1a1101b6cd6f9fd222980d03ba6d8b84
The grid doesn't have a constant space between cells anymore, so we need
new attributes for the different spaces in different situations.
Bug: 191879424
Test: checking cell size and extra space in dumpsys
Change-Id: I4b6aae5b3fea281490c00cd13d0cd3a25372f21b
> Calulating correct location irrespective of transient
state (scale/translation)
> Removing extraction pause/resume logic
> Simplifying location calculation and registration (only use one location instead of a list)
Bug: 194732483
Test: Manual
Change-Id: I255d83761bff5e09c9fb0a5e398d0be0c1d0956f
=> We were not account for mBorderSpacing in the outline calculation
=> This was fine in most cases as this value is 0, but 4x5 appears to be the exception
Bug: 194227752
Test: manual, see video in bug.
Change-Id: Ib590bc142a0f65e75f92ee057f8b4f4b0f81521b
This allows taskbar to be loaded even in case of 3P Launchers
and removes dependency on LauncherActivity lifecycle
Bug: 187353581
Bug: 188788621
Test: Manual
Change-Id: I5a0988e0697b41677d4c58f0213aef14ec0c0972
- Fix bug where folders are misaligned.
- Fix bug when closing on 2nd page of large folder.
Bug: 184822585
Test: drag folder originally in hotseat to workspace, vice versa
test on grid where isScalable=true and isScalable=false
Change-Id: I08a79b8d280df3e3974baaa07e80db6bc4165e58
Correct the size of the App Widget: first, compute the size when the
widget is positioned (it wasn't done), then do not apply the
transformation when computing the size of the widget when drawn.
Note: Somehow, there is a shift by 1 on the position on the x axis, both
in landscape and portrait. So I added a +1 to get the exact same values.
If not, we have a risk of getting different colors.
Fix: 188759989
Bug: 187907544
Test: Added logs and moved a widget by hand, check the actual
coordinates with hsv.
Change-Id: Ia3bd5b3e3ea9a3ef75f8cdf466a9800786646a94
have its own set of temp variables.
- Pass in float[] param to not create new obj in each frame
for dragging widget case.
Bug: 175329686
Bug: 187019711
Test: manual, verify
Change-Id: I4350fb7e66a80c73def5659fb41abc14d357e667
This reverts commit 17fda29bf3.
Reason for revert: Fixing the memory leak
Leak was detected in caused launcher tapl tests to fail.
For instructions on how to debug leaks, see go/launcher-testing.
Using AS memory profiler, the color extractor class is holding
onto a reference to launcher that has already been destroyed.
The fix is to set the listener to null when view is closed.
Bug: 175329686
Test: run profiler in AS, open and close popups, and verify no leaks
Change-Id: I2d4a87f0481cbc88f3587dce91278e85ca113545