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.

String toString()

Inherited methods

Fields

NONE

public static final Insets NONE

bottom

public final int bottom

left

public final int left

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

toString

public String toString ()

Returns
String