mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
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:
@@ -272,6 +272,16 @@ public final class Utilities {
|
||||
Math.max(points[1], points[3]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to {@link #mapCoordInSelfToDescendant(View descendant, View root, float[] coord)}
|
||||
* but accepts a Rect instead of float[].
|
||||
*/
|
||||
public static void mapRectInSelfToDescendant(View descendant, View root, Rect rect) {
|
||||
float[] coords = new float[]{rect.left, rect.top, rect.right, rect.bottom};
|
||||
mapCoordInSelfToDescendant(descendant, root, coords);
|
||||
rect.set((int) coords[0], (int) coords[1], (int) coords[2], (int) coords[3]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inverse of {@link #getDescendantCoordRelativeToAncestor(View, View, float[], boolean)}.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user