From 8e768a61d95de9d99d03ad8615b3650eed40b261 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Tue, 4 Nov 2014 04:02:02 -0800 Subject: [PATCH] Bug 1086981 - Part 5: Cancel editing mode when pressing the tabs panel button. r=lucasr --- mobile/android/base/BrowserApp.java | 4 ++++ mobile/android/base/toolbar/BrowserToolbar.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index 2c64350846e..f9dd2749fdd 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -1729,6 +1729,10 @@ public class BrowserApp extends GeckoApp if (!areTabsShown()) { mTabsPanel.setVisibility(View.INVISIBLE); mTabsPanel.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS); + } else { + // Cancel editing mode to return to page content when the TabsPanel closes. We cancel + // it here because there are graphical glitches if it's canceled while it's visible. + mBrowserToolbar.cancelEdit(); } mTabsPanel.finishTabsAnimation(); diff --git a/mobile/android/base/toolbar/BrowserToolbar.java b/mobile/android/base/toolbar/BrowserToolbar.java index 7e9b270da04..68648c98fdd 100644 --- a/mobile/android/base/toolbar/BrowserToolbar.java +++ b/mobile/android/base/toolbar/BrowserToolbar.java @@ -315,6 +315,10 @@ public abstract class BrowserToolbar extends ThemedRelativeLayout tabsButton.setOnClickListener(new Button.OnClickListener() { @Override public void onClick(View v) { + // Clear focus so a back press with the tabs + // panel open does not go to the editing field. + urlEditLayout.clearFocus(); + toggleTabs(); } });