Search in sources :

Example 1 with DragSortListView

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);
}
Also used : DragSortListView(com.marshalchen.common.uimodule.dragSortListView.DragSortListView)

Example 2 with DragSortListView

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);
}
Also used : DragSortListView(com.marshalchen.common.uimodule.dragSortListView.DragSortListView)

Example 3 with DragSortListView

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);
}
Also used : DragSortListView(com.marshalchen.common.uimodule.dragSortListView.DragSortListView) MatrixCursor(android.database.MatrixCursor)

Example 4 with DragSortListView

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);
}
Also used : DragSortListView(com.marshalchen.common.uimodule.dragSortListView.DragSortListView)

Example 5 with DragSortListView

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);
}
Also used : ArrayList(java.util.ArrayList) DragSortListView(com.marshalchen.common.uimodule.dragSortListView.DragSortListView)

Aggregations

DragSortListView (com.marshalchen.common.uimodule.dragSortListView.DragSortListView)8 ArrayList (java.util.ArrayList)3 MatrixCursor (android.database.MatrixCursor)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 DragSortController (com.marshalchen.common.uimodule.dragSortListView.DragSortController)1