Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {email=false, username=false, password=false, firmcode=false}
- inputValidityMap.put(getResources().getString(R.string.password_tag), true);
- if (connectivityObserver.getConnectivityStatus(getActivity()) != AppConfig.NO_CONNECTION) {
- Call<UserConnectionStaff> call = apiService.isPasswordValid(getResources().getString(R.string.passwordValidation), registerPasswordEdt.getText().toString());
- call.enqueue(new Callback<UserConnectionStaff>() {
- @Override
- public void onResponse(Response<UserConnectionStaff> response, Retrofit retrofit) {
- int resource_message = inputValidationCodes.get(response.body().getError_code());
- if (isAdded()) {
- if (response.body().getError_code() != AppConfig.INPUT_OK) {
- if (response.body().getError_code() == AppConfig.ERROR_INVALID_INPUT) {
- passwordErrorTtv.setText(commonElements.decodeUtf8(commonElements.encodeUtf8(getResources().getString(resource_message))));
- } else {
- passwordErrorTtv.setText(commonElements.decodeUtf8(commonElements.encodeUtf8(getResources().getString(resource_message))));
- }
- } else {
- animationStaff(acceptPasswordRlt, 0.0f, 1.0f, "visible");
- animationStaff(showHidePasswordTtv, 1.0f, 0.0f, "gone");
- Log.d(debugTag, inputValidityMap.containsKey(getResources().getString(R.string.password_tag)) + "");
- **inputValidityMap.put(getResources().getString(R.string.password_tag), true);**
- }
- }
- }
- @Override
- public void onFailure(Throwable t) {
- if (isAdded()) {
- if (t instanceof IOException) {
- setToastHelperMsg(getResources().getString(R.string.unavailable_service));
- } else {
- setToastHelperMsg(getResources().getString(R.string.error_occured));
- }
- registerUsernameEdt.setText(null);
- progressViewActions("stop", usernameProgressView);
- }
- }
- });
- } else {
- if ( isAdded() ) setToastHelperMsg(getResources().getString(R.string.no_connection));
- }
- **Log.d(debugTag, inputValidityMap.toString());**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement