Android 水平回收器查看抽屉布局

Android 水平回收器查看抽屉布局,android,android-recyclerview,drawerlayout,Android,Android Recyclerview,Drawerlayout,在抽屉布局的顶部,我想要水平列表。在我将onClick添加到viewHolder之前,内部滚动没有问题。然后,仅当从左向右滚动时,recyclerview才能工作。要从左向右滚动,我必须将手指放在recyclerview中向右移动,然后才能向左滚动。若我开始向左滚动,抽屉将关闭。如何在此特定视图中禁用抽屉的scoll侦听器 我的主要布局 <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android

在抽屉布局的顶部,我想要水平列表。在我将onClick添加到viewHolder之前,内部滚动没有问题。然后,仅当从左向右滚动时,recyclerview才能工作。要从左向右滚动,我必须将手指放在recyclerview中向右移动,然后才能向左滚动。若我开始向左滚动,抽屉将关闭。如何在此特定视图中禁用抽屉的scoll侦听器

我的主要布局

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/DrawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <RelativeLayout
        android:id="@+id/main_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">


        <FrameLayout
            android:id="@+id/frame"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:elevation="5dp" />
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/drawer"
        android:layout_width="304dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:clickable="true"
        android:fitsSystemWindows="true">

<android.support.v7.widget.RecyclerView
                android:id="@+id/drawerVerticalList"
                android:layout_width="wrap_content"
                android:layout_height="match_parent" />
    </RelativeLayout>
    </android.support.v4.widget.DrawerLayout>

我确实尝试将addOnScrollListener设置为recycleview并依赖于状态setDrawerLockMode,但看起来“抽屉侦听器”具有更高的优先级,因此此尝试失败。我确实找到了帮助我复制的示例
 @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = layoutInflater.from(parent.getContext()).inflate(resourceId, parent, false);
        ViewHolder vh = new ViewHolder(view, new ViewHolder.ViewHolderClicks() {
            @Override
            public void onRVItemClick(String title, int ID) {
                //...
            }
        });
        return vh;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {

        holder.title.setText(...);

    }

    static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
        public TextView title;
        public ViewHolderClicks mListener;
        public int ID;

        public ViewHolder(View viewItem, ViewHolderClicks mListener) {
            super(viewItem);
            title = (TextView) viewItem.findViewById(R.id.title);
            this.mListener = mListener;
            viewItem.setOnClickListener(this);
        }

        @Override
        public void onClick(View v) {
            mListener.onRVItemClick(title.getText().toString(), ID);
        }

        public static interface ViewHolderClicks {
            public void onRVItemClick(String title, int ID);
        }
    }