summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2017-08-13 06:22:31 -0500
committerSamuel Holland <samuel@sholland.org>2017-08-13 06:22:31 -0500
commitf84d178e4693dac9231a46244dd6a346c7615157 (patch)
treef87c4f924ee0713cfcd9e007166ebfeace680c16
parent43500090b2ed4b3dec2749d4c75468b524a51f1a (diff)
ProfileActivity: Remove unnecessary parameterization
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--app/src/main/java/com/wireguard/android/ProfileListActivity.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/src/main/java/com/wireguard/android/ProfileListActivity.java b/app/src/main/java/com/wireguard/android/ProfileListActivity.java
index 31f845c2..49651201 100644
--- a/app/src/main/java/com/wireguard/android/ProfileListActivity.java
+++ b/app/src/main/java/com/wireguard/android/ProfileListActivity.java
@@ -34,10 +34,9 @@ public class ProfileListActivity extends ProfileActivity {
transaction.remove(detailFragment);
}
transaction.commit();
+ onProfileSelected(getCurrentProfile());
if (isEditing())
startEditing();
- else
- onProfileSelected(getCurrentProfile());
}
@Override
@@ -62,8 +61,8 @@ public class ProfileListActivity extends ProfileActivity {
if (isEditing())
getFragmentManager().popBackStack();
setIsEditing(false);
- updateLayout(profile);
setCurrentProfile(profile);
+ updateLayout();
} else if (profile != null) {
final Intent intent = new Intent(this, ProfileDetailActivity.class);
intent.putExtra(KEY_PROFILE_NAME, profile);
@@ -75,7 +74,7 @@ public class ProfileListActivity extends ProfileActivity {
private void startEditing() {
if (isSplitLayout) {
setIsEditing(true);
- updateLayout(getCurrentProfile());
+ updateLayout();
} else if (getCurrentProfile() != null) {
final Intent intent = new Intent(this, ProfileEditActivity.class);
intent.putExtra(KEY_PROFILE_NAME, getCurrentProfile());
@@ -85,8 +84,9 @@ public class ProfileListActivity extends ProfileActivity {
}
}
- public void updateLayout(String profile) {
+ private void updateLayout() {
final Fragment fragment = getFragmentManager().findFragmentById(R.id.fragment_container);
+ final String profile = getCurrentProfile();
if (isEditing()) {
if (fragment instanceof ProfileEditFragment) {
final ProfileEditFragment editFragment = (ProfileEditFragment) fragment;