Search in sources :

Example 41 with SimpleCursorAdapter

use of android.widget.SimpleCursorAdapter in project cw-advandroid by commonsguy.

the class NewContactsAdapterBridge method buildNameAdapter.

ListAdapter buildNameAdapter(Activity a) {
    String[] PROJECTION = new String[] { Contacts._ID, Contacts.DISPLAY_NAME };
    Cursor c = a.managedQuery(Contacts.CONTENT_URI, PROJECTION, null, null, null);
    return (new SimpleCursorAdapter(a, android.R.layout.simple_list_item_1, c, new String[] { Contacts.DISPLAY_NAME }, new int[] { android.R.id.text1 }));
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter) Cursor(android.database.Cursor)

Example 42 with SimpleCursorAdapter

use of android.widget.SimpleCursorAdapter in project cw-advandroid by commonsguy.

the class OldContactsAdapterBridge method buildPhonesAdapter.

ListAdapter buildPhonesAdapter(Activity a) {
    String[] PROJECTION = new String[] { Contacts.Phones._ID, Contacts.Phones.NAME, Contacts.Phones.NUMBER };
    Cursor c = a.managedQuery(Contacts.Phones.CONTENT_URI, PROJECTION, null, null, Contacts.Phones.DEFAULT_SORT_ORDER);
    return (new SimpleCursorAdapter(a, android.R.layout.simple_list_item_2, c, new String[] { Contacts.Phones.NAME, Contacts.Phones.NUMBER }, new int[] { android.R.id.text1, android.R.id.text2 }));
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter) Cursor(android.database.Cursor)

Example 43 with SimpleCursorAdapter

use of android.widget.SimpleCursorAdapter in project cw-advandroid by commonsguy.

the class OldContactsAdapterBridge method buildEmailAdapter.

ListAdapter buildEmailAdapter(Activity a) {
    String[] PROJECTION = new String[] { Contacts.ContactMethods._ID, Contacts.ContactMethods.DATA, Contacts.PeopleColumns.NAME };
    Cursor c = a.managedQuery(Contacts.ContactMethods.CONTENT_EMAIL_URI, PROJECTION, null, null, Contacts.ContactMethods.DEFAULT_SORT_ORDER);
    return (new SimpleCursorAdapter(a, android.R.layout.simple_list_item_2, c, new String[] { Contacts.PeopleColumns.NAME, Contacts.ContactMethods.DATA }, new int[] { android.R.id.text1, android.R.id.text2 }));
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter) Cursor(android.database.Cursor)

Example 44 with SimpleCursorAdapter

use of android.widget.SimpleCursorAdapter in project cw-advandroid by commonsguy.

the class ConstantsBrowser method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    constantsCursor = managedQuery(Provider.Constants.CONTENT_URI, PROJECTION, null, null, null);
    ListAdapter adapter = new SimpleCursorAdapter(this, R.layout.row, constantsCursor, new String[] { Provider.Constants.TITLE, Provider.Constants.VALUE }, new int[] { R.id.title, R.id.value });
    setListAdapter(adapter);
    registerForContextMenu(getListView());
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter) ListAdapter(android.widget.ListAdapter)

Example 45 with SimpleCursorAdapter

use of android.widget.SimpleCursorAdapter in project cw-advandroid by commonsguy.

the class ConstantsBrowser method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    adapter = new SimpleCursorAdapter(this, R.layout.row, null, new String[] { Provider.Constants.TITLE, Provider.Constants.VALUE }, new int[] { R.id.title, R.id.value });
    setListAdapter(adapter);
    registerForContextMenu(getListView());
    getLoaderManager().initLoader(0, null, this);
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter)

Aggregations

SimpleCursorAdapter (android.widget.SimpleCursorAdapter)61 Cursor (android.database.Cursor)38 ListAdapter (android.widget.ListAdapter)16 ListView (android.widget.ListView)14 AlphaAnimation (android.view.animation.AlphaAnimation)6 Animation (android.view.animation.Animation)6 AnimationSet (android.view.animation.AnimationSet)6 LayoutAnimationController (android.view.animation.LayoutAnimationController)6 TranslateAnimation (android.view.animation.TranslateAnimation)6 View (android.view.View)5 TextView (android.widget.TextView)3 Test (org.junit.Test)3 Intent (android.content.Intent)2 Uri (android.net.Uri)2 ContentResolver (android.content.ContentResolver)1 ContentValues (android.content.ContentValues)1 MatrixCursor (android.database.MatrixCursor)1 Drawable (android.graphics.drawable.Drawable)1 OnClickListener (android.view.View.OnClickListener)1 LayoutParams (android.view.ViewGroup.LayoutParams)1