From b52d7a601ae0abb9c0fc3df76c8e23693e51c412 Mon Sep 17 00:00:00 2001 From: Brian Nicholson Date: Thu, 21 Jun 2012 11:44:35 -0700 Subject: [PATCH] Bug 763396 - Dismiss keyboard when showing tabs tray. r=mfinkle --- mobile/android/base/BrowserToolbar.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mobile/android/base/BrowserToolbar.java b/mobile/android/base/BrowserToolbar.java index 21b0b52e354..bb1d33edd06 100644 --- a/mobile/android/base/BrowserToolbar.java +++ b/mobile/android/base/BrowserToolbar.java @@ -24,6 +24,7 @@ import android.util.AttributeSet; import android.util.DisplayMetrics; import android.util.Log; import android.view.animation.TranslateAnimation; +import android.view.inputmethod.InputMethodManager; import android.view.ContextMenu; import android.view.Gravity; import android.view.LayoutInflater; @@ -327,10 +328,15 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory, } private void toggleTabs() { - if (GeckoApp.mAppContext.areTabsShown()) + if (GeckoApp.mAppContext.areTabsShown()) { GeckoApp.mAppContext.hideTabs(); - else + } else { + // hide the virtual keyboard + InputMethodManager imm = + (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(mTabs.getWindowToken(), 0); GeckoApp.mAppContext.showLocalTabs(); + } } public void updateTabCountAndAnimate(int count) {