Bug 1086981 - Part 5: Cancel editing mode when pressing the tabs panel button. r=lucasr

This commit is contained in:
Michael Comella 2014-11-04 04:02:02 -08:00
parent 81a418c391
commit 8e768a61d9
2 changed files with 8 additions and 0 deletions

View File

@ -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();

View File

@ -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();
}
});