public final class ViewInsets extends Object implements Serializable
Insets
based
on floats.
As the views of a same type should possibly use the same
insets there is a potential for sharing
of ViewInsets
instances.
Modifier and Type | Field and Description |
---|---|
static ViewInsets |
ZERO_INSETS |
Constructor and Description |
---|
ViewInsets(float top,
float left,
float bottom,
float right)
Creates and initializes a new
ViewInsets object with the
specified top, left, bottom, and right insets. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Checks whether two float insets objects are equal.
|
float |
getBottom() |
float |
getLeft() |
float |
getLeftRight() |
float |
getRight() |
float |
getTop() |
float |
getTopBottom() |
int |
hashCode()
Returns the hash code for this Insets.
|
String |
toString()
Returns a string representation of this
Insets object. |
public static final ViewInsets ZERO_INSETS
public ViewInsets(float top, float left, float bottom, float right)
ViewInsets
object with the
specified top, left, bottom, and right insets.top
- the inset from the top.left
- the inset from the left.bottom
- the inset from the bottom.right
- the inset from the right.public float getTop()
public float getLeft()
public float getBottom()
public float getRight()
public float getLeftRight()
public float getTopBottom()
public boolean equals(Object obj)
ViewInsets
are equal if the four float values
of the fields top
, left
,
bottom
, and right
are all equal.public int hashCode()
public String toString()
Insets
object.
This method is intended to be used only for debugging purposes, and
the content and format of the returned string may vary between
implementations. The returned string may be empty but may not be
null
.