Verified Commit 9a5a1489 authored by akwizgran's avatar akwizgran

Remove a redundant method.

parent 648793e0
Pipeline #1482 passed with stage
in 13 minutes and 18 seconds
......@@ -112,15 +112,17 @@ public class PasswordFragment extends SetupFragment {
@Override
public void onClick(View view) {
if (!setupController.needToShowDozeFragment()) {
nextButton.setVisibility(INVISIBLE);
progressBar.setVisibility(VISIBLE);
}
IBinder token = passwordEntry.getWindowToken();
Object o = getContext().getSystemService(INPUT_METHOD_SERVICE);
((InputMethodManager) o).hideSoftInputFromWindow(token, 0);
setupController.setPassword(passwordEntry.getText().toString());
setupController.showDozeFragmentOrCreateAccount();
if (setupController.needToShowDozeFragment()) {
setupController.showDozeFragment();
} else {
nextButton.setVisibility(INVISIBLE);
progressBar.setVisibility(VISIBLE);
setupController.createAccount();
}
}
}
......@@ -22,10 +22,9 @@ public interface SetupController {
/**
* This should be called after the author name and the password have been
* set. It decides whether to show the doze fragment or create the account
* right away.
* set.
*/
void showDozeFragmentOrCreateAccount();
void showDozeFragment();
/**
* This should be called after the author name and the password have been
......
......@@ -63,10 +63,9 @@ public class SetupControllerImpl extends PasswordControllerImpl
}
@Override
public void showDozeFragmentOrCreateAccount() {
public void showDozeFragment() {
if (setupActivity == null) throw new IllegalStateException();
if (needToShowDozeFragment()) setupActivity.showDozeFragment();
else createAccount();
setupActivity.showDozeFragment();
}
@Override
......
......@@ -73,7 +73,7 @@ public class PasswordFragmentTest {
// assert controller has been called properly
verify(setupController, times(1)).setPassword(safePass);
verify(setupController, times(1)).showDozeFragmentOrCreateAccount();
verify(setupController, times(1)).createAccount();
}
@Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment