diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index f67485180a..9a4713217d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -558,7 +558,7 @@ public class FragmentMessages extends FragmentBase { rvMessage.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() { @Override public boolean onInterceptTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent ev) { - swipeListener.onTouch(null, ev); + swipeListener.onTouch(rv, ev); return false; } diff --git a/app/src/main/java/eu/faircode/email/SwipeListener.java b/app/src/main/java/eu/faircode/email/SwipeListener.java index daa9dfc8ea..f3b177709f 100644 --- a/app/src/main/java/eu/faircode/email/SwipeListener.java +++ b/app/src/main/java/eu/faircode/email/SwipeListener.java @@ -5,6 +5,8 @@ import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; +import androidx.annotation.NonNull; + public class SwipeListener implements View.OnTouchListener { private final GestureDetector gestureDetector; @@ -37,7 +39,7 @@ public class SwipeListener implements View.OnTouchListener { }); } - public boolean onTouch(final View v, final MotionEvent event) { + public boolean onTouch(@NonNull View view, @NonNull MotionEvent event) { return gestureDetector.onTouchEvent(event); }