mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Prevent flicker
This commit is contained in:
parent
f01b0710f3
commit
3f391a2ddd
1 changed files with 8 additions and 6 deletions
|
@ -1398,13 +1398,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
if (event.getPointerCount() == 2)
|
||||
getParent().requestDisallowInterceptTouchEvent(true); // zoom
|
||||
else if (event.getAction() == MotionEvent.ACTION_MOVE) {
|
||||
if (event.getPointerCount() == 1) {
|
||||
int range = computeVerticalScrollRange() - computeVerticalScrollExtent();
|
||||
if (range > 0) // scroll
|
||||
getParent().requestDisallowInterceptTouchEvent(true);
|
||||
}
|
||||
} else // zoom
|
||||
getParent().requestDisallowInterceptTouchEvent(true);
|
||||
return super.onTouchEvent(event);
|
||||
}
|
||||
|
||||
|
@ -1419,8 +1418,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
@Override
|
||||
protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY) {
|
||||
super.onOverScrolled(scrollX, scrollY, clampedX, clampedY);
|
||||
if (clampedY)
|
||||
properties.scrollBy(0, dy);
|
||||
if (clampedY) {
|
||||
int range = computeVerticalScrollRange() - computeVerticalScrollExtent();
|
||||
if (range > 0) // This is to prevent flicker
|
||||
properties.scrollBy(0, dy);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue