Java android.view Gravity fields, constructors, methods, implement or subclass

Example usage for Java android.view Gravity fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.view Gravity.

The text is from its open source code.

Field

intNO_GRAVITY
Constant indicating that no gravity has been set
intAXIS_SPECIFIED
Raw bit indicating the gravity for an axis has been specified.
intAXIS_Y_SHIFT
Bits defining the vertical axis.
intTOP
Push object to the top of its container, not changing its size.
intBOTTOM
Push object to the bottom of its container, not changing its size.
intLEFT
Push object to the left of its container, not changing its size.
intRIGHT
Push object to the right of its container, not changing its size.
intCENTER_VERTICAL
Place object in the vertical center of its container, not changing its size.
intFILL_VERTICAL
Grow the vertical size of the object if needed so it completely fills its container.
intCENTER_HORIZONTAL
Place object in the horizontal center of its container, not changing its size.
intFILL_HORIZONTAL
Grow the horizontal size of the object if needed so it completely fills its container.
intCENTER
Place the object in the center of its container in both the vertical and horizontal axis, not changing its size.
intFILL
Grow the horizontal and vertical size of the object if needed so it completely fills its container.
intCLIP_VERTICAL
Flag to clip the edges of the object to its container along the vertical axis.
intHORIZONTAL_GRAVITY_MASK
Binary mask to get the absolute horizontal gravity of a gravity.
intVERTICAL_GRAVITY_MASK
Binary mask to get the vertical gravity of a gravity.
intSTART
Push object to x-axis position at the start of its container, not changing its size.
intEND
Push object to x-axis position at the end of its container, not changing its size.
intRELATIVE_HORIZONTAL_GRAVITY_MASK
Binary mask for the horizontal gravity and script specific direction bit.

Method

intgetAbsoluteGravity(int gravity, int layoutDirection)

Convert script specific gravity to absolute horizontal value.

if horizontal direction is LTR, then START will set LEFT and END will set RIGHT.
booleanisHorizontal(int gravity)

Indicate whether the supplied gravity has an horizontal pull.

booleanisVertical(int gravity)

Indicate whether the supplied gravity has a vertical pull.