mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 750511 - Hide soft keyboard when user touches outside awesomebar. r=mfinkle
This commit is contained in:
parent
83a556e6f2
commit
b697cb48ba
@ -202,15 +202,6 @@ public class AwesomeBar extends GeckoActivity implements GeckoEventListener {
|
||||
}
|
||||
});
|
||||
|
||||
mText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (!hasFocus) {
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
registerForContextMenu(mAwesomeTabs.findViewById(R.id.all_pages_list));
|
||||
registerForContextMenu(mAwesomeTabs.findViewById(R.id.bookmarks_list));
|
||||
registerForContextMenu(mAwesomeTabs.findViewById(R.id.history_list));
|
||||
|
@ -67,7 +67,6 @@ public class AwesomeBarTabs extends TabHost {
|
||||
private boolean mInflated;
|
||||
private LayoutInflater mInflater;
|
||||
private OnUrlOpenListener mUrlOpenListener;
|
||||
private View.OnTouchListener mListTouchListener;
|
||||
private JSONArray mSearchEngines;
|
||||
private ContentResolver mContentResolver;
|
||||
private ContentObserver mContentObserver;
|
||||
@ -738,13 +737,6 @@ public class AwesomeBarTabs extends TabHost {
|
||||
// to the TabHost.
|
||||
setup();
|
||||
|
||||
mListTouchListener = new View.OnTouchListener() {
|
||||
public boolean onTouch(View view, MotionEvent event) {
|
||||
hideSoftInput(view);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
addAllPagesTab();
|
||||
addBookmarksTab();
|
||||
addHistoryTab();
|
||||
@ -833,7 +825,6 @@ public class AwesomeBarTabs extends TabHost {
|
||||
});
|
||||
|
||||
allPagesList.setAdapter(mAllPagesCursorAdapter);
|
||||
allPagesList.setOnTouchListener(mListTouchListener);
|
||||
}
|
||||
|
||||
private void addBookmarksTab() {
|
||||
@ -844,7 +835,6 @@ public class AwesomeBarTabs extends TabHost {
|
||||
R.id.bookmarks_list);
|
||||
|
||||
ListView bookmarksList = (ListView) findViewById(R.id.bookmarks_list);
|
||||
bookmarksList.setOnTouchListener(mListTouchListener);
|
||||
|
||||
// Only load bookmark list when tab is actually used.
|
||||
// See OnTabChangeListener above.
|
||||
@ -858,7 +848,6 @@ public class AwesomeBarTabs extends TabHost {
|
||||
R.id.history_list);
|
||||
|
||||
ListView historyList = (ListView) findViewById(R.id.history_list);
|
||||
historyList.setOnTouchListener(mListTouchListener);
|
||||
|
||||
// Only load history list when tab is actually used.
|
||||
// See OnTabChangeListener above.
|
||||
@ -1013,4 +1002,13 @@ public class AwesomeBarTabs extends TabHost {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
hideSoftInput(this);
|
||||
|
||||
// the android docs make no sense, but returning false will cause this and other
|
||||
// motion events to be sent to the view the user tapped on
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user