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