diff options
| author | Tiger Huang <tigerhuang@google.com> | 2019-03-18 21:21:26 +0800 |
|---|---|---|
| committer | Tiger Huang <tigerhuang@google.com> | 2019-03-28 16:53:20 +0800 |
| commit | 2b210c234c32b1ea3d760f018274576d05b24ad6 (patch) | |
| tree | 0707025cd3583c20c2ce0170849ffb9b29b0a9f6 /core/java/android/view/ViewParent.java | |
| parent | a50d69cccce55a9de0bdb8e10400e760b3fd1edc (diff) | |
Reduce the window tap exclude region for child above it
For letting touches directly go to the embedded display, we've opened a
tap exclude region for the ActivityView. However, if there is a view on
top of the region, the view cannot be touched within the region.
In this CL, we reduce the tap exclude region if there is a can-receive-
pointer-event view on top of the region.
Bug: 128517544
Test: atest CtsActivityManagerDeviceTestCases:ActivityViewTest
Test: atest FrameworksCoreTests:ViewGroupTest
Test: Menual test with ActivityViewTest and Bubbles
Change-Id: I68e2a9fe9d0891801b533ab8d25074f64bef5a79
Diffstat (limited to 'core/java/android/view/ViewParent.java')
| -rw-r--r-- | core/java/android/view/ViewParent.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/view/ViewParent.java b/core/java/android/view/ViewParent.java index 572e69b1a78c..feba7bb7f195 100644 --- a/core/java/android/view/ViewParent.java +++ b/core/java/android/view/ViewParent.java @@ -18,6 +18,7 @@ package android.view; import android.annotation.NonNull; import android.graphics.Rect; +import android.graphics.Region; import android.os.Bundle; import android.view.accessibility.AccessibilityEvent; @@ -660,4 +661,17 @@ public interface ViewParent { * @return true if the action was consumed by this ViewParent */ public boolean onNestedPrePerformAccessibilityAction(View target, int action, Bundle arguments); + + /** + * Given a touchable region of a child, this method reduces region by the bounds of all views on + * top of the child for which {@link View#canReceivePointerEvents} returns {@code true}. This + * applies recursively for all views in the view hierarchy on top of this one. + * + * @param touchableRegion The touchable region we want to modify. + * @param view A child view of this ViewGroup which indicates the z-order of the touchable + * region. + * @hide + */ + default void subtractObscuredTouchableRegion(Region touchableRegion, View view) { + } } |
