Insets
public
final
class
Insets
extends Object
| java.lang.Object | |
| ↳ | androidx.core.graphics.Insets |
An 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.
Summary
Fields | |
|---|---|
public
static
final
Insets |
NONE
|
public
final
int |
bottom
|
public
final
int |
left
|
public
final
int |
right
|
public
final
int |
top
|
Public methods | |
|---|---|
boolean
|
equals(Object o)
Two Insets instances are equal iff they belong to the same class and their fields are pairwise equal. |
int
|
hashCode()
|
static
Insets
|
of(int left, int top, int right, int bottom)
Return an Insets instance with the appropriate values. |
static
Insets
|
of(Rect r)
Return an Insets instance with the appropriate values. |
static
Insets
|
toCompatInsets(Insets insets)
Return a copy of the given |
Insets
|
toPlatformInsets()
Return a copy this instance, converted to be an |
String
|
toString()
|
Inherited methods | |
|---|---|
Fields
bottom
public final int bottom
left
public final int left
right
public final int right
top
public final int top
Public methods
equals
public boolean equals (Object o)
Two Insets instances are equal iff they belong to the same class and their fields are pairwise equal.
| Parameters | |
|---|---|
o |
Object: the object to compare this instance with. |
| Returns | |
|---|---|
boolean |
true iff this object is equal o
|
hashCode
public int hashCode ()
| Returns | |
|---|---|
int |
|
of
public static Insets of (int left, int top, int right, int bottom)
Return an Insets instance with the appropriate values.
| Parameters | |
|---|---|
left |
int: the left inset |
top |
int: the top inset |
right |
int: the right inset |
bottom |
int: the bottom inset |
| Returns | |
|---|---|
Insets |
Insets instance with the appropriate values |
of
public static Insets of (Rect r)
Return an Insets instance with the appropriate values.
| Parameters | |
|---|---|
r |
Rect: the rectangle from which to take the values |
| Returns | |
|---|---|
Insets |
an Insets instance with the appropriate values |
toCompatInsets
public static Insets toCompatInsets (Insets insets)
Return a copy of the given Insets instance, converted to be an
Insets instance from AndroidX.
| Parameters | |
|---|---|
insets |
Insets |
| Returns | |
|---|---|
Insets |
|
toPlatformInsets
public Insets toPlatformInsets ()
Return a copy this instance, converted to be an Insets instance
from the platform.
| Returns | |
|---|---|
Insets |
|
toString
public String toString ()
| Returns | |
|---|---|
String |
|