Gravity
declare class Gravity {}
Gravity
Static Property
NO_GRAVITY
Type
declare class Gravity {
static NO_GRAVITY: number;
}
Description
Constant indicating that no gravity has been set *
AXIS_PULL_BEFORE
Type
declare class Gravity {
static AXIS_PULL_BEFORE: number;
}
Description
Raw bit controlling how the left/top edge is placed.
AXIS_SPECIFIED
Type
declare class Gravity {
static AXIS_SPECIFIED: number;
}
Description
Raw bit indicating the gravity for an axis has been specified.
AXIS_PULL_AFTER
Type
declare class Gravity {
static AXIS_PULL_AFTER: number;
}
Description
Raw bit controlling how the right/bottom edge is placed.
AXIS_CLIP
Type
declare class Gravity {
static AXIS_CLIP: number;
}
Description
Raw bit controlling whether the right/bottom edge is clipped to its container, based on the gravity direction being applied.
AXIS_X_SHIFT
Type
declare class Gravity {
static AXIS_X_SHIFT: number;
}
Description
Bits defining the horizontal axis.
AXIS_Y_SHIFT
Type
declare class Gravity {
static AXIS_Y_SHIFT: number;
}
Description
Bits defining the vertical axis.
TOP
Type
declare class Gravity {
static TOP: number;
}
Description
Push object to the top of its container, not changing its size.
BOTTOM
Type
declare class Gravity {
static BOTTOM: number;
}
Description
Push object to the bottom of its container, not changing its size.
LEFT
Type
declare class Gravity {
static LEFT: number;
}
Description
Push object to the left of its container, not changing its size.
RIGHT
Type
declare class Gravity {
static RIGHT: number;
}
Description
Push object to the right of its container, not changing its size.
CENTER_VERTICAL
Type
declare class Gravity {
static CENTER_VERTICAL: number;
}
Description
Place object in the vertical center of its container, not changing its size.
FILL_VERTICAL
Type
declare class Gravity {
static FILL_VERTICAL: number;
}
Description
Grow the vertical size of the object if needed so it completely fills its container.
CENTER_HORIZONTAL
Type
declare class Gravity {
static CENTER_HORIZONTAL: number;
}
Description
Place object in the horizontal center of its container, not changing its size.
FILL_HORIZONTAL
Type
declare class Gravity {
static FILL_HORIZONTAL: number;
}
Description
Grow the horizontal size of the object if needed so it completely fills its container.
CENTER
Type
declare class Gravity {
static CENTER: number;
}
Description
Place the object in the center of its container in both the vertical and horizontal axis, not changing its size.
FILL
Type
declare class Gravity {
static FILL: number;
}
Description
Grow the horizontal and vertical size of the object if needed so it completely fills its container.
CLIP_VERTICAL
Type
declare class Gravity {
static CLIP_VERTICAL: number;
}
Description
Flag to clip the edges of the object to its container along the vertical axis.
CLIP_HORIZONTAL
Type
declare class Gravity {
static CLIP_HORIZONTAL: number;
}
Description
Flag to clip the edges of the object to its container along the horizontal axis.
VERTICAL_GRAVITY_MASK
Type
declare class Gravity {
static VERTICAL_GRAVITY_MASK: number;
}
Description
Binary mask to get the vertical gravity of a gravity.
DISPLAY_CLIP_VERTICAL
Type
declare class Gravity {
static DISPLAY_CLIP_VERTICAL: number;
}
Description
Special constant to enable clipping to an overall display along the vertical dimension.
DISPLAY_CLIP_HORIZONTAL
Type
declare class Gravity {
static DISPLAY_CLIP_HORIZONTAL: number;
}
Description
Special constant to enable clipping to an overall display along the horizontal dimension.
Static Method
convert
Signature
declare class View {
static convert(type: string, defaultValue?: number): number;
}
Description
Convert string type to gravity type.
convert
Signature
declare class View {
apply(gravity: number, w: number, h: number, container: Rect, outRect: Rect): void;
apply(gravity: number, w: number, h: number, container: Rect, xAdj: number, yAdj: number, outRect: Rect): void;
}
Description
Apply a gravity constant to an object.
applyDisplay
Signature
declare class View {
static applyDisplay(gravity: number, display: Rect, inoutObj: Rect): void;
}
Description
Apply additional gravity behavior based on the overall "display" that an object exists in.
isVertical
Signature
declare class View {
static isVertical(gravity: number): boolean;
}
Description
Indicate whether the supplied gravity has a vertical pull.
isHorizontal
Signature
declare class View {
static isHorizontal(gravity: number): boolean;
}
Description
Indicate whether the supplied gravity has an horizontal pull.