summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yunfan Chen <yunfanc@google.com> 2022-03-31 17:04:21 +0900
committer Yunfan Chen <yunfanc@google.com> 2022-04-01 05:20:03 +0000
commit16e58e7322fdc48d37767d155c332b15c508cfbb (patch)
tree2c137a036c34b35fefb0f20c59324234a4b81893
parenta6f4bbd41831a6a6beaa3c8450b99654a49b2c76 (diff)
Provide gesture and tappable element insets for caption
Caption is covering the app region and will take gesture and tap events when the user interact with the caption. This change will make sure the app can receive the caption as a part of the tappable element insets and gesture insets to avoid the caption overlaps with interactive elements inside the window. Bug: 219987804 Bug: 209717743 Test: atest, see the bugs Change-Id: I6e48f8df6eb8f73a2f62f34109f4d80d09021929
-rw-r--r--core/java/android/view/InsetsState.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/view/InsetsState.java b/core/java/android/view/InsetsState.java
index 75b69cb12d32..d15d7c7045e9 100644
--- a/core/java/android/view/InsetsState.java
+++ b/core/java/android/view/InsetsState.java
@@ -391,6 +391,17 @@ public class InsetsState implements Parcelable {
processSourceAsPublicType(source, typeInsetsMap, typeSideMap, typeVisibilityMap,
insets, Type.SYSTEM_GESTURES);
}
+ if (type == Type.CAPTION_BAR) {
+ // Caption should also be gesture and tappable elements. This should not be needed when
+ // the caption is added from the shell, as the shell can add other types at the same
+ // time.
+ processSourceAsPublicType(source, typeInsetsMap, typeSideMap, typeVisibilityMap,
+ insets, Type.SYSTEM_GESTURES);
+ processSourceAsPublicType(source, typeInsetsMap, typeSideMap, typeVisibilityMap,
+ insets, Type.MANDATORY_SYSTEM_GESTURES);
+ processSourceAsPublicType(source, typeInsetsMap, typeSideMap, typeVisibilityMap,
+ insets, Type.TAPPABLE_ELEMENT);
+ }
}
private void processSourceAsPublicType(InsetsSource source, Insets[] typeInsetsMap,