Skip to main content

Gravity

declare class Gravity {}

Gravity

Static Property

NO_GRAVITY

declare class Gravity {
static NO_GRAVITY: number;
}
  • Description

    Constant indicating that no gravity has been set *

AXIS_PULL_BEFORE

declare class Gravity {
static AXIS_PULL_BEFORE: number;
}
  • Description

    Raw bit controlling how the left/top edge is placed.

AXIS_SPECIFIED

declare class Gravity {
static AXIS_SPECIFIED: number;
}
  • Description

    Raw bit indicating the gravity for an axis has been specified.

AXIS_PULL_AFTER

declare class Gravity {
static AXIS_PULL_AFTER: number;
}
  • Description

    Raw bit controlling how the right/bottom edge is placed.

AXIS_CLIP

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

declare class Gravity {
static AXIS_X_SHIFT: number;
}
  • Description

    Bits defining the horizontal axis.

AXIS_Y_SHIFT

declare class Gravity {
static AXIS_Y_SHIFT: number;
}
  • Description

    Bits defining the vertical axis.

TOP

declare class Gravity {
static TOP: number;
}
  • Description

    Push object to the top of its container, not changing its size.

BOTTOM

declare class Gravity {
static BOTTOM: number;
}
  • Description

    Push object to the bottom of its container, not changing its size.

LEFT

declare class Gravity {
static LEFT: number;
}
  • Description

    Push object to the left of its container, not changing its size.

declare class Gravity {
static RIGHT: number;
}
  • Description

    Push object to the right of its container, not changing its size.

CENTER_VERTICAL

declare class Gravity {
static CENTER_VERTICAL: number;
}
  • Description

    Place object in the vertical center of its container, not changing its size.

FILL_VERTICAL

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

declare class Gravity {
static CENTER_HORIZONTAL: number;
}
  • Description

    Place object in the horizontal center of its container, not changing its size.

FILL_HORIZONTAL

declare class Gravity {
static FILL_HORIZONTAL: number;
}
  • Description

    Grow the horizontal size of the object if needed so it completely fills its container.

CENTER

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

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

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

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

declare class Gravity {
static VERTICAL_GRAVITY_MASK: number;
}
  • Description

    Binary mask to get the vertical gravity of a gravity.

DISPLAY_CLIP_VERTICAL

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

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

declare class View {
static convert(type: string, defaultValue?: number): number;
}
  • Description

    Convert string type to gravity type.

convert

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

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

declare class View {
static isVertical(gravity: number): boolean;
}
  • Description

    Indicate whether the supplied gravity has a vertical pull.

isHorizontal

declare class View {
static isHorizontal(gravity: number): boolean;
}
  • Description

    Indicate whether the supplied gravity has an horizontal pull.