Searched refs:gravity (Results 1 - 25 of 141) sorted by relevance

123456

/frameworks/support/compat/src/main/java/androidx/core/view/
H A DGravityCompat.java41 * Binary mask for the horizontal gravity and script specific direction bit.
46 * Apply a gravity constant to an object and take care if layout direction is RTL or not.
48 * @param gravity The desired placement of the object, as defined by the
62 public static void apply(int gravity, int w, int h, Rect container, argument
65 Gravity.apply(gravity, w, h, container, outRect, layoutDirection);
67 Gravity.apply(gravity, w, h, container, outRect);
72 * Apply a gravity constant to an object.
74 * @param gravity The desired placement of the object, as defined by the
81 * @param xAdj Offset to apply to the X axis. If gravity is LEFT this
82 * pushes it to the right; if gravity i
96 apply(int gravity, int w, int h, Rect container, int xAdj, int yAdj, Rect outRect, int layoutDirection) argument
125 applyDisplay(int gravity, Rect display, Rect inoutObj, int layoutDirection) argument
144 getAbsoluteGravity(int gravity, int layoutDirection) argument
[all...]
/frameworks/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/
H A DDrawerLayoutUtil.java42 int gravity = -1;
44 gravity = LEFT;
46 gravity = RIGHT;
48 gravity = START;
50 gravity = END;
52 if (gravity > 0) {
53 openDrawer(drawerLayout, gravity);
57 private static void openDrawer(View drawerLayout, int gravity) { argument
60 gravity);
/frameworks/base/core/java/android/view/
H A DGravity.java26 /** 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. */
90 * Binary mask to get the absolute horizontal gravity of a gravity.
95 * Binary mask to get the vertical gravity of a gravity.
121 * Binary mask for the horizontal gravity and script specific direction bit.
126 * Apply a gravity constant to an object. This supposes that the layout direction is LTR.
128 * @param gravity Th
138 apply(int gravity, int w, int h, Rect container, Rect outRect) argument
159 apply(int gravity, int w, int h, Rect container, Rect outRect, int layoutDirection) argument
186 apply(int gravity, int w, int h, Rect container, int xAdj, int yAdj, Rect outRect) argument
296 apply(int gravity, int w, int h, Rect container, int xAdj, int yAdj, Rect outRect, int layoutDirection) argument
318 applyDisplay(int gravity, Rect display, Rect inoutObj) argument
376 applyDisplay(int gravity, Rect display, Rect inoutObj, int layoutDirection) argument
387 isVertical(int gravity) argument
397 isHorizontal(int gravity) argument
412 getAbsoluteGravity(int gravity, int layoutDirection) argument
447 toString(int gravity) argument
[all...]
/frameworks/base/core/java/android/inputmethodservice/
H A DSoftInputWindow.java69 int windowType, int gravity, boolean takesFocus) {
76 mGravity = gravity;
106 * @param gravity The boundary of the screen to stick. See {#link
111 public void setGravity(int gravity) { argument
113 lp.gravity = gravity;
119 return getWindow().getAttributes().gravity;
123 if (lp.gravity == Gravity.TOP || lp.gravity == Gravity.BOTTOM) {
174 lp.gravity
67 SoftInputWindow(Context context, String name, int theme, Callback callback, KeyEvent.Callback keyEventCallback, KeyEvent.DispatcherState dispatcherState, int windowType, int gravity, boolean takesFocus) argument
[all...]
/frameworks/base/services/tests/servicestests/src/com/android/server/am/
H A DTaskLaunchParamsModifierTests.java126 * Ensures that a task positioned with a {@link WindowLayout} gravity specified is positioned
132 // Unspecified gravity should be ignored
135 // Unsupported gravity should be ignored
150 private void testGravity(int gravity) { argument
153 new WindowLayout(0, 0, 0, 0, gravity, 0, 0), null /*activity*/,
155 assertEquals(mResult.mBounds, getDefaultBounds(gravity));
178 private void testConflict(int gravity) { argument
179 final WindowLayout layout = new WindowLayout(0, 0, 0, 0, gravity, 0, 0);
203 if ((gravity & (Gravity.TOP | Gravity.RIGHT)) == (Gravity.TOP | Gravity.RIGHT)
204 || (gravity
231 getDefaultBounds(int gravity) argument
[all...]
/frameworks/base/core/java/android/widget/
H A DPopupMenu.java65 * gravity.
71 * @param gravity The {@link Gravity} value for aligning the popup with its
74 public PopupMenu(Context context, View anchor, int gravity) { argument
75 this(context, anchor, gravity, R.attr.popupMenuStyle, 0);
85 * @param gravity The {@link Gravity} value for aligning the popup with its
95 public PopupMenu(Context context, View anchor, int gravity, int popupStyleAttr, argument
116 mPopup.setGravity(gravity);
128 * Sets the gravity used to align the popup window to its anchor view.
133 * @param gravity the gravity use
136 setGravity(int gravity) argument
[all...]
H A DFrameLayout.java44 * and control their position within the FrameLayout by assigning gravity to each child, using the
261 layoutChildren(left, top, right, bottom, false /* no force left gravity */);
284 int gravity = lp.gravity;
285 if (gravity == -1) {
286 gravity = DEFAULT_CHILD_GRAVITY;
290 final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, layoutDirection);
291 final int verticalGravity = gravity & Gravity.VERTICAL_GRAVITY_MASK;
421 * Value for {@link #gravity} indicating that a gravity ha
436 public int gravity = UNSPECIFIED_GRAVITY; field in class:FrameLayout.LayoutParams
462 LayoutParams(int width, int height, int gravity) argument
[all...]
/frameworks/support/compat/src/main/java/androidx/core/graphics/drawable/
H A DRoundedBitmapDrawable21.java54 void gravityCompatApply(int gravity, int bitmapWidth, int bitmapHeight, argument
56 Gravity.apply(gravity, bitmapWidth, bitmapHeight,
/frameworks/support/frameworks/support/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/
H A DArcMotionUsage.java60 if ((lp.gravity & Gravity.START) == Gravity.START) {
61 lp.gravity = Gravity.END | Gravity.BOTTOM;
63 lp.gravity = Gravity.START | Gravity.TOP;
/frameworks/support/samples/SupportTransitionDemos/src/main/java/com/example/android/support/transition/widget/
H A DArcMotionUsage.java60 if ((lp.gravity & Gravity.START) == Gravity.START) {
61 lp.gravity = Gravity.END | Gravity.BOTTOM;
63 lp.gravity = Gravity.START | Gravity.TOP;
/frameworks/support/wear/src/main/java/androidx/wear/widget/
H A DBoxInsetLayout.java232 int gravity = lp.gravity;
233 if (gravity == -1) {
234 gravity = DEFAULT_CHILD_GRAVITY;
238 final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, layoutDirection);
239 final int verticalGravity = gravity & Gravity.VERTICAL_GRAVITY_MASK;
240 final int horizontalGravity = gravity & Gravity.HORIZONTAL_GRAVITY_MASK;
243 // If the child's width is match_parent then we can ignore gravity.
264 // If the child's height is match_parent then we can ignore gravity.
304 int gravity
459 LayoutParams(int width, int height, int gravity) argument
464 LayoutParams(int width, int height, int gravity, @BoxedEdges int boxed) argument
[all...]
/frameworks/support/v7/appcompat/src/main/java/androidx/appcompat/widget/
H A DPopupMenu.java73 * gravity.
79 * @param gravity The {@link Gravity} value for aligning the popup with its
82 public PopupMenu(@NonNull Context context, @NonNull View anchor, int gravity) { argument
83 this(context, anchor, gravity, R.attr.popupMenuStyle, 0);
93 * @param gravity The {@link Gravity} value for aligning the popup with its
103 public PopupMenu(@NonNull Context context, @NonNull View anchor, int gravity, argument
124 mPopup.setGravity(gravity);
136 * Sets the gravity used to align the popup window to its anchor view.
141 * @param gravity the gravity use
144 setGravity(int gravity) argument
[all...]
H A DLinearLayoutCompat.java45 * You can also specify gravity, which specifies the alignment of all the child elements by
1063 // Translates the child's vertical gravity into an index
1065 final int gravity = (lp.gravity < 0 ? mGravity : lp.gravity)
1067 final int index = ((gravity >> Gravity.AXIS_Y_SHIFT)
1237 // Translates the child's vertical gravity into an index in the range 0..2
1238 final int gravity = (lp.gravity < 0 ? mGravity : lp.gravity)
1678 setGravity(int gravity) argument
1783 public int gravity = -1; field in class:LinearLayoutCompat.LayoutParams
[all...]
/frameworks/support/percent/src/main/java/androidx/percentlayout/widget/
H A DPercentFrameLayout.java190 public LayoutParams(int width, int height, int gravity) { argument
191 super(width, height, gravity);
204 gravity = source.gravity;
/frameworks/base/core/java/android/app/
H A DActionBar.java1373 public int gravity = Gravity.NO_GRAVITY; field in class:ActionBar.LayoutParams
1380 gravity = a.getInt(
1388 this.gravity = Gravity.CENTER_VERTICAL | Gravity.START;
1391 public LayoutParams(int width, int height, int gravity) { argument
1394 this.gravity = gravity;
1397 public LayoutParams(int gravity) { argument
1398 this(WRAP_CONTENT, MATCH_PARENT, gravity);
1403 this.gravity = source.gravity;
[all...]
/frameworks/support/v7/appcompat/src/main/java/androidx/appcompat/app/
H A DActionBar.java1374 public int gravity = Gravity.NO_GRAVITY; field in class:ActionBar.LayoutParams
1380 gravity = a.getInt(R.styleable.ActionBarLayout_android_layout_gravity, Gravity.NO_GRAVITY);
1386 this.gravity = Gravity.CENTER_VERTICAL | GravityCompat.START;
1389 public LayoutParams(int width, int height, int gravity) { argument
1391 this.gravity = gravity;
1394 public LayoutParams(int gravity) { argument
1395 this(WRAP_CONTENT, MATCH_PARENT, gravity);
1401 this.gravity = source.gravity;
[all...]
/frameworks/base/test-runner/src/android/test/
H A DTouchUtils.java484 * Get the location of a view. Use the gravity param to specify which part of the view to
488 * @param gravity A combination of (TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL,
492 private static void getStartLocation(View v, int gravity, int[] xy) { argument
498 switch (gravity & Gravity.VERTICAL_GRAVITY_MASK) {
511 switch (gravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
530 * @param gravity Which part of the view to use for the initial down event. A combination of
542 public static int dragViewBy(ActivityInstrumentationTestCase test, View v, int gravity, argument
544 return dragViewBy((InstrumentationTestCase) test, v, gravity, deltaX, deltaY);
552 * @param gravity Which part of the view to use for the initial down event. A combination of
564 public static int dragViewBy(InstrumentationTestCase test, View v, int gravity, in argument
597 dragViewTo(ActivityInstrumentationTestCase test, View v, int gravity, int toX, int toY) argument
614 dragViewTo(InstrumentationTestCase test, View v, int gravity, int toX, int toY) argument
648 dragViewToX(ActivityInstrumentationTestCase test, View v, int gravity, int toX) argument
664 dragViewToX(InstrumentationTestCase test, View v, int gravity, int toX) argument
695 dragViewToY(ActivityInstrumentationTestCase test, View v, int gravity, int toY) argument
711 dragViewToY(InstrumentationTestCase test, View v, int gravity, int toY) argument
[all...]
/frameworks/base/core/java/android/view/autofill/
H A DAutofillPopupWindow.java128 // Note that we cannot easily change default gravity from Gravity.TOP to
248 int xOffset, int yOffset, int width, int height, int gravity, boolean allowScroll) {
255 outParams.gravity = gravity;
259 width, height, gravity, allowScroll);
263 public void showAsDropDown(View anchor, int xoff, int yoff, int gravity) { argument
274 attachToAnchor(anchor, xoff, yoff, gravity);
278 p.width, p.height, gravity, getAllowScrollingAnchorParent());
287 protected void attachToAnchor(View anchor, int xoff, int yoff, int gravity) { argument
288 super.attachToAnchor(anchor, xoff, yoff, gravity);
247 findDropDownPosition(View anchor, LayoutParams outParams, int xOffset, int yOffset, int width, int height, int gravity, boolean allowScroll) argument
[all...]
/frameworks/support/v7/recyclerview/src/androidTest/java/androidx/recyclerview/widget/
H A DTouchUtils.java186 private static void getStartLocation(View v, int gravity, int[] xy) { argument
192 switch (gravity & Gravity.VERTICAL_GRAVITY_MASK) {
205 switch (gravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
219 public static int dragViewTo(Instrumentation inst, View v, int gravity, int toX, argument
223 getStartLocation(v, gravity, xy);
237 public static int dragViewToX(Instrumentation inst, View v, int gravity, int toX) { argument
240 getStartLocation(v, gravity, xy);
252 public static int dragViewToY(Instrumentation inst, View v, int gravity, int toY) { argument
255 getStartLocation(v, gravity, xy);
/frameworks/base/packages/SystemUI/src/com/android/systemui/
H A DHardwareUiLayout.java202 p.gravity = rotateGravityRight(p.gravity);
214 private int rotateGravityRight(int gravity) { argument
217 final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, layoutDirection);
218 final int verticalGravity = gravity & Gravity.VERTICAL_GRAVITY_MASK;
254 p.gravity = rotateGravityLeft(p.gravity);
258 private int rotateGravityLeft(int gravity) { argument
259 if (gravity == -1) {
260 gravity
[all...]
/frameworks/support/compat/src/main/java/androidx/core/widget/
H A DPopupWindowCompat.java64 * @param gravity Alignment of the popup relative to the anchor
67 int xoff, int yoff, int gravity) {
69 popup.showAsDropDown(anchor, xoff, yoff, gravity);
72 final int hgrav = GravityCompat.getAbsoluteGravity(gravity,
66 showAsDropDown(@onNull PopupWindow popup, @NonNull View anchor, int xoff, int yoff, int gravity) argument
/frameworks/support/drawerlayout/src/main/java/androidx/drawerlayout/widget/
H A DDrawerLayout.java238 /** Shadow drawables for different gravity */
420 * defined with a resource qualifier "ldrtl" for API 17 and above with the gravity
425 * @param gravity Which drawer the shadow should apply to
427 public void setDrawerShadow(Drawable shadowDrawable, @EdgeGravity int gravity) { argument
437 if ((gravity & GravityCompat.START) == GravityCompat.START) {
439 } else if ((gravity & GravityCompat.END) == GravityCompat.END) {
441 } else if ((gravity & Gravity.LEFT) == Gravity.LEFT) {
443 } else if ((gravity & Gravity.RIGHT) == Gravity.RIGHT) {
459 * defined with a resource qualifier "ldrtl" for API 17 and above with the gravity
464 * @param gravity Whic
466 setDrawerShadow(@rawableRes int resId, @EdgeGravity int gravity) argument
986 findDrawerWithGravity(int gravity) argument
1006 gravityToString(@dgeGravity int gravity) argument
1723 openDrawer(@dgeGravity int gravity) argument
1734 openDrawer(@dgeGravity int gravity, boolean animate) argument
1790 closeDrawer(@dgeGravity int gravity) argument
1801 closeDrawer(@dgeGravity int gravity, boolean animate) argument
2154 ViewDragCallback(int gravity) argument
2315 public int gravity = Gravity.NO_GRAVITY; field in class:DrawerLayout.LayoutParams
2332 LayoutParams(int width, int height, int gravity) argument
[all...]
/frameworks/support/frameworks/support/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/
H A DToolbarDisplayOptions.java99 switch (lp.gravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
110 lp.gravity = lp.gravity & ~Gravity.HORIZONTAL_GRAVITY_MASK | newGravity;
/frameworks/support/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/
H A DToolbarDisplayOptions.java99 switch (lp.gravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
110 lp.gravity = lp.gravity & ~Gravity.HORIZONTAL_GRAVITY_MASK | newGravity;
/frameworks/base/tests/GridLayoutTest/src/com/android/test/layout/
H A DLinearLayoutTest.java37 lp.gravity = va | ha;

Completed in 491 milliseconds

123456