kanytu / android-material-drawer-template

An Android template with navigation drawer for material design
Apache License 2.0
674 stars 217 forks source link

Why is selectItem not public? #32

Closed surfer190 closed 9 years ago

surfer190 commented 9 years ago
void selectItem(int position) {

Why is this not public?

File: NavigationDrawerFragment.java Line: 147

kanytu commented 9 years ago

For the same reason google uses it as a private method: {sdk}\tools\templates\activities\NavigationDrawerActivity\root\src\app_package\NavigationDrawerFragment.java.ftl

Line 191:

private void selectItem(int position) {
    mCurrentSelectedPosition = position;
    if (mDrawerListView != null) {
        mDrawerListView.setItemChecked(position, true);
    }
    if (mDrawerLayout != null) {
        mDrawerLayout.closeDrawer(mFragmentContainerView);
    }
    if (mCallbacks != null) {
        mCallbacks.onNavigationDrawerItemSelected(position);
    }
}

However, just like any template, feel free to change it to public.