diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index edcb5ad8e5..9c101989cb 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -314,7 +314,6 @@ public class AdapterMessage extends RecyclerView.Adapter 10) + return true; + + // Text size + properties.setSize(message.id, size); + tvBody.setTextSize(TypedValue.COMPLEX_UNIT_PX, size); + + // Image size + Spanned spanned = (Spanned) tvBody.getText(); + for (ImageSpan img : spanned.getSpans(0, spanned.length(), ImageSpan.class)) { + Drawable d = img.getDrawable(); + ImageHelper.AnnotatedSource a = new ImageHelper.AnnotatedSource(img.getSource()); + ImageHelper.fitDrawable(d, a, scale, tvBody); + } + + // Feedback + String perc = Math.round(scale * 100) + " %"; + if (toast != null) + toast.cancel(); + toast = ToastEx.makeText(context, perc, Toast.LENGTH_SHORT); + toast.show(); + } + + return true; + } + }); + + @Override + public boolean onTouch(View view, MotionEvent ev) { + if (ev.getPointerCount() > 1) { + view.getParent().requestDisallowInterceptTouchEvent(true); + if (view.getId() == R.id.tvBody) { + gestureDetector.onTouchEvent(ev); + return true; + } 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).isZoomedY()); + view.getParent().requestDisallowInterceptTouchEvent(intercept); + return false; + } + } + }; private MovementMethod movementMethod = new ArrowKeyMovementMethod() { private GestureDetector gestureDetector = new GestureDetector(context, @@ -874,7 +929,7 @@ public class AdapterMessage extends RecyclerView.Adapter 10) - return true; - - // Text size - properties.setSize(message.id, size); - tvBody.setTextSize(TypedValue.COMPLEX_UNIT_PX, size); - - // Image size - Spanned spanned = (Spanned) tvBody.getText(); - for (ImageSpan img : spanned.getSpans(0, spanned.length(), ImageSpan.class)) { - Drawable d = img.getDrawable(); - ImageHelper.AnnotatedSource a = new ImageHelper.AnnotatedSource(img.getSource()); - ImageHelper.fitDrawable(d, a, scale, tvBody); - } - - // Feedback - String perc = Math.round(scale * 100) + " %"; - if (toast != null) - toast.cancel(); - toast = ToastEx.makeText(context, perc, Toast.LENGTH_SHORT); - toast.show(); - } - - return true; - } - }); } if (accessibility) { @@ -2341,7 +2358,7 @@ public class AdapterMessage extends RecyclerView.Adapter 1) { - view.getParent().requestDisallowInterceptTouchEvent(true); - if (view.getId() == R.id.tvBody) { - gestureDetector.onTouchEvent(ev); - return true; - } 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).isZoomedY()); - view.getParent().requestDisallowInterceptTouchEvent(intercept); - return false; - } - } - @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { TupleMessageEx message = getMessage();