Search in sources :

Example 51 with ListAdapter

use of android.widget.ListAdapter in project SeriesGuide by UweTrottmann.

the class HeaderGridView method onMeasure.

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    ListAdapter adapter = getAdapter();
    if (adapter != null && adapter instanceof HeaderViewGridAdapter) {
        ((HeaderViewGridAdapter) adapter).setNumColumns(getNumColumns());
    }
}
Also used : ListAdapter(android.widget.ListAdapter) WrapperListAdapter(android.widget.WrapperListAdapter)

Example 52 with ListAdapter

use of android.widget.ListAdapter in project GlassActionBar by ManuelPeinado.

the class ListViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ListAdapter adapter = new ImagesAdapter(this);
    helper = new GlassActionBarHelper().contentLayout(R.layout.activity_listview, adapter);
    setContentView(helper.createView(this));
}
Also used : GlassActionBarHelper(com.manuelpeinado.glassactionbar.GlassActionBarHelper) ListAdapter(android.widget.ListAdapter)

Example 53 with ListAdapter

use of android.widget.ListAdapter in project GlassActionBar by ManuelPeinado.

the class ListViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ListAdapter adapter = new ImagesAdapter(this);
    helper = new GlassActionBarHelper().contentLayout(R.layout.activity_listview, adapter);
    setContentView(helper.createView(this));
}
Also used : GlassActionBarHelper(com.manuelpeinado.glassactionbar.GlassActionBarHelper) ListAdapter(android.widget.ListAdapter)

Example 54 with ListAdapter

use of android.widget.ListAdapter in project GT by Tencent.

the class DragSortListView method getChildHeight.

private int getChildHeight(int position) {
    if (position == mSrcPos) {
        return 0;
    }
    View v = getChildAt(position - getFirstVisiblePosition());
    if (v != null) {
        // hence the "true"
        return getChildHeight(position, v, false);
    } else {
        // item is offscreen
        // first check cache for child height at this position
        int childHeight = mChildHeightCache.get(position);
        if (childHeight != -1) {
            // Log.d("mobeta", "found child height in cache!");
            return childHeight;
        }
        final ListAdapter adapter = getAdapter();
        int type = adapter.getItemViewType(position);
        // There might be a better place for checking for the following
        final int typeCount = adapter.getViewTypeCount();
        if (typeCount != mSampleViewTypes.length) {
            mSampleViewTypes = new View[typeCount];
        }
        if (type >= 0) {
            if (mSampleViewTypes[type] == null) {
                v = adapter.getView(position, null, this);
                mSampleViewTypes[type] = v;
            } else {
                v = adapter.getView(position, mSampleViewTypes[type], this);
            }
        } else {
            // type is HEADER_OR_FOOTER or IGNORE
            v = adapter.getView(position, null, this);
        }
        // current child height is invalid, hence "true" below
        childHeight = getChildHeight(position, v, true);
        // cache it because this could have been expensive
        mChildHeightCache.add(position, childHeight);
        return childHeight;
    }
}
Also used : View(android.view.View) AbsListView(android.widget.AbsListView) ListView(android.widget.ListView) Point(android.graphics.Point) ListAdapter(android.widget.ListAdapter)

Example 55 with ListAdapter

use of android.widget.ListAdapter in project android_frameworks_base by ParanoidAndroid.

the class ListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.list_activity);
    ListAdapter adapter = new SimpleListAdapter(this);
    ListView list = (ListView) findViewById(R.id.list);
    list.setAdapter(adapter);
    registerForContextMenu(list);
}
Also used : ListView(android.widget.ListView) ListAdapter(android.widget.ListAdapter)

Aggregations

ListAdapter (android.widget.ListAdapter)298 ListView (android.widget.ListView)105 View (android.view.View)96 AdapterView (android.widget.AdapterView)55 AbsListView (android.widget.AbsListView)48 WrapperListAdapter (android.widget.WrapperListAdapter)47 HeaderViewListAdapter (android.widget.HeaderViewListAdapter)44 TextView (android.widget.TextView)42 ViewGroup (android.view.ViewGroup)37 Paint (android.graphics.Paint)22 ArrayAdapter (android.widget.ArrayAdapter)21 Point (android.graphics.Point)19 SuppressLint (android.annotation.SuppressLint)16 SimpleCursorAdapter (android.widget.SimpleCursorAdapter)16 Cursor (android.database.Cursor)12 SectionIndexer (android.widget.SectionIndexer)11 DialogInterface (android.content.DialogInterface)10 Bundle (android.os.Bundle)10 FrameLayout (android.widget.FrameLayout)10 GridView (android.widget.GridView)10