我正在使用https://github.com/emileb/DragSortRecycler向我的应用添加拖放功能。当我添加它时,我无法滚动我的recyclerView。可能是什么问题?
rv = (RecyclerView)v.findViewById(R.id.rv);
LinearLayoutManager llm = new LinearLayoutManager(getActivity());
rv.setLayoutManager(llm);
generatePaymentCards();
adap = new PaymentRV_Adapter(cards);
rv.setAdapter(adap);
rv.setItemAnimator(null);
DragSortRecycler dragSortRecycler = new DragSortRecycler();
dragSortRecycler.setViewHandleId(R.id.card_view); //View you wis
dragSortRecycler.setOnItemMovedListener(new DragSortRecycler.OnItemMovedListener() {
@Override
public void onItemMoved(int from, int to) {
Log.d("", "onItemMoved " + from + " to " + to);
}
});
rv.addItemDecoration(dragSortRecycler);
rv.addOnItemTouchListener(dragSortRecycler);