summaryrefslogtreecommitdiff
path: root/android/src
diff options
context:
space:
mode:
authorPaul Gardiner <paulg.artifex@glidos.net>2012-08-13 16:14:09 +0100
committerPaul Gardiner <paulg.artifex@glidos.net>2012-08-13 16:22:30 +0100
commit37a61a128cad727af73707e02db176bce4c91d87 (patch)
treea77284e98319c08228cbdcef4ec0acbb32949ad2 /android/src
parent9d445b3eab859e2f2bdcac1f4c6083e07fe09d16 (diff)
downloadmupdf-37a61a128cad727af73707e02db176bce4c91d87.tar.xz
Android: react to menu button.
Also change the search button to behave as a toggle.
Diffstat (limited to 'android/src')
-rw-r--r--android/src/com/artifex/mupdf/MuPDFActivity.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/android/src/com/artifex/mupdf/MuPDFActivity.java b/android/src/com/artifex/mupdf/MuPDFActivity.java
index 6787ad8d..aa2a9fac 100644
--- a/android/src/com/artifex/mupdf/MuPDFActivity.java
+++ b/android/src/com/artifex/mupdf/MuPDFActivity.java
@@ -16,6 +16,7 @@ import android.text.Editable;
import android.text.TextWatcher;
import android.text.method.PasswordTransformationMethod;
import android.view.KeyEvent;
+import android.view.Menu;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
@@ -725,8 +726,23 @@ public class MuPDFActivity extends Activity
@Override
public boolean onSearchRequested() {
- showButtons();
- searchModeOn();
+ if (mButtonsVisible && mTopBarIsSearch) {
+ hideButtons();
+ } else {
+ showButtons();
+ searchModeOn();
+ }
return super.onSearchRequested();
}
+
+ @Override
+ public boolean onPrepareOptionsMenu(Menu menu) {
+ if (mButtonsVisible && !mTopBarIsSearch) {
+ hideButtons();
+ } else {
+ showButtons();
+ searchModeOff();
+ }
+ return super.onPrepareOptionsMenu(menu);
+ }
}