Advertisement
Guest User

Untitled

a guest
Jan 31st, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. {email=false, username=false, password=false, firmcode=false}
  2.  
  3. inputValidityMap.put(getResources().getString(R.string.password_tag), true);
  4.  
  5. if (connectivityObserver.getConnectivityStatus(getActivity()) != AppConfig.NO_CONNECTION) {
  6. Call<UserConnectionStaff> call = apiService.isPasswordValid(getResources().getString(R.string.passwordValidation), registerPasswordEdt.getText().toString());
  7. call.enqueue(new Callback<UserConnectionStaff>() {
  8. @Override
  9. public void onResponse(Response<UserConnectionStaff> response, Retrofit retrofit) {
  10. int resource_message = inputValidationCodes.get(response.body().getError_code());
  11. if (isAdded()) {
  12. if (response.body().getError_code() != AppConfig.INPUT_OK) {
  13. if (response.body().getError_code() == AppConfig.ERROR_INVALID_INPUT) {
  14. passwordErrorTtv.setText(commonElements.decodeUtf8(commonElements.encodeUtf8(getResources().getString(resource_message))));
  15. } else {
  16. passwordErrorTtv.setText(commonElements.decodeUtf8(commonElements.encodeUtf8(getResources().getString(resource_message))));
  17. }
  18. } else {
  19. animationStaff(acceptPasswordRlt, 0.0f, 1.0f, "visible");
  20. animationStaff(showHidePasswordTtv, 1.0f, 0.0f, "gone");
  21. Log.d(debugTag, inputValidityMap.containsKey(getResources().getString(R.string.password_tag)) + "");
  22. **inputValidityMap.put(getResources().getString(R.string.password_tag), true);**
  23. }
  24. }
  25. }
  26. @Override
  27. public void onFailure(Throwable t) {
  28. if (isAdded()) {
  29. if (t instanceof IOException) {
  30. setToastHelperMsg(getResources().getString(R.string.unavailable_service));
  31. } else {
  32. setToastHelperMsg(getResources().getString(R.string.error_occured));
  33. }
  34. registerUsernameEdt.setText(null);
  35. progressViewActions("stop", usernameProgressView);
  36. }
  37. }
  38. });
  39. } else {
  40. if ( isAdded() ) setToastHelperMsg(getResources().getString(R.string.no_connection));
  41. }
  42. **Log.d(debugTag, inputValidityMap.toString());**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement