Bug 808408 - Hide virtual keyboard when interacting with awesomebar lists. r=bnicholson
☠☠ backed out by b4bfe7e32928 ☠ ☠
authorWes Johnston <wjohnston@mozilla.com>
Thu, 15 Nov 2012 19:16:35 -0800
changeset 113468 9f48d082d7d079e51b444c3b863a2fc95c60cc64
parent 113467 acd75423cc39d30ba214d354241bd75d355db5dc
child 113469 fb9a1e6e2710992df1523373b415c973be617dff
push id18166
push userwjohnston@mozilla.com
push dateFri, 16 Nov 2012 03:16:55 +0000
treeherdermozilla-inbound@2d3acb8280f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs808408
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 808408 - Hide virtual keyboard when interacting with awesomebar lists. r=bnicholson
mobile/android/base/AwesomeBarTabs.java
--- a/mobile/android/base/AwesomeBarTabs.java
+++ b/mobile/android/base/AwesomeBarTabs.java
@@ -122,17 +122,17 @@ public class AwesomeBarTabs extends TabH
         mInflated = true;
 
         // This should be called before adding any tabs
         // to the TabHost.
         setup();
 
         mListTouchListener = new View.OnTouchListener() {
             public boolean onTouch(View view, MotionEvent event) {
-                if (event.getAction() == MotionEvent.ACTION_DOWN)
+                if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN)
                     hideSoftInput(view);
                 return false;
             }
         };
 
         mTabs = new AwesomeBarTab[] {
             new AllPagesTab(mContext),
             new BookmarksTab(mContext),
@@ -148,20 +148,22 @@ public class AwesomeBarTabs extends TabH
         mViewPager.setAdapter(mPagerAdapter);
         mViewPager.setCurrentItem(0);
         mViewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
             public void onPageScrollStateChanged(int state) { }
             public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { }
             public void onPageSelected(int position) {
                 tabWidget.setCurrentTab(position);
                 styleSelectedTab();
+                hideSoftInput(mViewPager);
              }
          });
 
         for (int i = 0; i < mTabs.length; i++) {
+            mTabs[i].setListTouchListener(mListTouchListener);
             addAwesomeTab(mTabs[i].getTag(),
                           mTabs[i].getTitleStringId(),
                           i);
         }
 
         tabWidget.setCurrentTab(0);
 
         styleSelectedTab();