package com.ym.testproject.util;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import org.jetbrains.annotations.NotNull;
/**
* @author Ym
* @version 1.0
* @createTime 2022/8/2
* @describe
*/
public class MyRecyclerView extends RecyclerView {
public MyRecyclerView(@NonNull @NotNull Context context) {
super(context);
}
public MyRecyclerView(@NonNull @NotNull Context context, @Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs) {
super(context, attrs);
}
public MyRecyclerView(@NonNull @NotNull Context context, @Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent e) {
if ( e.getAction() == MotionEvent.ACTION_MOVE){
return e.getPointerCount() > 1? false:true;
}
return super.onInterceptTouchEvent(e);
}
}
评论0