예제 #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);
   }
 }