Search in sources :

Example 1 with DrawerListAdapter

use of com.lguipeng.notes.adpater.DrawerListAdapter in project Notes by lguipeng.

the class MainActivity method initDrawerView.

@Override
public void initDrawerView(List<String> list) {
    SimpleListAdapter adapter = new DrawerListAdapter(this, list);
    mDrawerMenuListView.setAdapter(adapter);
    mDrawerMenuListView.setOnItemClickListener((AdapterView<?> parent, View view, int position, long id) -> mainPresenter.onDrawerItemSelect(position));
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, 0, 0) {

        @Override
        public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);
            invalidateOptionsMenu();
            mainPresenter.onDrawerOpened();
        }

        @Override
        public void onDrawerClosed(View drawerView) {
            super.onDrawerClosed(drawerView);
            invalidateOptionsMenu();
            mainPresenter.onDrawerClosed();
        }
    };
    mDrawerToggle.setDrawerIndicatorEnabled(true);
    mDrawerLayout.setDrawerListener(mDrawerToggle);
    mDrawerLayout.setScrimColor(getCompactColor(R.color.drawer_scrim_color));
}
Also used : SimpleListAdapter(com.lguipeng.notes.adpater.SimpleListAdapter) ActionBarDrawerToggle(android.support.v7.app.ActionBarDrawerToggle) AdapterView(android.widget.AdapterView) DrawerListAdapter(com.lguipeng.notes.adpater.DrawerListAdapter) SearchView(android.support.v7.widget.SearchView) View(android.view.View) AdapterView(android.widget.AdapterView) MainView(com.lguipeng.notes.mvp.views.impl.MainView) RecyclerView(android.support.v7.widget.RecyclerView) ListView(android.widget.ListView)

Aggregations

ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)1 RecyclerView (android.support.v7.widget.RecyclerView)1 SearchView (android.support.v7.widget.SearchView)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ListView (android.widget.ListView)1 DrawerListAdapter (com.lguipeng.notes.adpater.DrawerListAdapter)1 SimpleListAdapter (com.lguipeng.notes.adpater.SimpleListAdapter)1 MainView (com.lguipeng.notes.mvp.views.impl.MainView)1