Skip to content

Commit

Permalink
fixed menu button bug
Browse files Browse the repository at this point in the history
clicking menu button did not change title, now it does
  • Loading branch information
David Harmon authored and David Harmon committed Feb 17, 2015
1 parent 94d3a04 commit 5ec7e52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void onNavigationDrawerItemSelected(int position) {
mFragmentManager.beginTransaction()
.replace(R.id.container, mFragmentStartGame)
.commit();
onSectionAttached(NavigationDrawerFragment.START_TAB_ID);
mFragmentStartBasketBallGame = null; // no leaks
break;

Expand All @@ -71,6 +72,9 @@ public void onNavigationDrawerItemSelected(int position) {
mFragmentStartBasketBallGame = null; // no leaks
break;
}


restoreActionBar();
}

public void onSectionAttached(int number) {
Expand Down Expand Up @@ -168,6 +172,7 @@ public void onMenuItemPressed(MenuItem item){
mFragmentManager.beginTransaction()
.replace(R.id.container, mFragmentStartGame)
.commit();
mNavigationDrawerFragment.selectItem(NavigationDrawerFragment.START_TAB_ID);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public void run() {
mDrawerLayout.setDrawerListener(mDrawerToggle);
}

private void selectItem(int position) {
public void selectItem(int position) {
mCurrentSelectedPosition = position;
if (mDrawerListView != null) {
mDrawerListView.setItemChecked(position, true);
Expand Down Expand Up @@ -282,7 +282,7 @@ private void showGlobalContextActionBar() {
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setTitle(R.string.app_name);
//actionBar.setTitle(R.string.app_name);
}

private ActionBar getActionBar() {
Expand Down

0 comments on commit 5ec7e52

Please sign in to comment.