private void localLogin(View view, String userName, String password) { if (context.userService().isValidLocalLogin(userName, password)) { localLoginWith(userName, password); } else { showErrorDialog(getString(R.string.login_failed_dialog_message)); view.setClickable(true); } }
@Override protected void onResume() { super.onResume(); if (!context.IsUserLoggedOut()) { goToHome(); } fillUserIfExists(); }
private void updateRegisterCounts() { NativeUpdateANMDetailsTask task = new NativeUpdateANMDetailsTask(Context.getInstance().anmController()); task.fetch( new NativeAfterANMDetailsFetchListener() { @Override public void afterFetch(HomeContext anmDetails) { updateRegisterCounts(anmDetails); } }); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); logVerbose("Initializing ..."); setContentView(R.layout.login); context = Context.getInstance().updateApplicationContext(this.getApplicationContext()); initializeLoginFields(); initializeBuildDetails(); setDoneActionHandlerOnPasswordField(); initializeProgressDialog(); }
public void login(final View view) { hideKeyboard(); view.setClickable(false); final String userName = userNameEditText.getText().toString(); final String password = passwordEditText.getText().toString(); if (context.userService().hasARegisteredUser()) { localLogin(view, userName, password); } else { remoteLogin(view, userName, password); } }
@Override public String name() { return Context.getInstance().getStringResource(R.string.str_anc_search_hint); }
private void remoteLoginWith(String userName, String password, String userInfo) { context.userService().remoteLogin(userName, password, userInfo); goToHome(); DrishtiSyncScheduler.startOnlyIfConnectedToNetwork(getApplicationContext()); }
private void fillUserIfExists() { if (context.userService().hasARegisteredUser()) { userNameEditText.setText(context.allSharedPreferences().fetchRegisteredANM()); userNameEditText.setEnabled(false); } }