use of com.marshalchen.common.uimodule.dragSortListView.DragSortController in project UltimateAndroid by cymcsg.
the class DSLVFragment method buildController.
/**
* Called in onCreateView. Override this to provide a custom
* DragSortController.
*/
public DragSortController buildController(DragSortListView dslv) {
// defaults are
// dragStartMode = onDown
// removeMode = flingRight
DragSortController controller = new DragSortController(dslv);
controller.setDragHandleId(R.id.drag_handle);
controller.setClickRemoveId(R.id.click_remove);
controller.setRemoveEnabled(removeEnabled);
controller.setSortEnabled(sortEnabled);
controller.setDragInitMode(dragStartMode);
controller.setRemoveMode(removeMode);
return controller;
}
use of com.marshalchen.common.uimodule.dragSortListView.DragSortController in project UltimateAndroid by cymcsg.
the class TestBedDSLV method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
FragmentTransaction transaction;
DSLVFragment f = (DSLVFragment) getSupportFragmentManager().findFragmentByTag(mTag);
DragSortListView dslv = (DragSortListView) f.getListView();
DragSortController control = f.getController();
switch(item.getItemId()) {
case R.id.select_remove_mode:
RemoveModeDialog rdialog = new RemoveModeDialog(mRemoveMode);
rdialog.setRemoveOkListener(this);
rdialog.show(getSupportFragmentManager(), "RemoveMode");
return true;
case R.id.select_drag_init_mode:
DragInitModeDialog ddialog = new DragInitModeDialog(mDragStartMode);
ddialog.setDragOkListener(this);
ddialog.show(getSupportFragmentManager(), "DragInitMode");
return true;
case R.id.select_enables:
EnablesDialog edialog = new EnablesDialog(mDragEnabled, mSortEnabled, mRemoveEnabled);
edialog.setEnabledOkListener(this);
edialog.show(getSupportFragmentManager(), "Enables");
return true;
case R.id.add_header:
mNumHeaders++;
transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.test_bed, getNewDslvFragment(), mTag);
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
transaction.commit();
return true;
case R.id.add_footer:
mNumFooters++;
transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.test_bed, getNewDslvFragment(), mTag);
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
transaction.commit();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
Aggregations