Пример #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);
   }
 }
Пример #2
0
  @Override
  protected void onResume() {
    super.onResume();

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

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