wire up method for ending zoom

This commit is contained in:
Daniel Micay 2020-04-04 11:54:34 -04:00
parent 5524da3ad3
commit 0f05f9e1f4
2 changed files with 15 additions and 0 deletions

View File

@ -17,6 +17,7 @@ class GestureHelper {
// Can be replaced with ratio when supported
void onZoomIn(int steps);
void onZoomOut(int steps);
void onZoomEnd();
}
@SuppressLint("ClickableViewAccessibility")
@ -59,6 +60,11 @@ class GestureHelper {
}
return true;
}
@Override
public void onScaleEnd(ScaleGestureDetector detector) {
listener.onZoomEnd();
}
});
gestureView.setOnTouchListener((view, motionEvent) -> {

View File

@ -261,6 +261,11 @@ public class PdfViewer extends AppCompatActivity implements LoaderManager.Loader
public void onZoomOut(int steps) {
zoomOut(steps);
}
@Override
public void onZoomEnd() {
zoomEnd();
}
});
mTextView = new TextView(this);
@ -360,6 +365,10 @@ public class PdfViewer extends AppCompatActivity implements LoaderManager.Loader
}
}
private void zoomEnd() {
renderPage(true);
}
private static void enableDisableMenuItem(MenuItem item, boolean enable) {
if (enable) {
if (!item.isEnabled()) {