|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.view.Gravity
public class Gravity
Standard constants and tools for placing an object within a potentially larger container.
| Field Summary | |
|---|---|
static int |
AXIS_PULL_AFTER
Raw bit controlling how the right/bottom edge is placed. |
static int |
AXIS_PULL_BEFORE
Raw bit controlling how the left/top edge is placed. |
static int |
AXIS_SPECIFIED
Raw bit indicating the gravity for an axis has been specified. |
static int |
AXIS_X_SHIFT
Bits defining the horizontal axis. |
static int |
AXIS_Y_SHIFT
Bits defining the vertical axis. |
static int |
BOTTOM
Push object to the bottom of its container, not changing its size. |
static int |
CENTER
Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. |
static int |
CENTER_HORIZONTAL
Place object in the horizontal center of its container, not changing its size. |
static int |
CENTER_VERTICAL
Place object in the vertical center of its container, not changing its size. |
static int |
FILL
Grow the horizontal and vertical size of the obejct if needed so it completely fills its container. |
static int |
FILL_HORIZONTAL
Grow the horizontal size of the object if needed so it completely fills its container. |
static int |
FILL_VERTICAL
Grow the vertical size of the object if needed so it completely fills its container. |
static int |
HORIZONTAL_GRAVITY_MASK
Binary mask to get the horizontal gravity of a gravity. |
static int |
LEFT
Push object to the left of its container, not changing its size. |
static int |
NO_GRAVITY
Contstant indicating that no gravity has been set |
static int |
RIGHT
Push object to the right of its container, not changing its size. |
static int |
TOP
Push object to the top of its container, not changing its size. |
static int |
VERTICAL_GRAVITY_MASK
Binary mask to get the vertical gravity of a gravity. |
| Constructor Summary | |
|---|---|
Gravity()
|
|
| Method Summary | |
|---|---|
static void |
apply(int gravity,
int w,
int h,
Rect container,
int xAdj,
int yAdj,
Rect outRect)
Apply a gravity constant to an object. |
static void |
apply(int gravity,
int w,
int h,
Rect container,
Rect outRect)
Apply a gravity constant to an object. |
static boolean |
isHorizontal(int gravity)
Indicate whether the supplied gravity has an horizontal pull. |
static boolean |
isVertical(int gravity)
Indicate whether the supplied gravity has a vertical pull. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_GRAVITY
public static final int AXIS_SPECIFIED
public static final int AXIS_PULL_BEFORE
public static final int AXIS_PULL_AFTER
public static final int AXIS_X_SHIFT
public static final int AXIS_Y_SHIFT
public static final int TOP
public static final int BOTTOM
public static final int LEFT
public static final int RIGHT
public static final int CENTER_VERTICAL
public static final int FILL_VERTICAL
public static final int CENTER_HORIZONTAL
public static final int FILL_HORIZONTAL
public static final int CENTER
public static final int FILL
public static final int HORIZONTAL_GRAVITY_MASK
public static final int VERTICAL_GRAVITY_MASK
| Constructor Detail |
|---|
public Gravity()
| Method Detail |
|---|
public static void apply(int gravity,
int w,
int h,
Rect container,
Rect outRect)
gravity - The desired placement of the object, as defined by the
constants in this class.w - The horizontal size of the object.h - The vertical size of the object.container - The frame of the containing space, in which the object
will be placed. Should be large enough to contain the
width and height of the object.outRect - Receives the computed frame of the object in its
container.
public static void apply(int gravity,
int w,
int h,
Rect container,
int xAdj,
int yAdj,
Rect outRect)
gravity - The desired placement of the object, as defined by the
constants in this class.w - The horizontal size of the object.h - The vertical size of the object.container - The frame of the containing space, in which the object
will be placed. Should be large enough to contain the
width and height of the object.xAdj - Offset to apply to the X axis. If gravity is LEFT this
pushes it to the right; if gravity is RIGHT it pushes it to
the left; if gravity is CENTER_HORIZONTAL it pushes it to the
right or left; otherwise it is ignored.yAdj - Offset to apply to the Y axis. If gravity is TOP this pushes
it down; if gravity is BOTTOM it pushes it up; if gravity is
CENTER_VERTICAL it pushes it down or up; otherwise it is
ignored.outRect - Receives the computed frame of the object in its
container.public static boolean isVertical(int gravity)
Indicate whether the supplied gravity has a vertical pull.
gravity - the gravity to check for vertical pull
public static boolean isHorizontal(int gravity)
Indicate whether the supplied gravity has an horizontal pull.
gravity - the gravity to check for horizontal pull
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||