Merge "Fix regression in updating gesture exclusion rects" into qt-qpr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b85d750900
@@ -44,7 +44,7 @@ class GestureExclusionTracker {
|
|||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
final GestureExclusionViewInfo info = i.next();
|
final GestureExclusionViewInfo info = i.next();
|
||||||
final View v = info.getView();
|
final View v = info.getView();
|
||||||
if (v == null || !v.isAttachedToWindow() || !v.isShown()) {
|
if (v == null || !v.isAttachedToWindow() || !v.isAggregatedVisible()) {
|
||||||
mGestureExclusionViewsChanged = true;
|
mGestureExclusionViewsChanged = true;
|
||||||
i.remove();
|
i.remove();
|
||||||
continue;
|
continue;
|
||||||
@@ -123,7 +123,7 @@ class GestureExclusionTracker {
|
|||||||
public int update() {
|
public int update() {
|
||||||
final View excludedView = getView();
|
final View excludedView = getView();
|
||||||
if (excludedView == null || !excludedView.isAttachedToWindow()
|
if (excludedView == null || !excludedView.isAttachedToWindow()
|
||||||
|| !excludedView.isShown()) return GONE;
|
|| !excludedView.isAggregatedVisible()) return GONE;
|
||||||
final List<Rect> localRects = excludedView.getSystemGestureExclusionRects();
|
final List<Rect> localRects = excludedView.getSystemGestureExclusionRects();
|
||||||
final List<Rect> newRects = new ArrayList<>(localRects.size());
|
final List<Rect> newRects = new ArrayList<>(localRects.size());
|
||||||
for (Rect src : localRects) {
|
for (Rect src : localRects) {
|
||||||
|
|||||||
@@ -14343,6 +14343,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if this view and all ancestors are visible as of the last
|
||||||
|
* {@link #onVisibilityAggregated(boolean)} call.
|
||||||
|
*/
|
||||||
|
boolean isAggregatedVisible() {
|
||||||
|
return (mPrivateFlags3 & PFLAG3_AGGREGATED_VISIBLE) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dispatching method for {@link #onVisibilityAggregated}. Overridden by
|
* Internal dispatching method for {@link #onVisibilityAggregated}. Overridden by
|
||||||
* ViewGroup. Intended to only be called when {@link #isAttachedToWindow()},
|
* ViewGroup. Intended to only be called when {@link #isAttachedToWindow()},
|
||||||
@@ -14371,7 +14379,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
@CallSuper
|
@CallSuper
|
||||||
public void onVisibilityAggregated(boolean isVisible) {
|
public void onVisibilityAggregated(boolean isVisible) {
|
||||||
// Update our internal visibility tracking so we can detect changes
|
// Update our internal visibility tracking so we can detect changes
|
||||||
boolean oldVisible = (mPrivateFlags3 & PFLAG3_AGGREGATED_VISIBLE) != 0;
|
boolean oldVisible = isAggregatedVisible();
|
||||||
mPrivateFlags3 = isVisible ? (mPrivateFlags3 | PFLAG3_AGGREGATED_VISIBLE)
|
mPrivateFlags3 = isVisible ? (mPrivateFlags3 | PFLAG3_AGGREGATED_VISIBLE)
|
||||||
: (mPrivateFlags3 & ~PFLAG3_AGGREGATED_VISIBLE);
|
: (mPrivateFlags3 & ~PFLAG3_AGGREGATED_VISIBLE);
|
||||||
if (isVisible && mAttachInfo != null) {
|
if (isVisible && mAttachInfo != null) {
|
||||||
@@ -14423,7 +14431,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
}
|
}
|
||||||
|
|
||||||
notifyAppearedOrDisappearedForContentCaptureIfNeeded(isVisible);
|
notifyAppearedOrDisappearedForContentCaptureIfNeeded(isVisible);
|
||||||
updateSystemGestureExclusionRects();
|
if (isVisible != oldVisible) {
|
||||||
|
updateSystemGestureExclusionRects();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user