Created
February 18, 2016 20:34
-
-
Save mnisbet13/68a40dd524a005da52ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onBackPressed() { | |
if (getChildFragmentManager().popBackStackImmediate()) { | |
BaseDialogFragment bdf = (BaseDialogFragment) getChildFragmentManager().getFragments() | |
.get(getChildFragmentManager().getFragments().size() — 1); | |
String title = getString(R.string.account_info); | |
if (bdf == null && getChildFragmentManager().findFragmentByTag(getString(R.string.order_history)) != null && getChildFragmentManager().findFragmentByTag(getString(R.string.order_history)).isVisible()) { | |
title = getString(R.string.order_history); | |
} | |
if (bdf != null) { | |
title = getNewTitle(bdf.getTitle()); | |
} | |
mToolbar.setTitle(title); | |
if (title.equals(getString(R.string.account_info))) { | |
mToolbar.setNavigationIcon(R.drawable.ic_close_selector); | |
} | |
} else { | |
EmbeddedDialogFragment.this.dismiss(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment