summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
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();
+ }
}