Search in sources :

Example 6 with SimpleCursorAdapter

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

the class OldContactsAdapterBridge method buildPhonesAdapter.

SpinnerAdapter buildPhonesAdapter(Activity a) {
    String[] PROJECTION = new String[] { Contacts.Phones._ID, Contacts.Phones.NAME, Contacts.Phones.NUMBER };
    String[] ARGS = { String.valueOf(Contacts.Phones.TYPE_MOBILE) };
    Cursor c = a.managedQuery(Contacts.Phones.CONTENT_URI, PROJECTION, Contacts.Phones.TYPE + "=?", ARGS, Contacts.Phones.NAME);
    SimpleCursorAdapter adapter = new SimpleCursorAdapter(a, android.R.layout.simple_spinner_item, c, new String[] { Contacts.Phones.NAME }, new int[] { android.R.id.text1 });
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    return (adapter);
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter) Cursor(android.database.Cursor)

Example 7 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);
    getContentResolver().call(Provider.Constants.CONTENT_URI, Provider.SET_KEY_METHOD, "sekrit", null);
    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)

Example 8 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)

Example 9 with SimpleCursorAdapter

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

the class OldContactsAdapterBridge method buildNameAdapter.

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

Example 10 with SimpleCursorAdapter

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

the class CPProxyConsumerActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    adapter = new SimpleCursorAdapter(this, R.layout.row, null, new String[] { CallLog.Calls.NUMBER, CallLog.Calls.DATE }, new int[] { R.id.number, R.id.date });
    adapter.setViewBinder(this);
    setListAdapter(adapter);
    getLoaderManager().initLoader(0, null, this);
}
Also used : SimpleCursorAdapter(android.widget.SimpleCursorAdapter)

Aggregations

SimpleCursorAdapter (android.widget.SimpleCursorAdapter)60 Cursor (android.database.Cursor)37 ListAdapter (android.widget.ListAdapter)16 ListView (android.widget.ListView)13 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)4 Test (org.junit.Test)3 Intent (android.content.Intent)2 Uri (android.net.Uri)2 TextView (android.widget.TextView)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