Search in sources :

Example 1 with SimpleSectionedListAdapter

use of it.gmariotti.cardslib.demo.utils.SimpleSectionedListAdapter in project cardslib by gabrielemariotti.

the class MainActivity method _initMenu.

private void _initMenu() {
    mDrawerList = (ListView) findViewById(R.id.drawer);
    if (mDrawerList != null) {
        ArrayAdapter<String> mAdapter = new ArrayAdapter<String>(this, R.layout.demo_activity_menuitem, options);
        List<SimpleSectionedListAdapter.Section> sections = new ArrayList<SimpleSectionedListAdapter.Section>();
        sections.add(new SimpleSectionedListAdapter.Section(CASE_STD, "Card base features"));
        sections.add(new SimpleSectionedListAdapter.Section(CASE_BIRTH, "Card examples"));
        sections.add(new SimpleSectionedListAdapter.Section(CASE_LIST_BASE, "List and Grid"));
        sections.add(new SimpleSectionedListAdapter.Section(CASE_LIST_GPLAY_CAB, "Multichoice"));
        sections.add(new SimpleSectionedListAdapter.Section(CASE_CARDWITHLIST, "Misc"));
        SimpleSectionedListAdapter.Section[] dummy = new SimpleSectionedListAdapter.Section[sections.size()];
        mSectionedAdapter = new SimpleSectionedListAdapter(this, R.layout.demo_activity_menusection, mAdapter);
        mSectionedAdapter.setSections(sections.toArray(dummy));
        mDrawerList.setAdapter(mSectionedAdapter);
        mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
    }
}
Also used : ArrayList(java.util.ArrayList) SimpleSectionedListAdapter(it.gmariotti.cardslib.demo.utils.SimpleSectionedListAdapter) ArrayAdapter(android.widget.ArrayAdapter)

Example 2 with SimpleSectionedListAdapter

use of it.gmariotti.cardslib.demo.utils.SimpleSectionedListAdapter in project cardslib by gabrielemariotti.

the class MainNativeActivity method _initMenu.

private void _initMenu() {
    mDrawerList = (ListView) findViewById(R.id.drawer);
    if (mDrawerList != null) {
        ArrayAdapter<String> mAdapter = new ArrayAdapter<String>(this, R.layout.demo_activity_menuitem, options);
        List<SimpleSectionedListAdapter.Section> sections = new ArrayList<SimpleSectionedListAdapter.Section>();
        sections.add(new SimpleSectionedListAdapter.Section(CASE_STD, "Card base features"));
        sections.add(new SimpleSectionedListAdapter.Section(CASE_BIRTH, "Card examples"));
        sections.add(new SimpleSectionedListAdapter.Section(CASE_LIST_BASE, "List and Grid"));
        sections.add(new SimpleSectionedListAdapter.Section(CASE_LIST_GPLAY_CAB, "Multichoice"));
        sections.add(new SimpleSectionedListAdapter.Section(CASE_CARDWITHLIST, "Misc"));
        SimpleSectionedListAdapter.Section[] dummy = new SimpleSectionedListAdapter.Section[sections.size()];
        mSectionedAdapter = new SimpleSectionedListAdapter(this, R.layout.demo_activity_menusection, mAdapter);
        mSectionedAdapter.setSections(sections.toArray(dummy));
        mDrawerList.setAdapter(mSectionedAdapter);
        mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
    }
}
Also used : ArrayList(java.util.ArrayList) SimpleSectionedListAdapter(it.gmariotti.cardslib.demo.utils.SimpleSectionedListAdapter) ArrayAdapter(android.widget.ArrayAdapter)

Aggregations

ArrayAdapter (android.widget.ArrayAdapter)2 SimpleSectionedListAdapter (it.gmariotti.cardslib.demo.utils.SimpleSectionedListAdapter)2 ArrayList (java.util.ArrayList)2