From 02ed4a0e10522147425ea65704edd56f2aa6d061 Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Fri, 23 Oct 2015 17:39:33 -0700 Subject: [PATCH] Sending drag-start notifications to children added to view group. Doing this while dragging is really necessary for System UI shelf. Also, not forgetting to remove the child from the "interested" set when the child is removed. Bug: 25231591 Change-Id: I26f5086a0a842868b2d7e9809f7483152098f314 (cherry picked from commit a82c8709f0914064f4b00262f1d411594bab467f) --- core/java/android/view/ViewGroup.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 7c7ad91026959..db978a6748f78 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -4435,6 +4435,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } } + + if (mCurrentDragStartEvent != null && child.getVisibility() == VISIBLE) { + notifyChildOfDragStart(child); + } } private void addInArray(View child, int index) { @@ -4686,6 +4690,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager mTransientIndices.set(i, oldIndex - 1); } } + + if (mCurrentDragStartEvent != null) { + mChildrenInterestedInDrag.remove(view); + } } /**