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