From 609194fae2332e6f2ccd7a4464bfa492ad661a6f Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Mon, 1 Jan 2018 02:06:37 -0600 Subject: Serviceless rewrite, part 1 Signed-off-by: Samuel Holland --- .../java/com/wireguard/android/AddActivity.java | 46 ---------------------- 1 file changed, 46 deletions(-) delete mode 100644 app/src/main/java/com/wireguard/android/AddActivity.java (limited to 'app/src/main/java/com/wireguard/android/AddActivity.java') 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); - } -} -- cgit v1.2.3