diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-08-11 12:52:03 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-08-11 12:52:03 +0200 |
commit | 9960cb819edf18768759031a87b51d3e663d918f (patch) | |
tree | 3dac159d086ea02bb5dafbaa349c1ef688f5997c /src/eu | |
parent | b35aa3ed0720f195ec341a1188591052909bdf18 (diff) | |
parent | 70423204f4bd64c6f6b4a31ccebc31b3ae9bc574 (diff) |
Merge pull request #344 from 1nsan3/development
Hardware search button
Diffstat (limited to 'src/eu')
-rw-r--r-- | src/eu/siacs/conversations/ui/StartConversationActivity.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/ui/StartConversationActivity.java b/src/eu/siacs/conversations/ui/StartConversationActivity.java index b56d8a60..9dad5c16 100644 --- a/src/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/eu/siacs/conversations/ui/StartConversationActivity.java @@ -21,6 +21,7 @@ import android.text.Editable; import android.text.TextWatcher; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; +import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; import android.view.View; @@ -63,6 +64,7 @@ public class StartConversationActivity extends XmppActivity { private List<String> mKnownHosts; private List<String> mKnownConferenceHosts; + private Menu mOptionsMenu; private EditText mSearchEditText; public int conference_context_id; @@ -432,6 +434,7 @@ public class StartConversationActivity extends XmppActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { + this.mOptionsMenu = menu; getMenuInflater().inflate(R.menu.start_conversation, menu); MenuItem menuCreateContact = (MenuItem) menu .findItem(R.id.action_create_contact); @@ -463,6 +466,17 @@ public class StartConversationActivity extends XmppActivity { } return super.onOptionsItemSelected(item); } + + @Override + public boolean onKeyUp(int keyCode, KeyEvent event) + { + if(keyCode == KeyEvent.KEYCODE_SEARCH && !event.isLongPress()) + { + mOptionsMenu.findItem(R.id.action_search).expandActionView(); + return true; + } + return super.onKeyUp(keyCode, event); + } @Override void onBackendConnected() { |