diff options
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 |