use of com.marshalchen.common.uimodule.dragSortListView.DragSortListView in project UltimateAndroid by cymcsg.
the class Sections method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.drag_sort_listview_sections_main);
DragSortListView dslv = (DragSortListView) getListView();
// get jazz artist names and make adapter
String[] array = getResources().getStringArray(R.array.jazz_artist_names);
List<String> list = new ArrayList<String>(Arrays.asList(array));
SectionAdapter adapter = new SectionAdapter(this, list);
dslv.setDropListener(adapter);
// make and set controller on dslv
SectionController c = new SectionController(dslv, adapter);
dslv.setFloatViewManager(c);
dslv.setOnTouchListener(c);
// pass it to the ListActivity
setListAdapter(adapter);
}
use of com.marshalchen.common.uimodule.dragSortListView.DragSortListView in project UltimateAndroid by cymcsg.
the class SingleChoiceListView method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.drag_sort_listview_checkable_main);
String[] array = getResources().getStringArray(R.array.jazz_artist_names);
ArrayList<String> arrayList = new ArrayList<String>(Arrays.asList(array));
adapter = new ArrayAdapter<String>(this, R.layout.drag_sort_listview_list_item_radio, R.id.text, arrayList);
setListAdapter(adapter);
DragSortListView list = getListView();
list.setDropListener(onDrop);
list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
}
use of com.marshalchen.common.uimodule.dragSortListView.DragSortListView 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