diff options
| author | Chet Haase <chet@google.com> | 2013-04-08 07:35:07 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2013-04-08 07:35:07 -0700 |
| commit | cbfce445c500a12fee63e526251471839f44e26b (patch) | |
| tree | 2d5b1619e533db22015ecd7a82cf77a6d11775ec /core/java/android/view/ViewGroup.java | |
| parent | b21b2c38e54b655a06aeb2d810438c7bd2413637 (diff) | |
| parent | edf6f4b49f6e77c349f5055372ce381b74f12efb (diff) | |
| download | frameworks_base-cbfce445c500a12fee63e526251471839f44e26b.zip frameworks_base-cbfce445c500a12fee63e526251471839f44e26b.tar.gz frameworks_base-cbfce445c500a12fee63e526251471839f44e26b.tar.bz2 | |
am edf6f4b4: Make adding views specific to a ViewGroup\'s overlay
* commit 'edf6f4b49f6e77c349f5055372ce381b74f12efb':
Make adding views specific to a ViewGroup's overlay
Diffstat (limited to 'core/java/android/view/ViewGroup.java')
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index f615e1bc..c07191a 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -1876,34 +1876,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // have become out of sync. removePointersFromTouchTargets(idBitsToAssign); - final float x = ev.getX(actionIndex); - final float y = ev.getY(actionIndex); - - if (mOverlay != null) { - ViewOverlay overlay = (ViewOverlay) mOverlay; - // Check to see whether the overlay can handle the event - final View child = mOverlay; - if (canViewReceivePointerEvents(child) && - isTransformedTouchPointInView(x, y, child, null)) { - newTouchTarget = getTouchTarget(child); - if (newTouchTarget != null) { - newTouchTarget.pointerIdBits |= idBitsToAssign; - } else { - resetCancelNextUpFlag(child); - if (dispatchTransformedTouchEvent(ev, false, child, - idBitsToAssign)) { - mLastTouchDownTime = ev.getDownTime(); - mLastTouchDownX = ev.getX(); - mLastTouchDownY = ev.getY(); - newTouchTarget = addTouchTarget(child, idBitsToAssign); - alreadyDispatchedToNewTouchTarget = true; - } - } - } - } - final int childrenCount = mChildrenCount; if (newTouchTarget == null && childrenCount != 0) { + final float x = ev.getX(actionIndex); + final float y = ev.getY(actionIndex); // Find a child that can receive the event. // Scan children from front to back. final View[] children = mChildren; @@ -2991,6 +2967,26 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } /** + * Returns the ViewGroupOverlay for this view group, creating it if it does + * not yet exist. In addition to {@link ViewOverlay}'s support for drawables, + * {@link ViewGroupOverlay} allows views to be added to the overlay. These + * views, like overlay drawables, are visual-only; they do not receive input + * events and should not be used as anything other than a temporary + * representation of a view in a parent container, such as might be used + * by an animation effect. + * + * @return The ViewGroupOverlay object for this view. + * @see ViewGroupOverlay + */ + @Override + public ViewGroupOverlay getOverlay() { + if (mOverlay == null) { + mOverlay = new ViewGroupOverlay(mContext, this); + } + return (ViewGroupOverlay) mOverlay; + } + + /** * Returns the index of the child to draw for this iteration. Override this * if you want to change the drawing order of children. By default, it * returns i. @@ -3055,11 +3051,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } if (mOverlay != null) { - mOverlay.mRecreateDisplayList = (mOverlay.mPrivateFlags & PFLAG_INVALIDATED) + View overlayView = mOverlay.getOverlayView(); + overlayView.mRecreateDisplayList = (overlayView.mPrivateFlags & PFLAG_INVALIDATED) == PFLAG_INVALIDATED; - mOverlay.mPrivateFlags &= ~PFLAG_INVALIDATED; - mOverlay.getDisplayList(); - mOverlay.mRecreateDisplayList = false; + overlayView.mPrivateFlags &= ~PFLAG_INVALIDATED; + overlayView.getDisplayList(); + overlayView.mRecreateDisplayList = false; } } |
