From d5a995ac395eed19b560f619b38307c975dabbb2 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Mon, 14 Aug 2017 19:33:19 -0500 Subject: ConfigActivity: Show back arrow in single layout action bar --- app/src/main/java/com/wireguard/android/ConfigActivity.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/src/main/java/com/wireguard') 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(); } -- cgit v1.2.3