RecyclerViewでNexus 6P APIのSwipeRefreshLayoutを不整合にアクティブにする問題が発生しました。 私たちは、サポートライブラリの最新のバージョンである:SwipeRefreshLayoutが機能しなくなりました/ RecyclerViewが矛盾してSwipeRefreshLayoutをトリガーしました
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
私は(上に項目を追加)リフレッシュするプルが発生した場合の前に追加されますデータセットとRecyclerViewを持って、それが私のレイアウトで宣言されていますこのように:
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipeRefresh"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
</android.support.v4.widget.SwipeRefreshLayout>
私はRecyclerViewに項目を追加、ジェスチャーに約2~3回をトリガすることができるよませんが、それはもはや私はプル更新をトリガすることができます。 SwipeRefreshLayout.setEnabled(false)を決して呼び出しません。 RecyclerViewは、アイテムリストの一番上にあっても、canScrollVertically(-1)に内部的に応答しているようです。
LinearLayoutManager llm = new LinearLayoutManager(getActivity());
llm.setStackFromEnd(true); // Start with most recent messages (enables scroll-to-bottom)
recyclerView.setLayoutManager(llm);