[2/5] Hook up DragToBubbleController and prepare launcher to use it.

Updated DragController logic to set touch event XY coordinates if there
is no view returned by the DropTarget. Added wait call for all drop
targets views removed to the
TaskbarActivityContext#onDragEndOrViewRemoved() method.

Bug: 411506181
Flag: com.android.wm.shell.enable_create_any_bubble
Test: build launcher
Change-Id: Ie97b08f22ae8dc34bd9f4e3738704e4fc90345bb
This commit is contained in:
mpodolian
2025-05-13 11:22:34 -07:00
parent dbd42b6f05
commit 86f7a230f8
5 changed files with 28 additions and 9 deletions
+14 -2
View File
@@ -20,6 +20,8 @@ import android.content.Context;
import android.graphics.Rect;
import android.view.View;
import androidx.annotation.Nullable;
import com.android.launcher3.accessibility.DragViewStateAnnouncer;
import com.android.launcher3.dagger.LauncherComponentProvider;
import com.android.launcher3.dragndrop.DragOptions;
@@ -147,8 +149,18 @@ public interface DropTarget {
// These methods are implemented in Views
void getHitRectRelativeToDragLayer(Rect outRect);
/** Returns the drop target view. By default, the implementor class is cast to the view. */
default View getDropView() {
/**
* Returns the drop target view.<br>
*
* By default, the implementor class is cast to the view.<br>
*
* The returned {@link View} will be use to map touch coordinates to the view self descendant
* and set as [{@link DragObject#x DragObject.x} {@link DragObject#y DragObject.y}].<br>
*
* If this method returns {@code null}, the raw touch event coordinates will be directly
* assigned to [{@link DragObject#x DragObject.x} and {@link DragObject#y DragObject.y}].
*/
default @Nullable View getDropView() {
return (View) this;
}
}