Search in sources :

Example 1 with NavDrawerItem

use of com.thebluealliance.androidclient.listitems.NavDrawerItem in project the-blue-alliance-android by the-blue-alliance.

the class NavigationDrawerFragment method navigationItemClicked.

/**
 * Called when an item in the navigation drawer is clicked
 *
 * @param position The position of the clicked item
 */
private void navigationItemClicked(int position) {
    ListItem item = mNavigationAdapter.getItem(position);
    // Ignore clicks on items like dividers and spacers
    if (!(item instanceof NavDrawerItem)) {
        return;
    }
    if (mDrawerListView != null) {
        mDrawerListView.setItemChecked(position, true);
    }
    mListener.onNavDrawerItemClicked((NavDrawerItem) item);
    if (mDrawerLayout != null) {
        mDrawerLayout.closeDrawer(mFragmentContainerView);
    }
}
Also used : DividerListItem(com.thebluealliance.androidclient.listitems.DividerListItem) SpacerListItem(com.thebluealliance.androidclient.listitems.SpacerListItem) ListItem(com.thebluealliance.androidclient.listitems.ListItem) NavDrawerItem(com.thebluealliance.androidclient.listitems.NavDrawerItem)

Aggregations

DividerListItem (com.thebluealliance.androidclient.listitems.DividerListItem)1 ListItem (com.thebluealliance.androidclient.listitems.ListItem)1 NavDrawerItem (com.thebluealliance.androidclient.listitems.NavDrawerItem)1 SpacerListItem (com.thebluealliance.androidclient.listitems.SpacerListItem)1