Simplification

This commit is contained in:
M66B 2019-09-01 17:28:09 +02:00
parent 221a4b7b6b
commit 939ff7f403
1 changed files with 8 additions and 15 deletions

View File

@ -528,6 +528,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (message != null) { if (message != null) {
float factor = detector.getScaleFactor(); float factor = detector.getScaleFactor();
float size = tvBody.getTextSize() * factor; float size = tvBody.getTextSize() * factor;
//Log.i("Gesture factor=" + factor + " size=" + size);
properties.setSize(message.id, size); properties.setSize(message.id, size);
tvBody.setTextSize(TypedValue.COMPLEX_UNIT_PX, size); tvBody.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
} }
@ -1446,23 +1447,15 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
@Override @Override
public boolean onTouch(View view, MotionEvent ev) { public boolean onTouch(View view, MotionEvent ev) {
if (ev.getPointerCount() > 1 && if (ev.getPointerCount() > 1 && textSize != 0 && gestureDetector != null) {
textSize != 0 && gestureDetector != null) { //Log.i("Gesture event=" + ev);
switch (ev.getAction()) { view.getParent().requestDisallowInterceptTouchEvent(true);
case MotionEvent.ACTION_DOWN: gestureDetector.onTouchEvent(ev);
case MotionEvent.ACTION_MOVE:
view.getParent().requestDisallowInterceptTouchEvent(true);
gestureDetector.onTouchEvent(ev);
break;
case MotionEvent.ACTION_UP:
view.getParent().requestDisallowInterceptTouchEvent(false);
gestureDetector.onTouchEvent(ev);
break;
}
return true; return true;
} else {
view.getParent().requestDisallowInterceptTouchEvent(false);
return false;
} }
return false;
} }
@Override @Override