Search in sources :

Example 16 with DragSortListView

use of com.mobeta.android.dslv.DragSortListView in project drag-sort-listview by bauerca.

the class ArbItemSizeDSLV method onCreate.

/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.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.mobeta.android.dslv.DragSortListView)

Aggregations

DragSortListView (com.mobeta.android.dslv.DragSortListView)16 View (android.view.View)7 AdapterView (android.widget.AdapterView)5 ImageView (android.widget.ImageView)4 TextView (android.widget.TextView)4 ArrayList (java.util.ArrayList)4 Paint (android.graphics.Paint)3 DragSortController (com.mobeta.android.dslv.DragSortController)3 MotionEvent (android.view.MotionEvent)2 ViewGroup (android.view.ViewGroup)2 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)2 SuppressLint (android.annotation.SuppressLint)1 AlertDialog (android.app.AlertDialog)1 BroadcastReceiver (android.content.BroadcastReceiver)1 Context (android.content.Context)1 Intent (android.content.Intent)1 Cursor (android.database.Cursor)1 MatrixCursor (android.database.MatrixCursor)1 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1 Bitmap (android.graphics.Bitmap)1