Fixed clicking up arrow
This commit is contained in:
parent
ca09df5b1a
commit
78b26fefb5
|
@ -182,13 +182,12 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSupportActionBar(@Nullable Toolbar toolbar) {
|
public void setSupportActionBar(@Nullable Toolbar toolbar) {
|
||||||
super.setSupportActionBar(toolbar);
|
|
||||||
|
|
||||||
drawerLayout.removeDrawerListener(drawerToggle);
|
drawerLayout.removeDrawerListener(drawerToggle);
|
||||||
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar,
|
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar,
|
||||||
R.string.drawer_open, R.string.drawer_close);
|
R.string.drawer_open, R.string.drawer_close);
|
||||||
drawerLayout.addDrawerListener(drawerToggle);
|
drawerLayout.addDrawerListener(drawerToggle);
|
||||||
drawerToggle.syncState();
|
drawerToggle.syncState();
|
||||||
|
super.setSupportActionBar(toolbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveLastNavFragment(String tag) {
|
private void saveLastNavFragment(String tag) {
|
||||||
|
@ -368,10 +367,6 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
|
||||||
loadChildFragment(fragment, TransitionEffect.NONE);
|
loadChildFragment(fragment, TransitionEffect.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dismissChildFragment() {
|
|
||||||
getSupportFragmentManager().popBackStack();
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getSelectedNavListIndex() {
|
private int getSelectedNavListIndex() {
|
||||||
String currentFragment = getLastNavFragment();
|
String currentFragment = getLastNavFragment();
|
||||||
if(currentFragment == null) {
|
if(currentFragment == null) {
|
||||||
|
@ -523,7 +518,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
|
||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == android.R.id.home) {
|
} else if (item.getItemId() == android.R.id.home) {
|
||||||
if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
|
if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
|
||||||
dismissChildFragment();
|
getSupportFragmentManager().popBackStack();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue