Experimental single finger pan

This commit is contained in:
M66B
2020-08-21 21:31:37 +02:00
parent e8de7a876e
commit aa5d871b5a
2 changed files with 21 additions and 2 deletions

View File

@@ -183,6 +183,24 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
return super.onGenericMotionEvent(event);
}
public boolean isZoomed() {
int xtend = computeHorizontalScrollExtent();
if (xtend != 0) {
float xscale = computeHorizontalScrollRange() / (float) xtend;
if (xscale > 1.2)
return true;
}
int ytend = computeVerticalScrollExtent();
if (ytend != 0) {
float yscale = computeVerticalScrollRange() / (float) ytend;
if (yscale > 1.2)
return true;
}
return false;
}
interface IWebView {
void onSizeChanged(int w, int h, int ow, int oh);