summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/android/AddActivity.java
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2018-01-01 02:06:37 -0600
committerSamuel Holland <samuel@sholland.org>2018-01-06 04:09:29 -0600
commit609194fae2332e6f2ccd7a4464bfa492ad661a6f (patch)
tree96a7cd9846a093dfcdacfef285b0a4d77000edf0 /app/src/main/java/com/wireguard/android/AddActivity.java
parent4c0869393e2d8f52b9bcf312286dca8ced2e1900 (diff)
Serviceless rewrite, part 1
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/AddActivity.java')
-rw-r--r--app/src/main/java/com/wireguard/android/AddActivity.java46
1 files changed, 0 insertions, 46 deletions
diff --git a/app/src/main/java/com/wireguard/android/AddActivity.java b/app/src/main/java/com/wireguard/android/AddActivity.java
deleted file mode 100644
index 5b57e634..00000000
--- a/app/src/main/java/com/wireguard/android/AddActivity.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.wireguard.android;
-
-import android.app.FragmentManager;
-import android.app.FragmentTransaction;
-import android.os.Bundle;
-
-import com.wireguard.config.Config;
-
-/**
- * Standalone activity for creating configurations.
- */
-
-public class AddActivity extends BaseConfigActivity {
- @Override
- public void onCreate(final Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.add_activity);
- }
-
- @Override
- protected void onCurrentConfigChanged(final Config oldConfig, final Config newConfig) {
- // Do nothing (this never happens).
- }
-
- @Override
- protected void onEditingStateChanged(final boolean isEditing) {
- // Go back to the main activity once the new configuration is created.
- if (!isEditing)
- finish();
- }
-
- @Override
- protected void onServiceAvailable() {
- super.onServiceAvailable();
- final FragmentManager fm = getFragmentManager();
- ConfigEditFragment fragment = (ConfigEditFragment) fm.findFragmentById(R.id.master_fragment);
- if (fragment == null) {
- fragment = new ConfigEditFragment();
- final FragmentTransaction transaction = fm.beginTransaction();
- transaction.add(R.id.master_fragment, fragment);
- transaction.commit();
- }
- // Prime the state for the fragment to tell us it is finished.
- setIsEditing(true);
- }
-}