Esempio n. 1
0
 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);
   }
 }
Esempio n. 2
0
  @Override
  protected void onResume() {
    super.onResume();

    if (!context.IsUserLoggedOut()) {
      goToHome();
    }

    fillUserIfExists();
  }
Esempio n. 3
0
 private void updateRegisterCounts() {
   NativeUpdateANMDetailsTask task =
       new NativeUpdateANMDetailsTask(Context.getInstance().anmController());
   task.fetch(
       new NativeAfterANMDetailsFetchListener() {
         @Override
         public void afterFetch(HomeContext anmDetails) {
           updateRegisterCounts(anmDetails);
         }
       });
 }
Esempio n. 4
0
  @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();
  }
Esempio n. 5
0
  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);
    }
  }
Esempio n. 6
0
 @Override
 public String name() {
   return Context.getInstance().getStringResource(R.string.str_anc_search_hint);
 }
Esempio n. 7
0
 private void remoteLoginWith(String userName, String password, String userInfo) {
   context.userService().remoteLogin(userName, password, userInfo);
   goToHome();
   DrishtiSyncScheduler.startOnlyIfConnectedToNetwork(getApplicationContext());
 }
Esempio n. 8
0
 private void fillUserIfExists() {
   if (context.userService().hasARegisteredUser()) {
     userNameEditText.setText(context.allSharedPreferences().fetchRegisteredANM());
     userNameEditText.setEnabled(false);
   }
 }