While it may not be a good practice to have inbuilt recycler scans, sometimes you cannot avoid this. Maybe something like this:
public class NoScrollRecycler extends RecyclerView { public NoScrollRecycler(Context context){ super(context); } public NoScrollRecycler(Context context, AttributeSet attrs){ super(context, attrs); } public NoScrollRecycler(Context context, AttributeSet attrs, int style){ super(context, attrs, style); } @Override public boolean dispatchTouchEvent(MotionEvent ev){
This will disable the scroll event, but not the click event. Use this class for a child RecyclerView. You want the PARENT repeater to scroll, but not the baby. Well, this should do it, since the parent will be just a standard RecyclerView, but the child will be so normal, without scrolling, but will handle clicks. You may need to disable the click for the parent RecyclerView. Not sure, since I have not tested this, so consider it as an example ...
Also, to use this in XML (if you don't know), do the following:
<com.yourpackage.location.NoScrollRecycler ... ... > ... ... </com.yourpackage.location.NoScrollRecycler>
Lucas Crawford May 13 '15 at 18:34 2015-05-13 18:34
source share