summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorPaul Gardiner <paul@glidos.net>2012-04-24 15:08:39 +0100
committerRobin Watts <robin.watts@artifex.com>2012-04-24 17:41:06 +0100
commit0925d57d1cff3db9a93e737ac68c940b464d360c (patch)
tree949425909d7379939aa463f96022921380f9f51a /android
parentf76104c61bf4c3c5a092d08a1138ce79278aab76 (diff)
downloadmupdf-0925d57d1cff3db9a93e737ac68c940b464d360c.tar.xz
Provoke search with the Return key in addition to the Done key
Also ensure that starting a search closes the keyboard.
Diffstat (limited to 'android')
-rw-r--r--android/src/com/artifex/mupdf/MuPDFActivity.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/android/src/com/artifex/mupdf/MuPDFActivity.java b/android/src/com/artifex/mupdf/MuPDFActivity.java
index 18c0f864..61ac7cdf 100644
--- a/android/src/com/artifex/mupdf/MuPDFActivity.java
+++ b/android/src/com/artifex/mupdf/MuPDFActivity.java
@@ -349,16 +349,22 @@ public class MuPDFActivity extends Activity
}
});
+ mSearchText.setOnKeyListener(new View.OnKeyListener() {
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
+ if (event.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_ENTER)
+ search(1);
+ return false;
+ }
+ });
+
// Activate search invoking buttons
mSearchBack.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
- hideKeyboard();
search(-1);
}
});
mSearchFwd.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
- hideKeyboard();
search(1);
}
});
@@ -616,6 +622,7 @@ public class MuPDFActivity extends Activity
}
void search(int direction) {
+ hideKeyboard();
if (core == null)
return;
killSearch();