Created
April 11, 2017 06:45
-
-
Save ecgreb/ed4d1d9d1dcbfdf390e92d7966b69fdd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LoginPresenter { | |
private LoginController loginController; | |
private AccountValidator accountValidator; | |
public LoginPresenter(AccountValidator accountValidator) { | |
this.accountValidator = accountValidator; | |
} | |
public void register(LoginController loginController) { | |
this.loginController = loginController; | |
} | |
public void onLoginButtonClick(String username, String password) { | |
loginController.showProgress(true); | |
accountValidator.validate(username, password, new AccountValidator.Callback() { | |
@Override public void onValidationComplete(boolean success) { | |
loginController.showProgress(false); | |
if (success) { | |
loginController.finishAndStartMainActivity(); | |
} else { | |
loginController.showError(); | |
} | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment