summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2017-08-14 19:33:19 -0500
committerSamuel Holland <samuel@sholland.org>2017-08-14 19:33:19 -0500
commitd5a995ac395eed19b560f619b38307c975dabbb2 (patch)
tree2531cb99ab43c36e44c9f89e2216a690a35d3ccd /app/src/main/java/com/wireguard
parentab6f964ab5d2b72f5945eebdd1f0d056e8d87bfe (diff)
ConfigActivity: Show back arrow in single layout action bar
Diffstat (limited to 'app/src/main/java/com/wireguard')
-rw-r--r--app/src/main/java/com/wireguard/android/ConfigActivity.java7
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();
}