diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-02-12 19:16:34 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-03-26 12:29:58 +0000 |
commit | 62f1176aca1cf99e0d1135193c32b2e160aade8b (patch) | |
tree | 2471d50c8b71c48effe8fc078524d01af1110686 /android/src | |
parent | 8af59306cb95d85b06b20f54658b68298b7826b4 (diff) | |
download | mupdf-62f1176aca1cf99e0d1135193c32b2e160aade8b.tar.xz |
Android: Ensure that autorotate doesn't kick us out of reflow mode.
Diffstat (limited to 'android/src')
-rw-r--r-- | android/src/com/artifex/mupdfdemo/MuPDFActivity.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/android/src/com/artifex/mupdfdemo/MuPDFActivity.java b/android/src/com/artifex/mupdfdemo/MuPDFActivity.java index 582848a7..8d11173a 100644 --- a/android/src/com/artifex/mupdfdemo/MuPDFActivity.java +++ b/android/src/com/artifex/mupdfdemo/MuPDFActivity.java @@ -728,6 +728,9 @@ public class MuPDFActivity extends Activity if(savedInstanceState != null && savedInstanceState.getBoolean("SearchMode", false)) searchModeOn(); + if(savedInstanceState != null && savedInstanceState.getBoolean("ReflowMode", false)) + reflowModeSet(true); + // Stick the document view and the buttons overlay into a parent view RelativeLayout layout = new RelativeLayout(this); layout.addView(mDocView); @@ -751,8 +754,9 @@ public class MuPDFActivity extends Activity return mycore; } - private void toggleReflow() { - mReflow = !mReflow; + private void reflowModeSet(boolean reflow) + { + mReflow = reflow; if (mReflow) { mDocView.setAdapter(new MuPDFReflowAdapter(this, core)); mReflowButton.setColorFilter(Color.argb(0xFF, 172, 114, 37)); @@ -765,6 +769,11 @@ public class MuPDFActivity extends Activity mDocView.refresh(mReflow); } + private void toggleReflow() { + reflowModeSet(!mReflow); + popUp(mReflow ? "Entering reflow mode" : "Leaving reflow mode"); + } + @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); @@ -787,6 +796,9 @@ public class MuPDFActivity extends Activity if (mTopBarMode == TopBarMode.Search) outState.putBoolean("SearchMode", true); + + if (mReflow) + outState.putBoolean("ReflowMode", true); } @Override |