summaryrefslogtreecommitdiff
path: root/core/java/android/view/WindowInsets.java
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2020-02-27 19:03:39 +0100
committerJorim Jaggi <jjaggi@google.com>2020-03-02 18:13:29 +0100
commit3381108be2e5676fce016c4061155c47a82e5269 (patch)
tree9099b3747bf8f54a3a306956de38f7a3989a644a /core/java/android/view/WindowInsets.java
parente06e29bb090d74bef9ec5e0cc9c5705b5ff0e55b (diff)
Unhide WindowInsets#inset with insets argument
Test: WindowInsetsAnimationTests Bug: 118118435 Change-Id: I359ac49403bfc63120d4e9565e4fa7801a840333
Diffstat (limited to 'core/java/android/view/WindowInsets.java')
-rw-r--r--core/java/android/view/WindowInsets.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/java/android/view/WindowInsets.java b/core/java/android/view/WindowInsets.java
index a6c311e1daa5..75e26a33d9af 100644
--- a/core/java/android/view/WindowInsets.java
+++ b/core/java/android/view/WindowInsets.java
@@ -857,11 +857,21 @@ public final class WindowInsets {
/**
* Returns a copy of this instance inset in the given directions.
*
+ * This is intended for dispatching insets to areas of the window that are smaller than the
+ * current area.
+ *
+ * <p>Example:
+ * <pre>
+ * childView.dispatchApplyWindowInsets(insets.inset(childMargins));
+ * </pre>
+ *
+ * @param insets the amount of insets to remove from all sides.
+ *
* @see #inset(int, int, int, int)
- * @hide
*/
@NonNull
- public WindowInsets inset(Insets insets) {
+ public WindowInsets inset(@NonNull Insets insets) {
+ Objects.requireNonNull(insets);
return inset(insets.left, insets.top, insets.right, insets.bottom);
}
@@ -883,6 +893,8 @@ public final class WindowInsets {
* @param bottom the amount of insets to remove from the bottom. Must be non-negative.
*
* @return the inset insets
+ *
+ * @see #inset(Insets)
*/
@NonNull
public WindowInsets inset(@IntRange(from = 0) int left, @IntRange(from = 0) int top,