mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Bug 743158 - Take focus away from awesome bar when accessing awesome screen lists. r=wesj
This commit is contained in:
parent
5e0ee32176
commit
a1f1d83c09
@ -132,8 +132,10 @@ public class AwesomeBarTabs extends TabHost
|
||||
mListTouchListener = new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent event) {
|
||||
if (event.getActionMasked() == MotionEvent.ACTION_DOWN)
|
||||
hideSoftInput(view);
|
||||
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
|
||||
// take focus away from awesome bar to hide the keyboard
|
||||
requestFocus();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@ -161,7 +163,8 @@ public class AwesomeBarTabs extends TabHost
|
||||
public void onPageSelected(int position) {
|
||||
tabWidget.setCurrentTab(position);
|
||||
styleSelectedTab();
|
||||
hideSoftInput(mViewPager);
|
||||
// take focus away from awesome bar to hide the keyboard
|
||||
requestFocus();
|
||||
}
|
||||
});
|
||||
|
||||
@ -276,13 +279,6 @@ public class AwesomeBarTabs extends TabHost
|
||||
return indicatorView;
|
||||
}
|
||||
|
||||
private boolean hideSoftInput(View view) {
|
||||
InputMethodManager imm =
|
||||
(InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
|
||||
return imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
}
|
||||
|
||||
public void setOnUrlOpenListener(OnUrlOpenListener listener) {
|
||||
mUrlOpenListener = listener;
|
||||
for (AwesomeBarTab tab : mTabs) {
|
||||
|
@ -6,7 +6,9 @@
|
||||
<org.mozilla.gecko.AwesomeBarTabs xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/awesomebar_tabs"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
android:layout_height="fill_parent"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true">
|
||||
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
|
Loading…
Reference in New Issue
Block a user