Stay organized with collections Save and categorize content based on your preferences. Insets
class Insets : Parcelable
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
| Inherited constants |
From class Parcelable Int | CONTENTS_FILE_DESCRIPTOR Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor. | Int | PARCELABLE_WRITE_RETURN_VALUE Flag for use with writeToParcel: the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)". Some implementations may want to release resources at this point. | |
| Public methods |
| static Insets | Add two Insets. |
| Int | |
| Boolean | Two Insets instances are equal iff they belong to the same class and their fields are pairwise equal. |
| Int | |
| static Insets | Retrieves the maximum of two Insets. |
| static Insets | Retrieves the 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. |
| String | |
| Unit | |
Public methods
add
static fun add(
a: Insets,
b: Insets
): Insets
Add two Insets.
| Parameters |
a | Insets: The first Insets to add. This value cannot be null. |
b | Insets: The second Insets to add. This value cannot be null. |
| Return |
Insets | a + b, i. e. all insets on every side are added together. This value cannot be null. |
describeContents
fun describeContents(): Int
equals
fun equals(other: Any?): Boolean
Two Insets instances are equal iff they belong to the same class and their fields are pairwise equal.
| Parameters |
obj | the reference object with which to compare. |
o | the object to compare this instance with. |
| Return |
Boolean | true iff this object is equal o |
hashCode
fun hashCode(): Int
| Return |
Int | a hash code value for this object. |
max
static fun max(
a: Insets,
b: Insets
): Insets
Retrieves the maximum of two Insets.
| Parameters |
a | Insets: The first Insets. This value cannot be null. |
b | Insets: The second Insets. This value cannot be null. |
| Return |
Insets | max(a, b), i. e. the larger of every inset on every side is taken for the result. This value cannot be null. |
min
static fun min(
a: Insets,
b: Insets
): Insets
Retrieves the minimum of two Insets.
| Parameters |
a | Insets: The first Insets. This value cannot be null. |
b | Insets: The second Insets. This value cannot be null. |
| Return |
Insets | min(a, b), i. e. the smaller of every inset on every side is taken for the result. This value cannot be null. |
of
static fun of(r: Rect?): Insets
Return an Insets instance with the appropriate values.
| Parameters |
r | Rect?: the rectangle from which to take the values This value may be null. |
| Return |
Insets | an Insets instance with the appropriate values This value cannot be null. |
of
static fun of(
left: Int,
top: Int,
right: Int,
bottom: Int
): Insets
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 |
| Return |
Insets | Insets instance with the appropriate values This value cannot be null. |
subtract
static fun subtract(
a: Insets,
b: Insets
): Insets
Subtract two Insets.
| Parameters |
a | Insets: The minuend. This value cannot be null. |
b | Insets: The subtrahend. This value cannot be null. |
| Return |
Insets | a - b, i. e. all insets on every side are subtracted from each other. This value cannot be null. |
toString
fun toString(): String
| Return |
String | a string representation of the object. |
Properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]