Search in sources :

Example 1 with NavDrawerAdapter

use of com.ushahidi.android.app.adapters.NavDrawerAdapter in project Ushahidi_Android by ushahidi.

the class BaseActivity method initNavDrawer.

private void initNavDrawer() {
    navDrawerAdapter = new NavDrawerAdapter(this);
    listView.setOnItemClickListener(new NavDrawerItemClickListener());
    listView.setAdapter(navDrawerAdapter);
    if (drawerLayout != null) {
        drawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
        // ActionBarDrawerToggle ties together the the proper interactions
        // between the sliding drawer and the action bar app icon
        drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.drawable.ic_drawer, R.string.open, R.string.close) {

            public void onDrawerClosed(android.view.View view) {
                getSupportActionBar().setTitle(getTitle());
                super.onDrawerClosed(view);
            }

            public void onDrawerOpened(android.view.View drawerView) {
                getSupportActionBar().setTitle(getTitle());
                super.onDrawerOpened(drawerView);
            }
        };
    }
    drawerLayout.setDrawerListener(drawerToggle);
}
Also used : NavDrawerAdapter(com.ushahidi.android.app.adapters.NavDrawerAdapter) ActionBarDrawerToggle(android.support.v4.app.ActionBarDrawerToggle)

Aggregations

ActionBarDrawerToggle (android.support.v4.app.ActionBarDrawerToggle)1 NavDrawerAdapter (com.ushahidi.android.app.adapters.NavDrawerAdapter)1