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;
}
});
}
Aggregations