Search in sources :

Example 1 with CardTouchViewDraggableManager

use of it.gmariotti.cardslib.library.extra.dragdroplist.internal.CardTouchViewDraggableManager in project cardslib by gabrielemariotti.

the class CardListDragDropView method init.

//--------------------------------------------------------------------------
// Init
//--------------------------------------------------------------------------
/**
     * Initialize
     *
     * @param attrs
     * @param defStyle
     */
protected void init(AttributeSet attrs, int defStyle) {
    //Init attrs
    initAttrs(attrs, defStyle);
    //Set divider to 0dp
    setDividerHeight(0);
    //enable and set the drag and drop feature
    enableDragAndDrop();
    setDraggableManager(new CardTouchViewDraggableManager(R.id.list_cardId));
    setOnItemLongClickListener(new OnItemLongClickListener() {

        @Override
        public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
            startDragging(position - getHeaderViewsCount());
            return true;
        }
    });
}
Also used : CardTouchViewDraggableManager(it.gmariotti.cardslib.library.extra.dragdroplist.internal.CardTouchViewDraggableManager) View(android.view.View) AdapterView(android.widget.AdapterView) DynamicListView(com.nhaarman.listviewanimations.itemmanipulation.DynamicListView)

Aggregations

View (android.view.View)1 AdapterView (android.widget.AdapterView)1 DynamicListView (com.nhaarman.listviewanimations.itemmanipulation.DynamicListView)1 CardTouchViewDraggableManager (it.gmariotti.cardslib.library.extra.dragdroplist.internal.CardTouchViewDraggableManager)1