Insets
class Insets
kotlin.Any | |
↳ | 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
Public methods | |
---|---|
static Insets |
Add two Insets. |
Boolean |
Two Insets instances are equal if they belong to the same class and their fields are pairwise equal. |
Int |
hashCode() |
static Insets |
Returns the component-wise maximum of two Insets. |
static Insets |
Returns the component-wise minimum of two Insets. |
static Insets |
Return an Insets instance with the appropriate values. |
static Insets |
Return an Insets instance with the appropriate values. |
static Insets |
Subtract two Insets. |
static Insets |
toCompatInsets(@NonNull insets: Insets) Return a copy of the given |
Insets |
Return a copy this instance, converted to be an |
String |
toString() |
Properties | |
---|---|
static Insets | |
Int | |
Int | |
Int | |
Int |
Public methods
add
@NonNull static fun add(
@NonNull a: Insets,
@NonNull b: Insets
): Insets
Add two Insets.
Parameters | |
---|---|
a |
Insets: The first Insets to add. |
b |
Insets: The second Insets to add. |
Return | |
---|---|
Insets |
a + b, i. e. all insets on every side are added together. |
equals
fun equals(other: Any?): Boolean
Two Insets instances are equal if they belong to the same class and their fields are pairwise equal.
Parameters | |
---|---|
o |
the object to compare this instance with. |
Return | |
---|---|
Boolean |
true iff this object is equal o |
hashCode
fun hashCode(): Int
max
@NonNull static fun max(
@NonNull a: Insets,
@NonNull b: Insets
): Insets
Returns the component-wise maximum of two Insets.
Parameters | |
---|---|
a |
Insets: The first Insets. |
b |
Insets: The second Insets. |
Return | |
---|---|
Insets |
an Insets instance where the inset on each side is the larger of the insets on that side from a and b . |
min
@NonNull static fun min(
@NonNull a: Insets,
@NonNull b: Insets
): Insets
Returns the component-wise minimum of two Insets.
Parameters | |
---|---|
a |
Insets: The first Insets. |
b |
Insets: The second Insets. |
Return | |
---|---|
Insets |
an Insets instance where the inset on each side is the smaller of the insets on that side from a and b . |