RecycleView拖放

时间:2015-04-24 02:32:08

标签: android android-fragments android-activity android-recyclerview

我正在使用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);

0 个答案:

没有答案