mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-09 02:23:38 +02:00
Experimental single finger pan
This commit is contained in:
@@ -2764,8 +2764,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
} else
|
||||
return false;
|
||||
} else {
|
||||
view.getParent().requestDisallowInterceptTouchEvent(false);
|
||||
return (view.getId() == R.id.wvBody && ev.getAction() == MotionEvent.ACTION_MOVE);
|
||||
boolean intercept = (view.getId() == R.id.wvBody && ((WebViewEx) wvBody).isZoomed());
|
||||
view.getParent().requestDisallowInterceptTouchEvent(intercept);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user