use of com.marshalchen.common.uimodule.dragSortListView.DragSortListView in project UltimateAndroid by cymcsg.
the class TestBedDSLV method onEnabledOkClick.
@Override
public void onEnabledOkClick(boolean drag, boolean sort, boolean remove) {
mSortEnabled = sort;
mRemoveEnabled = remove;
mDragEnabled = drag;
DSLVFragment f = (DSLVFragment) getSupportFragmentManager().findFragmentByTag(mTag);
DragSortListView dslv = (DragSortListView) f.getListView();
f.getController().setRemoveEnabled(remove);
f.getController().setSortEnabled(sort);
dslv.setDragEnabled(drag);
}
use of com.marshalchen.common.uimodule.dragSortListView.DragSortListView in project UltimateAndroid by cymcsg.
the class WarpDSLV method onCreate.
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.drag_sort_listview_warp_main);
DragSortListView lv = (DragSortListView) getListView();
lv.setDropListener(onDrop);
lv.setRemoveListener(onRemove);
lv.setDragScrollProfile(ssProfile);
array = getResources().getStringArray(R.array.countries);
list = new ArrayList<String>(Arrays.asList(array));
adapter = new ArrayAdapter<String>(this, R.layout.drag_sort_listview_list_item_handle_right, R.id.text, list);
setListAdapter(adapter);
}
use of com.marshalchen.common.uimodule.dragSortListView.DragSortListView in project UltimateAndroid by cymcsg.
the class CursorDSLV method onCreate.
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.drag_sort_listview_cursor_main);
String[] cols = { "name" };
int[] ids = { R.id.text };
adapter = new MAdapter(this, R.layout.drag_sort_listview_list_item_click_remove, null, cols, ids, 0);
DragSortListView dslv = (DragSortListView) findViewById(android.R.id.list);
dslv.setAdapter(adapter);
// build a cursor from the String array
MatrixCursor cursor = new MatrixCursor(new String[] { "_id", "name" });
String[] artistNames = getResources().getStringArray(R.array.jazz_artist_names);
for (int i = 0; i < artistNames.length; i++) {
cursor.newRow().add(i).add(artistNames[i]);
}
adapter.changeCursor(cursor);
}
use of com.marshalchen.common.uimodule.dragSortListView.DragSortListView in project UltimateAndroid by cymcsg.
the class ArbItemSizeDSLV method onCreate.
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.drag_sort_listview_hetero_main);
DragSortListView lv = (DragSortListView) getListView();
lv.setDropListener(onDrop);
lv.setRemoveListener(onRemove);
mArtistNames = getResources().getStringArray(R.array.jazz_artist_names);
mArtistAlbums = getResources().getStringArray(R.array.jazz_artist_albums);
mArtists = new ArrayList<JazzArtist>();
JazzArtist ja;
for (int i = 0; i < mArtistNames.length; ++i) {
ja = new JazzArtist();
ja.name = mArtistNames[i];
if (i < mArtistAlbums.length) {
ja.albums = mArtistAlbums[i];
} else {
ja.albums = "No albums listed";
}
mArtists.add(ja);
}
adapter = new JazzAdapter(mArtists);
setListAdapter(adapter);
}
use of com.marshalchen.common.uimodule.dragSortListView.DragSortListView in project UltimateAndroid by cymcsg.
the class MultipleChoiceListView 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_checkable, R.id.text, arrayList);
setListAdapter(adapter);
DragSortListView list = getListView();
list.setDropListener(onDrop);
list.setRemoveListener(onRemove);
}
Aggregations