diff options
author | Paul Gardiner <paulg.artifex@glidos.net> | 2012-08-13 14:51:36 +0100 |
---|---|---|
committer | Paul Gardiner <paulg.artifex@glidos.net> | 2012-08-13 16:22:26 +0100 |
commit | 9d445b3eab859e2f2bdcac1f4c6083e07fe09d16 (patch) | |
tree | 07e7ac68682c4f601408037c3b7e3c49335abb91 /android | |
parent | 0c6cca901d467af394f4cf975d0f819c899185d7 (diff) | |
download | mupdf-9d445b3eab859e2f2bdcac1f4c6083e07fe09d16.tar.xz |
bug 693225 android: Can't easily switch to last page using seek bar
Fixed by doubling the seekbar resolution and rounding odd positions upwards.
Diffstat (limited to 'android')
-rw-r--r-- | android/src/com/artifex/mupdf/MuPDFActivity.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/android/src/com/artifex/mupdf/MuPDFActivity.java b/android/src/com/artifex/mupdf/MuPDFActivity.java index ad72961b..6787ad8d 100644 --- a/android/src/com/artifex/mupdf/MuPDFActivity.java +++ b/android/src/com/artifex/mupdf/MuPDFActivity.java @@ -270,8 +270,8 @@ public class MuPDFActivity extends Activity if (core == null) return; mPageNumberView.setText(String.format("%d/%d", i+1, core.countPages())); - mPageSlider.setMax(core.countPages()-1); - mPageSlider.setProgress(i); + mPageSlider.setMax((core.countPages()-1)*2); + mPageSlider.setProgress(i*2); if (SearchTaskResult.get() != null && SearchTaskResult.get().pageNumber != i) { SearchTaskResult.set(null); mDocView.resetupChildren(); @@ -307,14 +307,14 @@ public class MuPDFActivity extends Activity // Activate the seekbar mPageSlider.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { public void onStopTrackingTouch(SeekBar seekBar) { - mDocView.setDisplayedViewIndex(seekBar.getProgress()); + mDocView.setDisplayedViewIndex((seekBar.getProgress()+1)/2); } public void onStartTrackingTouch(SeekBar seekBar) {} public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { - updatePageNumView(progress); + updatePageNumView((progress+1)/2); } }); @@ -511,8 +511,8 @@ public class MuPDFActivity extends Activity // Update page number text and slider int index = mDocView.getDisplayedViewIndex(); updatePageNumView(index); - mPageSlider.setMax(core.countPages()-1); - mPageSlider.setProgress(index); + mPageSlider.setMax((core.countPages()-1)*2); + mPageSlider.setProgress(index*2); if (mTopBarIsSearch) { mSearchText.requestFocus(); showKeyboard(); |