GravityCompatpublic class GravityCompat extends Object Compatibility shim for accessing newer functionality from {@link android.view.Gravity}. |
Fields Summary |
---|
static final GravityCompatImpl | IMPL | public static final int | RELATIVE_LAYOUT_DIRECTIONRaw bit controlling whether the layout direction is relative or not (START/END instead of
absolute LEFT/RIGHT). | public static final int | STARTPush object to x-axis position at the start of its container, not changing its size. | public static final int | ENDPush object to x-axis position at the end of its container, not changing its size. | public static final int | RELATIVE_HORIZONTAL_GRAVITY_MASKBinary mask for the horizontal gravity and script specific direction bit. |
Methods Summary |
---|
public static void | apply(int gravity, int w, int h, android.graphics.Rect container, android.graphics.Rect outRect, int layoutDirection)Apply a gravity constant to an object and take care if layout direction is RTL or not.
IMPL.apply(gravity, w, h, container, outRect, layoutDirection);
| public static void | apply(int gravity, int w, int h, android.graphics.Rect container, int xAdj, int yAdj, android.graphics.Rect outRect, int layoutDirection)Apply a gravity constant to an object.
IMPL.apply(gravity, w, h, container, xAdj, yAdj, outRect, layoutDirection);
| public static void | applyDisplay(int gravity, android.graphics.Rect display, android.graphics.Rect inoutObj, int layoutDirection)Apply additional gravity behavior based on the overall "display" that an
object exists in. This can be used after
{@link android.view.Gravity#apply(int, int, int, Rect, int, int, Rect)} to place the object
within a visible display. By default this moves or clips the object
to be visible in the display; the gravity flags
{@link android.view.Gravity#DISPLAY_CLIP_HORIZONTAL} and
{@link android.view.Gravity#DISPLAY_CLIP_VERTICAL} can be used to change this behavior.
IMPL.applyDisplay(gravity, display, inoutObj, layoutDirection);
| public static int | getAbsoluteGravity(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.
if horizontal direction is RTL, then START will set RIGHT and END will set LEFT.
return IMPL.getAbsoluteGravity(gravity, layoutDirection);
|
|