2016-12-11 8 views
0

私はマルチビュータイプのリサイクルビューを持っていますが、ビューの中にはonclickを持つアイテムがあります。 クリック可能な項目外のタッチは、表示/非表示をappbarlayoutが、私はスクロールのためにクリック可能なアイテムにrecyclerviewを私の指を置けば、それはrecycelerview item onclick steal appbarlayoutスクロール

活動

を表示/非表示にしていない焦点とappbarlayoutを盗む場合、私はrecyclerviewにスクロールrecyclerview

<android.support.design.widget.AppBarLayout 
    android:id="@+id/app_bar" 
    android:layout_width="match_parent" 
    android:layout_height="56dp" 
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> 

    <ViewSwitcher 
     android:id="@+id/vs" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true" 
     app:layout_scrollFlags="scroll|enterAlways|snap"> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 
      app:layout_scrollFlags="scroll|enterAlways|snap" 
      app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> 

      <TextView 
       android:id="@+id/toolbar_title" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="right|center_horizontal" 
       android:ellipsize="end" 
       android:maxLines="1" 
       android:paddingRight="0dp" 
       android:textColor="@color/md_white_1000" 
       android:textSize="16dp" /> 
     </android.support.v7.widget.Toolbar> 

     <RelativeLayout xmlns:app="http://schemas.android.com/apk/res-auto" 
      android:layout_width="match_parent" 
      android:layout_height="56dp" 
      android:background="@color/md_white_1000" 
      android:elevation="2dp" 
      android:fitsSystemWindows="true"> 

     </RelativeLayout> 

    </ViewSwitcher> 


</android.support.design.widget.AppBarLayout> 

<include layout="@layout/content_activity_main" /> 

断片

答えて

0

追加する場合.setNestedScrollingEnabled(false);内部のrecyclerviewにそれが行われます!

関連する問題