summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2020-03-02 20:09:35 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-03-02 20:09:35 +0000
commit555a54a9007dfae15e7ed5286bda60ac89277494 (patch)
tree6cc9530125a66adc2a2996f6e9cac527d186e92f /core/java/android
parent27f08dad6681a062c8a6814b2e6891ba520232eb (diff)
parent3381108be2e5676fce016c4061155c47a82e5269 (diff)
Merge "Unhide WindowInsets#inset with insets argument" into rvc-dev
Diffstat (limited to 'core/java/android')
-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 20fa5cab0464..fde184ccfb0e 100644
--- a/core/java/android/view/WindowInsets.java
+++ b/core/java/android/view/WindowInsets.java
@@ -858,11 +858,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);
}
@@ -884,6 +894,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,