summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorPaul Gardiner <paulg.artifex@glidos.net>2012-08-13 14:24:50 +0100
committerPaul Gardiner <paulg.artifex@glidos.net>2012-08-13 16:22:20 +0100
commit0c6cca901d467af394f4cf975d0f819c899185d7 (patch)
tree0a8f6e0da78b74407279342c1082e76295426102 /android
parent7651915409bffd9517f195c00be7cb98598dbf18 (diff)
downloadmupdf-0c6cca901d467af394f4cf975d0f819c899185d7.tar.xz
Android: react to search button
Diffstat (limited to 'android')
-rw-r--r--android/src/com/artifex/mupdf/MuPDFActivity.java35
1 files changed, 23 insertions, 12 deletions
diff --git a/android/src/com/artifex/mupdf/MuPDFActivity.java b/android/src/com/artifex/mupdf/MuPDFActivity.java
index 5696ea0b..ad72961b 100644
--- a/android/src/com/artifex/mupdf/MuPDFActivity.java
+++ b/android/src/com/artifex/mupdf/MuPDFActivity.java
@@ -576,21 +576,25 @@ public class MuPDFActivity extends Activity
}
void searchModeOn() {
- mTopBarIsSearch = true;
- //Focus on EditTextWidget
- mSearchText.requestFocus();
- showKeyboard();
- mTopBarSwitcher.showNext();
+ if (!mTopBarIsSearch) {
+ mTopBarIsSearch = true;
+ //Focus on EditTextWidget
+ mSearchText.requestFocus();
+ showKeyboard();
+ mTopBarSwitcher.showNext();
+ }
}
void searchModeOff() {
- mTopBarIsSearch = false;
- hideKeyboard();
- mTopBarSwitcher.showPrevious();
- SearchTaskResult.set(null);
- // Make the ReaderView act on the change to mSearchTaskResult
- // via overridden onChildSetup method.
- mDocView.resetupChildren();
+ if (mTopBarIsSearch) {
+ mTopBarIsSearch = false;
+ hideKeyboard();
+ mTopBarSwitcher.showPrevious();
+ SearchTaskResult.set(null);
+ // Make the ReaderView act on the change to mSearchTaskResult
+ // via overridden onChildSetup method.
+ mDocView.resetupChildren();
+ }
}
void updatePageNumView(int index) {
@@ -718,4 +722,11 @@ public class MuPDFActivity extends Activity
mSearchTask.safeExecute(new Integer(direction));
}
+
+ @Override
+ public boolean onSearchRequested() {
+ showButtons();
+ searchModeOn();
+ return super.onSearchRequested();
+ }
}