From 5d04714eeae71e2404a3dd61b67a5348cbbc62a2 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Tue, 22 Aug 2017 01:27:29 -0500 Subject: ConfigAddActivity: Rename to AddActivity Not everything needs to start with Config Signed-off-by: Jason A. Donenfeld --- .../java/com/wireguard/android/AddActivity.java | 37 ++++++++++++++++++++++ .../java/com/wireguard/android/ConfigActivity.java | 2 +- .../com/wireguard/android/ConfigAddActivity.java | 37 ---------------------- 3 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 app/src/main/java/com/wireguard/android/AddActivity.java delete mode 100644 app/src/main/java/com/wireguard/android/ConfigAddActivity.java (limited to 'app/src/main/java/com/wireguard') diff --git a/app/src/main/java/com/wireguard/android/AddActivity.java b/app/src/main/java/com/wireguard/android/AddActivity.java new file mode 100644 index 00000000..7e31c876 --- /dev/null +++ b/app/src/main/java/com/wireguard/android/AddActivity.java @@ -0,0 +1,37 @@ +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 config) { + // This is the result of ConfigEditFragment signalling that a configuration was created. + if (config != null) + finish(); + } + + @Override + protected void onServiceAvailable() { + super.onServiceAvailable(); + final FragmentManager fm = getFragmentManager(); + if (fm.findFragmentById(R.id.master_fragment) == null) { + final FragmentTransaction transaction = fm.beginTransaction(); + transaction.add(R.id.master_fragment, new ConfigEditFragment()); + transaction.commit(); + } + } +} diff --git a/app/src/main/java/com/wireguard/android/ConfigActivity.java b/app/src/main/java/com/wireguard/android/ConfigActivity.java index 628aaeb6..e81b6c9c 100644 --- a/app/src/main/java/com/wireguard/android/ConfigActivity.java +++ b/app/src/main/java/com/wireguard/android/ConfigActivity.java @@ -169,7 +169,7 @@ public class ConfigActivity extends BaseConfigActivity { onBackPressed(); return true; case R.id.menu_action_add: - startActivity(new Intent(this, ConfigAddActivity.class)); + startActivity(new Intent(this, AddActivity.class)); return true; case R.id.menu_action_edit: // Try to make the editing fragment visible. diff --git a/app/src/main/java/com/wireguard/android/ConfigAddActivity.java b/app/src/main/java/com/wireguard/android/ConfigAddActivity.java deleted file mode 100644 index f299a67c..00000000 --- a/app/src/main/java/com/wireguard/android/ConfigAddActivity.java +++ /dev/null @@ -1,37 +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 ConfigAddActivity extends BaseConfigActivity { - @Override - public void onCreate(final Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.config_add_activity); - } - - @Override - protected void onCurrentConfigChanged(final Config config) { - // This is the result of ConfigEditFragment signalling that a configuration was created. - if (config != null) - finish(); - } - - @Override - protected void onServiceAvailable() { - super.onServiceAvailable(); - final FragmentManager fm = getFragmentManager(); - if (fm.findFragmentById(R.id.master_fragment) == null) { - final FragmentTransaction transaction = fm.beginTransaction(); - transaction.add(R.id.master_fragment, new ConfigEditFragment()); - transaction.commit(); - } - } -} -- cgit v1.2.3