ProfileActivity: Remove unnecessary parameterization

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Samuel Holland 2017-08-13 06:22:31 -05:00
parent 43500090b2
commit f84d178e46

View File

@ -34,10 +34,9 @@ public class ProfileListActivity extends ProfileActivity {
transaction.remove(detailFragment); transaction.remove(detailFragment);
} }
transaction.commit(); transaction.commit();
onProfileSelected(getCurrentProfile());
if (isEditing()) if (isEditing())
startEditing(); startEditing();
else
onProfileSelected(getCurrentProfile());
} }
@Override @Override
@ -62,8 +61,8 @@ public class ProfileListActivity extends ProfileActivity {
if (isEditing()) if (isEditing())
getFragmentManager().popBackStack(); getFragmentManager().popBackStack();
setIsEditing(false); setIsEditing(false);
updateLayout(profile);
setCurrentProfile(profile); setCurrentProfile(profile);
updateLayout();
} else if (profile != null) { } else if (profile != null) {
final Intent intent = new Intent(this, ProfileDetailActivity.class); final Intent intent = new Intent(this, ProfileDetailActivity.class);
intent.putExtra(KEY_PROFILE_NAME, profile); intent.putExtra(KEY_PROFILE_NAME, profile);
@ -75,7 +74,7 @@ public class ProfileListActivity extends ProfileActivity {
private void startEditing() { private void startEditing() {
if (isSplitLayout) { if (isSplitLayout) {
setIsEditing(true); setIsEditing(true);
updateLayout(getCurrentProfile()); updateLayout();
} else if (getCurrentProfile() != null) { } else if (getCurrentProfile() != null) {
final Intent intent = new Intent(this, ProfileEditActivity.class); final Intent intent = new Intent(this, ProfileEditActivity.class);
intent.putExtra(KEY_PROFILE_NAME, getCurrentProfile()); 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 Fragment fragment = getFragmentManager().findFragmentById(R.id.fragment_container);
final String profile = getCurrentProfile();
if (isEditing()) { if (isEditing()) {
if (fragment instanceof ProfileEditFragment) { if (fragment instanceof ProfileEditFragment) {
final ProfileEditFragment editFragment = (ProfileEditFragment) fragment; final ProfileEditFragment editFragment = (ProfileEditFragment) fragment;