diff options
author | Samuel Holland <samuel@sholland.org> | 2017-08-14 19:33:19 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-08-14 19:33:19 -0500 |
commit | d91770a1b620233b7e261bd1f56a53c520bdc969 (patch) | |
tree | 2531cb99ab43c36e44c9f89e2216a690a35d3ccd /app/src/main | |
parent | 6604be94ebd82a3b2cdcf4f78001e36946cec622 (diff) |
ConfigActivity: Show back arrow in single layout action bar
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/com/wireguard/android/ConfigActivity.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/ConfigActivity.java b/app/src/main/java/com/wireguard/android/ConfigActivity.java index 4a19c681..084f6c08 100644 --- a/app/src/main/java/com/wireguard/android/ConfigActivity.java +++ b/app/src/main/java/com/wireguard/android/ConfigActivity.java @@ -35,6 +35,8 @@ public class ConfigActivity extends BaseConfigActivity { isEditing = false; else setCurrentConfig(null); + if (!isSplitLayout && fm.getBackStackEntryCount() == 0 && getActionBar() != null) + getActionBar().setDisplayHomeAsUpEnabled(false); } @Override @@ -80,6 +82,9 @@ public class ConfigActivity extends BaseConfigActivity { @Override public boolean onOptionsItemSelected(final MenuItem item) { switch (item.getItemId()) { + case android.R.id.home: + onBackPressed(); + return true; case R.id.menu_action_edit: switchToFragment(mainContainer, TAG_EDIT, true); isEditing = true; @@ -168,6 +173,8 @@ public class ConfigActivity extends BaseConfigActivity { if (push) { transaction.addToBackStack(null); transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); + if (!isSplitLayout && getActionBar() != null) + getActionBar().setDisplayHomeAsUpEnabled(true); } transaction.replace(container, fragment, null).commit(); } |