-
public final class InsetsAn Insets instance holds four integer offsets which describe changes to the four edges of a Rectangle. By convention, positive values move edges towards the centre of the rectangle.
Insets are immutable so may be treated as values.
-
-
Method Summary
Modifier and Type Method Description static Insetsof(int left, int top, int right, int bottom)Return an Insets instance with the appropriate values. static Insetsof(@NonNull() Rect r)Return an Insets instance with the appropriate values. static Insetsadd(@NonNull() Insets a, @NonNull() Insets b)Add two Insets. static Insetssubtract(@NonNull() Insets a, @NonNull() Insets b)Subtract two Insets. static Insetsmax(@NonNull() Insets a, @NonNull() Insets b)Retrieves the maximum of two Insets. static Insetsmin(@NonNull() Insets a, @NonNull() Insets b)Retrieves the minimum of two Insets. booleanequals(Object o)Two Insets instances are equal if they belong to the same class and their fields arepairwise equal. inthashCode()StringtoString()static Insetswrap(@NonNull() Insets insets)static InsetstoCompatInsets(@NonNull() Insets insets)Return a copy of the given android.graphics.Insets instance, converted to be an Insets instance from AndroidX. InsetstoPlatformInsets()Return a copy this instance, converted to be an android.graphics.Insets instancefrom the platform. -
-
Method Detail
-
of
@NonNull() static Insets of(int left, int top, int right, int bottom)
Return an Insets instance with the appropriate values.
- Parameters:
left- the left insettop- the top insetright- the right insetbottom- the bottom inset
-
of
@NonNull() static Insets of(@NonNull() Rect r)
Return an Insets instance with the appropriate values.
- Parameters:
r- the rectangle from which to take the values
-
add
@NonNull() static Insets add(@NonNull() Insets a, @NonNull() Insets b)
Add two Insets.
- Parameters:
a- The first Insets to add.b- The second Insets to add.
-
subtract
@NonNull() static Insets subtract(@NonNull() Insets a, @NonNull() Insets b)
Subtract two Insets.
- Parameters:
a- The minuend; the value from which{@code b}will be subtracted.b- The subtrahend; the value which will be subtracted from{@code a}.
-
max
@NonNull() static Insets max(@NonNull() Insets a, @NonNull() Insets b)
Retrieves the maximum of two Insets.
- Parameters:
a- The first Insets.b- The second Insets.
-
min
@NonNull() static Insets min(@NonNull() Insets a, @NonNull() Insets b)
Retrieves the minimum of two Insets.
- Parameters:
a- The first Insets.b- The second Insets.
-
equals
boolean equals(Object o)
Two Insets instances are equal if they belong to the same class and their fields arepairwise equal.
- Parameters:
o- the object to compare this instance with.
-
hashCode
int hashCode()
-
toCompatInsets
@NonNull() static Insets toCompatInsets(@NonNull() Insets insets)
Return a copy of the given android.graphics.Insets instance, converted to be an Insets instance from AndroidX.
-
toPlatformInsets
@NonNull() Insets toPlatformInsets()
Return a copy this instance, converted to be an android.graphics.Insets instancefrom the platform.
-
-
-
-