Search in sources :

Example 6 with BaseAdapter

use of android.widget.BaseAdapter in project KeepScore by nolanlawson.

the class CustomFastScrollView method getSections.

private void getSections() {
    Adapter adapter = mList.getAdapter();
    if (adapter instanceof HeaderViewListAdapter) {
        mListOffset = ((HeaderViewListAdapter) adapter).getHeadersCount();
        adapter = ((HeaderViewListAdapter) adapter).getWrappedAdapter();
    }
    if (adapter instanceof SectionIndexer) {
        mListAdapter = (BaseAdapter) adapter;
        mSections = ((SectionIndexer) mListAdapter).getSections();
    }
}
Also used : HeaderViewListAdapter(android.widget.HeaderViewListAdapter) Adapter(android.widget.Adapter) HeaderViewListAdapter(android.widget.HeaderViewListAdapter) BaseAdapter(android.widget.BaseAdapter) SectionIndexer(android.widget.SectionIndexer)

Example 7 with BaseAdapter

use of android.widget.BaseAdapter in project SuperSaiyanScrollView by nolanlawson.

the class SuperSaiyanScrollView method getSections.

private void getSections() {
    Adapter adapter = mList.getAdapter();
    if (adapter instanceof HeaderViewListAdapter) {
        mListOffset = ((HeaderViewListAdapter) adapter).getHeadersCount();
        adapter = ((HeaderViewListAdapter) adapter).getWrappedAdapter();
    }
    if (adapter instanceof SectionIndexer) {
        mListAdapter = (BaseAdapter) adapter;
        mSections = ((SectionIndexer) mListAdapter).getSections();
    }
}
Also used : HeaderViewListAdapter(android.widget.HeaderViewListAdapter) Adapter(android.widget.Adapter) HeaderViewListAdapter(android.widget.HeaderViewListAdapter) BaseAdapter(android.widget.BaseAdapter) SectionIndexer(android.widget.SectionIndexer)

Example 8 with BaseAdapter

use of android.widget.BaseAdapter in project android-flip by openaphid.

the class FlipTextViewActivity method onCreate.

/**
   * Called when the activity is first created.
   */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(R.string.activity_title);
    flipView = new FlipViewController(this);
    flipView.setAdapter(new BaseAdapter() {

        @Override
        public int getCount() {
            return 10;
        }

        @Override
        public Object getItem(int position) {
            return position;
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            NumberTextView view;
            if (convertView == null) {
                final Context context = parent.getContext();
                view = new NumberTextView(context, position);
                view.setTextSize(context.getResources().getDimension(R.dimen.textSize));
            } else {
                view = (NumberTextView) convertView;
                view.setNumber(position);
            }
            return view;
        }
    });
    setContentView(flipView);
}
Also used : Context(android.content.Context) ViewGroup(android.view.ViewGroup) FlipViewController(com.aphidmobile.flip.FlipViewController) NumberTextView(com.aphidmobile.flip.demo.views.NumberTextView) BaseAdapter(android.widget.BaseAdapter) NumberTextView(com.aphidmobile.flip.demo.views.NumberTextView) View(android.view.View)

Example 9 with BaseAdapter

use of android.widget.BaseAdapter in project android-flip by openaphid.

the class FlipTextViewXmlActivity method onCreate.

/**
   * Called when the activity is first created.
   */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(R.string.activity_title);
    setContentView(R.layout.xml_layout);
    flipView = (FlipViewController) findViewById(R.id.flipView);
    flipView.setAdapter(new BaseAdapter() {

        @Override
        public int getCount() {
            return 10;
        }

        @Override
        public Object getItem(int position) {
            return position;
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            NumberTextView view;
            if (convertView == null) {
                final Context context = parent.getContext();
                view = new NumberTextView(context, position);
                view.setTextSize(context.getResources().getDimension(R.dimen.textSize));
            } else {
                view = (NumberTextView) convertView;
                view.setNumber(position);
            }
            return view;
        }
    });
}
Also used : Context(android.content.Context) ViewGroup(android.view.ViewGroup) NumberTextView(com.aphidmobile.flip.demo.views.NumberTextView) BaseAdapter(android.widget.BaseAdapter) NumberTextView(com.aphidmobile.flip.demo.views.NumberTextView) View(android.view.View)

Example 10 with BaseAdapter

use of android.widget.BaseAdapter in project bee by orhanobut.

the class UiHandler method initSettingsContent.

void initSettingsContent(List<MethodInfo> list) {
    BaseAdapter adapter = SettingsAdapter.newInstance(context, list);
    listView.setAdapter(adapter);
}
Also used : BaseAdapter(android.widget.BaseAdapter)

Aggregations

BaseAdapter (android.widget.BaseAdapter)42 View (android.view.View)22 AdapterView (android.widget.AdapterView)21 ViewGroup (android.view.ViewGroup)16 Adapter (android.widget.Adapter)15 TextView (android.widget.TextView)15 ListAdapter (android.widget.ListAdapter)8 ListView (android.widget.ListView)7 RemoteAdapterConnectionCallback (android.widget.RemoteViewsAdapter.RemoteAdapterConnectionCallback)7 LayoutInflater (android.view.LayoutInflater)5 Context (android.content.Context)4 AbsListView (android.widget.AbsListView)4 RecipeInformation (com.se491.chef_ly.model.RecipeInformation)4 SuppressLint (android.annotation.SuppressLint)3 Intent (android.content.Intent)3 GridView (android.widget.GridView)3 HeaderViewListAdapter (android.widget.HeaderViewListAdapter)3 ImageView (android.widget.ImageView)3 FlipViewController (com.aphidmobile.flip.FlipViewController)3 NumberTextView (com.aphidmobile.flip.demo.views.NumberTextView)3