diff --git a/mobile/android/base/resources/drawable-hdpi/close_edit_mode.png b/mobile/android/base/resources/drawable-hdpi/close_edit_mode.png
index 70caf842d33e..efb5ab8e7474 100644
Binary files a/mobile/android/base/resources/drawable-hdpi/close_edit_mode.png and b/mobile/android/base/resources/drawable-hdpi/close_edit_mode.png differ
diff --git a/mobile/android/base/resources/drawable-mdpi/close_edit_mode.png b/mobile/android/base/resources/drawable-mdpi/close_edit_mode.png
index 608a80f47210..eda09a3f6b27 100644
Binary files a/mobile/android/base/resources/drawable-mdpi/close_edit_mode.png and b/mobile/android/base/resources/drawable-mdpi/close_edit_mode.png differ
diff --git a/mobile/android/base/resources/drawable-xhdpi/close_edit_mode.png b/mobile/android/base/resources/drawable-xhdpi/close_edit_mode.png
index 4b6f1f34fd46..8fd7a3d1d00f 100644
Binary files a/mobile/android/base/resources/drawable-xhdpi/close_edit_mode.png and b/mobile/android/base/resources/drawable-xhdpi/close_edit_mode.png differ
diff --git a/mobile/android/base/resources/layout/browser_toolbar.xml b/mobile/android/base/resources/layout/browser_toolbar.xml
index 8df7416111da..f07972e98662 100644
--- a/mobile/android/base/resources/layout/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout/browser_toolbar.xml
@@ -22,12 +22,11 @@
+
+ android:visibility="invisible"/>
focusOrder;
- private final View editCancel;
+ private final ImageView editCancel;
private boolean shouldShrinkURLBar = false;
@@ -218,7 +220,7 @@ public class BrowserToolbar extends ThemedRelativeLayout
actionItemBar = (LinearLayout) findViewById(R.id.menu_items);
hasSoftMenuButton = !HardwareUtils.hasMenuButton();
- editCancel = findViewById(R.id.edit_cancel);
+ editCancel = (ImageView) findViewById(R.id.edit_cancel);
// We use different layouts on phones and tablets, so adjust the focus
// order appropriately.
@@ -603,10 +605,9 @@ public class BrowserToolbar extends ThemedRelativeLayout
return 0;
}
- // We would ideally use the right-most point of the edit layout instead of the
- // edit separator and its margin, but it is not inflated when this code initially runs.
- final LayoutParams lp = (LayoutParams) editCancel.getLayoutParams();
- return editCancel.getLeft() - lp.leftMargin - urlBarEntry.getRight();
+ // Subtract the right margin because it's negative.
+ final LayoutParams lp = (LayoutParams) urlEditLayout.getLayoutParams();
+ return urlEditLayout.getRight() - lp.rightMargin - urlBarEntry.getRight();
}
private int getUrlBarCurveTranslation() {
@@ -1102,6 +1103,10 @@ public class BrowserToolbar extends ThemedRelativeLayout
updateProgressVisibility();
+ // The animation looks cleaner if the text in the URL bar is
+ // not selected so clear the selection by clearing focus.
+ urlEditLayout.clearFocus();
+
if (Build.VERSION.SDK_INT < 11) {
stopEditingWithoutAnimation();
} else if (HardwareUtils.isTablet()) {