use of org.hisp.dhis.client.sdk.ui.views.FontButton in project pictureapp by EyeSeeTea.
the class LoginActivityStrategy method addDemoButton.
private void addDemoButton() {
final ViewGroup loginViewsContainer = (ViewGroup) loginActivity.findViewById(R.id.login_dynamic_views_container);
loginActivity.getLayoutInflater().inflate(R.layout.demo_login_button, loginViewsContainer, true);
FontButton demoButton = (FontButton) loginActivity.findViewById(R.id.demo_login_button);
demoButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Credentials demoCrededentials = Credentials.createDemoCredentials();
loginActivity.showProgressBar();
loginActivity.mLoginUseCase.execute(demoCrededentials, new ALoginUseCase.Callback() {
@Override
public void onLoginSuccess() {
executePullDemo();
}
@Override
public void onServerURLNotValid() {
Log.e(this.getClass().getSimpleName(), "Server url not valid");
}
@Override
public void onInvalidCredentials() {
Log.e(this.getClass().getSimpleName(), "Invalid credentials");
}
@Override
public void onNetworkError() {
Log.e(this.getClass().getSimpleName(), "Network Error");
}
@Override
public void onConfigJsonInvalid() {
Log.d(TAG, "onConfigJsonInvalid");
}
@Override
public void onUnexpectedError() {
Log.e(this.getClass().getSimpleName(), "Config Json file not found");
}
@Override
public void onMaxLoginAttemptsReachedError() {
Log.d(TAG, "onMaxLoginAttemptsReachedError");
}
});
}
});
}
Aggregations