Home | History | Annotate | Download | only in view

Lines Matching defs:Gravity

24 public class Gravity
26 /** Constant indicating that no gravity has been set **/
29 /** Raw bit indicating the gravity for an axis has been specified. */
37 * container, based on the gravity direction being applied. */
85 * Binary mask to get the horizontal gravity of a gravity.
90 * Binary mask to get the vertical gravity of a gravity.
110 * Apply a gravity constant to an object.
112 * @param gravity The desired placement of the object, as defined by the
122 public static void apply(int gravity, int w, int h, Rect container,
124 apply(gravity, w, h, container, 0, 0, outRect);
128 * Apply a gravity constant to an object.
130 * @param gravity The desired placement of the object, as defined by the
137 * @param xAdj Offset to apply to the X axis. If gravity is LEFT this
138 * pushes it to the right; if gravity is RIGHT it pushes it to
139 * the left; if gravity is CENTER_HORIZONTAL it pushes it to the
141 * @param yAdj Offset to apply to the Y axis. If gravity is TOP this pushes
142 * it down; if gravity is BOTTOM it pushes it up; if gravity is
148 public static void apply(int gravity, int w, int h, Rect container,
150 switch (gravity&((AXIS_PULL_BEFORE|AXIS_PULL_AFTER)<<AXIS_X_SHIFT)) {
155 if ((gravity&(AXIS_CLIP<<AXIS_X_SHIFT))
168 if ((gravity&(AXIS_CLIP<<AXIS_X_SHIFT))
178 if ((gravity&(AXIS_CLIP<<AXIS_X_SHIFT))
191 switch (gravity&((AXIS_PULL_BEFORE|AXIS_PULL_AFTER)<<AXIS_Y_SHIFT)) {
196 if ((gravity&(AXIS_CLIP<<AXIS_Y_SHIFT))
209 if ((gravity&(AXIS_CLIP<<AXIS_Y_SHIFT))
219 if ((gravity&(AXIS_CLIP<<AXIS_Y_SHIFT))
234 * Apply additional gravity behavior based on the overall "display" that an
238 * to be visible in the display; the gravity flags
242 * @param gravity Gravity constants to modify the placement within the
249 public static void applyDisplay(int gravity, Rect display, Rect inoutObj) {
250 if ((gravity&DISPLAY_CLIP_VERTICAL) != 0) {
268 if ((gravity&DISPLAY_CLIP_HORIZONTAL) != 0) {
288 * <p>Indicate whether the supplied gravity has a vertical pull.</p>
290 * @param gravity the gravity to check for vertical pull
291 * @return true if the supplied gravity has a vertical pull
293 public static boolean isVertical(int gravity) {
294 return gravity > 0 && (gravity & VERTICAL_GRAVITY_MASK) != 0;
298 * <p>Indicate whether the supplied gravity has an horizontal pull.</p>
300 * @param gravity the gravity to check for horizontal pull
301 * @return true if the supplied gravity has an horizontal pull
303 public static boolean isHorizontal(int gravity) {
304 return gravity > 0 && (gravity & HORIZONTAL_GRAVITY_MASK) != 0;