Change home dragging logic for dead zones

- If a dragged item is not over a valid drop target
then we don't highlight anything and on drop we move
it back to its original position.
- Instead of checking if the dragged item is over the
hotseat view, now we check if the item is over the hotseat
shortcuts.
- Smartspace is a dead zone

Test: drag items from different workspaces, allapps, widget
  picker etc. to all parts of the screen and verify which
  view is targeted and where the item gets dropped.
  Check on phone/foldable/tablet.
Bug: 228201267
Change-Id: I18de576ea300d58ae645e511b238e0b946b5595a
This commit is contained in:
Andras Kloczl
2022-03-16 11:14:05 +00:00
parent 833b0a0b5b
commit 0056e95d8e
3 changed files with 105 additions and 57 deletions

View File

@@ -412,6 +412,14 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext>
coord, includeRootScroll);
}
/**
* Similar to {@link #mapCoordInSelfToDescendant(View descendant, float[] coord)}
* but accepts a Rect instead of float[].
*/
public void mapRectInSelfToDescendant(View descendant, Rect rect) {
Utilities.mapRectInSelfToDescendant(descendant, this, rect);
}
/**
* Inverse of {@link #getDescendantCoordRelativeToSelf(View, float[])}.
*/