初始代码提交
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package com.sw.inbound.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class NonScrollRecyclerView extends RecyclerView {
|
||||
|
||||
public NonScrollRecyclerView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public NonScrollRecyclerView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
// 请求父View不拦截事件,确保子View能接收到事件
|
||||
getParent().requestDisallowInterceptTouchEvent(true);
|
||||
return super.dispatchTouchEvent(ev);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user