Skip to content

Commit 85d28a0

Browse files
Fabrice Di MeglioAndroid (Google) Code Review
authored andcommitted
Merge "Replace left/right with start/end for Gravity / LayoutParams / Padding"
2 parents b6a45cb + aac0d4e commit 85d28a0

File tree

180 files changed

+893
-893
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+893
-893
lines changed

core/java/android/service/wallpaper/WallpaperService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ void updateSurface(boolean forceRelayout, boolean forceReport, boolean redrawNee
607607

608608
if (!mCreated) {
609609
mLayout.type = mIWallpaperEngine.mWindowType;
610-
mLayout.gravity = Gravity.LEFT|Gravity.TOP;
610+
mLayout.gravity = Gravity.START|Gravity.TOP;
611611
mLayout.setTitle(WallpaperService.this.getClass().getName());
612612
mLayout.windowAnimations =
613613
com.android.internal.R.style.Animation_Wallpaper;

core/java/android/view/SurfaceView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ private void updateWindow(boolean force, boolean redrawNeeded) {
458458
if (mWindow == null) {
459459
mWindow = new MyWindow(this);
460460
mLayout.type = mWindowType;
461-
mLayout.gravity = Gravity.LEFT|Gravity.TOP;
461+
mLayout.gravity = Gravity.START|Gravity.TOP;
462462
mSession.addWithoutInputChannel(mWindow, mWindow.mSeq, mLayout,
463463
mVisible ? VISIBLE : GONE, mContentInsets);
464464
}

core/java/android/webkit/ZoomControlEmbedded.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private ZoomButtonsController getControls() {
9090
View controls = mZoomButtonsController.getZoomControls();
9191
ViewGroup.LayoutParams params = controls.getLayoutParams();
9292
if (params instanceof FrameLayout.LayoutParams) {
93-
((FrameLayout.LayoutParams) params).gravity = Gravity.RIGHT;
93+
((FrameLayout.LayoutParams) params).gravity = Gravity.END;
9494
}
9595
}
9696
return mZoomButtonsController;

core/java/android/widget/FrameLayout.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
*/
5656
@RemoteView
5757
public class FrameLayout extends ViewGroup {
58-
private static final int DEFAULT_CHILD_GRAVITY = Gravity.TOP | Gravity.LEFT;
58+
private static final int DEFAULT_CHILD_GRAVITY = Gravity.TOP | Gravity.START;
5959

6060
@ViewDebug.ExportedProperty(category = "measurement")
6161
boolean mMeasureAllChildren = false;

core/java/android/widget/PopupWindow.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ public void showAtLocation(IBinder token, int gravity, int x, int y) {
835835

836836
preparePopup(p);
837837
if (gravity == Gravity.NO_GRAVITY) {
838-
gravity = Gravity.TOP | Gravity.LEFT;
838+
gravity = Gravity.TOP | Gravity.START;
839839
}
840840
p.gravity = gravity;
841841
p.x = x;
@@ -1003,7 +1003,7 @@ private WindowManager.LayoutParams createPopupLayout(IBinder token) {
10031003
// screen. The view is then positioned to the appropriate location
10041004
// by setting the x and y offsets to match the anchor's bottom
10051005
// left corner
1006-
p.gravity = Gravity.LEFT | Gravity.TOP;
1006+
p.gravity = Gravity.START | Gravity.TOP;
10071007
p.width = mLastWidth = mWidth;
10081008
p.height = mLastHeight = mHeight;
10091009
if (mBackground != null) {
@@ -1100,7 +1100,7 @@ private boolean findDropDownPosition(View anchor, WindowManager.LayoutParams p,
11001100

11011101
boolean onTop = false;
11021102

1103-
p.gravity = Gravity.LEFT | Gravity.TOP;
1103+
p.gravity = Gravity.START | Gravity.TOP;
11041104

11051105
anchor.getLocationOnScreen(mScreenLocation);
11061106
final Rect displayFrame = new Rect();
@@ -1134,7 +1134,7 @@ private boolean findDropDownPosition(View anchor, WindowManager.LayoutParams p,
11341134
onTop = (displayFrame.bottom - mScreenLocation[1] - anchor.getHeight() - yoff) <
11351135
(mScreenLocation[1] - yoff - displayFrame.top);
11361136
if (onTop) {
1137-
p.gravity = Gravity.LEFT | Gravity.BOTTOM;
1137+
p.gravity = Gravity.START | Gravity.BOTTOM;
11381138
p.y = root.getHeight() - mDrawingLocation[1] + yoff;
11391139
} else {
11401140
p.y = mDrawingLocation[1] + anchor.getHeight() + yoff;

core/java/android/widget/ProgressBar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ private Drawable tileify(Drawable drawable, boolean clip) {
354354
Shader.TileMode.REPEAT, Shader.TileMode.CLAMP);
355355
shapeDrawable.getPaint().setShader(bitmapShader);
356356

357-
return (clip) ? new ClipDrawable(shapeDrawable, Gravity.LEFT,
357+
return (clip) ? new ClipDrawable(shapeDrawable, Gravity.START,
358358
ClipDrawable.HORIZONTAL) : shapeDrawable;
359359
}
360360

core/java/android/widget/ZoomButtonsController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public void setZoomSpeed(long speed) {
242242
private FrameLayout createContainer() {
243243
LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
244244
// Controls are positioned BOTTOM | CENTER with respect to the owner view.
245-
lp.gravity = Gravity.TOP | Gravity.LEFT;
245+
lp.gravity = Gravity.TOP | Gravity.START;
246246
lp.flags = LayoutParams.FLAG_NOT_TOUCHABLE |
247247
LayoutParams.FLAG_NOT_FOCUSABLE |
248248
LayoutParams.FLAG_LAYOUT_NO_LIMITS |

core/java/com/android/internal/view/menu/ActionMenuItemView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public boolean onLongClick(View v) {
209209
Toast cheatSheet = Toast.makeText(context, mItemData.getTitle(), Toast.LENGTH_SHORT);
210210
if (midy < displayFrame.height()) {
211211
// Show along the top; follow action buttons
212-
cheatSheet.setGravity(Gravity.TOP | Gravity.RIGHT,
212+
cheatSheet.setGravity(Gravity.TOP | Gravity.END,
213213
screenWidth - screenPos[0] - width / 2, height);
214214
} else {
215215
// Show along the bottom center

core/java/com/android/internal/view/menu/IconMenuItemView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ private void positionIcon() {
282282
getLineBounds(0, tmpRect);
283283
mPositionIconAvailable.set(0, 0, getWidth(), tmpRect.top);
284284
final int layoutDirection = getResolvedLayoutDirection();
285-
Gravity.apply(Gravity.CENTER_VERTICAL | Gravity.LEFT, mIcon.getIntrinsicWidth(), mIcon
285+
Gravity.apply(Gravity.CENTER_VERTICAL | Gravity.START, mIcon.getIntrinsicWidth(), mIcon
286286
.getIntrinsicHeight(), mPositionIconAvailable, mPositionIconOutput,
287287
layoutDirection);
288288
mIcon.setBounds(mPositionIconOutput);

core/java/com/android/internal/widget/ScrollingTabContainerView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ public TabView(Context context, ActionBar.Tab tab, boolean forList) {
363363
mTab = tab;
364364

365365
if (forList) {
366-
setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
366+
setGravity(Gravity.START | Gravity.CENTER_VERTICAL);
367367
}
368368

369369
update();

0 commit comments

Comments
 (0)