Skip to content
Snippets Groups Projects
Verified Commit 9a5a1489 authored by akwizgran's avatar akwizgran
Browse files

Remove a redundant method.

parent 648793e0
No related branches found
No related tags found
No related merge requests found
...@@ -112,15 +112,17 @@ public class PasswordFragment extends SetupFragment { ...@@ -112,15 +112,17 @@ public class PasswordFragment extends SetupFragment {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
if (!setupController.needToShowDozeFragment()) {
nextButton.setVisibility(INVISIBLE);
progressBar.setVisibility(VISIBLE);
}
IBinder token = passwordEntry.getWindowToken(); IBinder token = passwordEntry.getWindowToken();
Object o = getContext().getSystemService(INPUT_METHOD_SERVICE); Object o = getContext().getSystemService(INPUT_METHOD_SERVICE);
((InputMethodManager) o).hideSoftInputFromWindow(token, 0); ((InputMethodManager) o).hideSoftInputFromWindow(token, 0);
setupController.setPassword(passwordEntry.getText().toString()); 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 { ...@@ -22,10 +22,9 @@ public interface SetupController {
/** /**
* This should be called after the author name and the password have been * 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 * set.
* right away.
*/ */
void showDozeFragmentOrCreateAccount(); void showDozeFragment();
/** /**
* This should be called after the author name and the password have been * This should be called after the author name and the password have been
......
...@@ -63,10 +63,9 @@ public class SetupControllerImpl extends PasswordControllerImpl ...@@ -63,10 +63,9 @@ public class SetupControllerImpl extends PasswordControllerImpl
} }
@Override @Override
public void showDozeFragmentOrCreateAccount() { public void showDozeFragment() {
if (setupActivity == null) throw new IllegalStateException(); if (setupActivity == null) throw new IllegalStateException();
if (needToShowDozeFragment()) setupActivity.showDozeFragment(); setupActivity.showDozeFragment();
else createAccount();
} }
@Override @Override
......
...@@ -73,7 +73,7 @@ public class PasswordFragmentTest { ...@@ -73,7 +73,7 @@ public class PasswordFragmentTest {
// assert controller has been called properly // assert controller has been called properly
verify(setupController, times(1)).setPassword(safePass); verify(setupController, times(1)).setPassword(safePass);
verify(setupController, times(1)).showDozeFragmentOrCreateAccount(); verify(setupController, times(1)).createAccount();
} }
@Test @Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment