Refactoring

This commit is contained in:
M66B 2019-04-26 09:22:23 +02:00
parent 91910d6403
commit 48d5392b3b
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}

View File

@ -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);
}