mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Remove a redundant method.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user