diff options
author | Samuel Holland <samuel@sholland.org> | 2017-08-13 06:22:31 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-08-13 06:22:31 -0500 |
commit | 04a5672c6b1d3ab037de15f9cbc3c841c5111218 (patch) | |
tree | f87c4f924ee0713cfcd9e007166ebfeace680c16 /app/src/main/java/com | |
parent | b549e0a4239a0704345fb50acae217c831ee591b (diff) |
ProfileActivity: Remove unnecessary parameterization
Diffstat (limited to 'app/src/main/java/com')
-rw-r--r-- | app/src/main/java/com/wireguard/android/ProfileListActivity.java | 10 |
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; |