|
|
@@ -69,17 +69,17 @@ public class MobileAuthorizationPresenter {
|
|
|
|
|
|
resetInputAll();
|
|
|
|
|
|
- if (AppUtil.isDebug()) {
|
|
|
- userBean.setName("민효동");
|
|
|
- userBean.setBirthDate("19190101");
|
|
|
- userBean.setPhoneNumber("37037037");
|
|
|
- userBean.setAgree(0, true);
|
|
|
- userBean.setAgree(1, true);
|
|
|
- userBean.setAgree(2, true);
|
|
|
- userBean.setAgree(3, true);
|
|
|
-
|
|
|
- verifyRequestNumberButton();
|
|
|
- }
|
|
|
+// if (AppUtil.isDebug()) {
|
|
|
+// userBean.setName("민효동");
|
|
|
+// userBean.setBirthDate("19190101");
|
|
|
+// userBean.setPhoneNumber("37037037");
|
|
|
+// userBean.setAgree(0, true);
|
|
|
+// userBean.setAgree(1, true);
|
|
|
+// userBean.setAgree(2, true);
|
|
|
+// userBean.setAgree(3, true);
|
|
|
+//
|
|
|
+// verifyRequestNumberButton();
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
public void dispose() {
|
|
|
@@ -128,6 +128,7 @@ public class MobileAuthorizationPresenter {
|
|
|
Log.i("APP# MobileAuthorizationPresenter | doNameValidationMessage", "|" + inputName);
|
|
|
|
|
|
userBean.setName(inputName);
|
|
|
+ verifyName(userBean.getName(), true);
|
|
|
verifyRequestNumberButton();
|
|
|
}
|
|
|
|
|
|
@@ -138,6 +139,7 @@ public class MobileAuthorizationPresenter {
|
|
|
*/
|
|
|
public void onFocusNameText(boolean isFocusChanged) {
|
|
|
if (isFocusChanged) {
|
|
|
+ verifyName(userBean.getName(), true);
|
|
|
verifyRequestNumberButton();
|
|
|
}
|
|
|
else {
|
|
|
@@ -155,6 +157,7 @@ public class MobileAuthorizationPresenter {
|
|
|
Log.i("APP# MobileAuthorizationPresenter | onBirthDateTextChanged", "|" + inputBirthDate);
|
|
|
|
|
|
userBean.setBirthDate(inputBirthDate);
|
|
|
+ verifyBirthDate(userBean.getBirthDate(), true);
|
|
|
verifyRequestNumberButton();
|
|
|
}
|
|
|
|
|
|
@@ -165,6 +168,7 @@ public class MobileAuthorizationPresenter {
|
|
|
*/
|
|
|
public void onFocusBirthDateText(boolean isFocusChanged) {
|
|
|
if (isFocusChanged) {
|
|
|
+ verifyBirthDate(userBean.getBirthDate(), true);
|
|
|
verifyRequestNumberButton();
|
|
|
}
|
|
|
else {
|
|
|
@@ -181,6 +185,7 @@ public class MobileAuthorizationPresenter {
|
|
|
Log.i("APP# MobileAuthorizationPresenter | onPhoneNumberCheckedValidationMessage", "|" + phoneNumber);
|
|
|
|
|
|
userBean.setPhoneNumber(phoneNumber);
|
|
|
+ verifyPhoneNumber(userBean.getPhoneNumber(), true);
|
|
|
verifyRequestNumberButton();
|
|
|
}
|
|
|
|
|
|
@@ -191,6 +196,7 @@ public class MobileAuthorizationPresenter {
|
|
|
*/
|
|
|
public void onFocusPhoneNumberText(boolean isFocusChanged) {
|
|
|
if (isFocusChanged) {
|
|
|
+ verifyPhoneNumber(userBean.getPhoneNumber(), true);
|
|
|
verifyRequestNumberButton();
|
|
|
}
|
|
|
else {
|
|
|
@@ -448,22 +454,22 @@ public class MobileAuthorizationPresenter {
|
|
|
|
|
|
private void verifyRequestNumberButton() {
|
|
|
|
|
|
- boolean isValidated = verifyRequestNumberValidation();
|
|
|
+ boolean isValidated = verifyRequestNumberValidation(false);
|
|
|
|
|
|
view.setEnabledRequestNumberButton(isValidated);
|
|
|
}
|
|
|
|
|
|
- private boolean verifyRequestNumberValidation() {
|
|
|
+ private boolean verifyRequestNumberValidation(boolean isDisplay) {
|
|
|
boolean isValidated = true;
|
|
|
- if (verifyName(userBean.getName()) == false) {
|
|
|
+ if (verifyName(userBean.getName(), isDisplay) == false) {
|
|
|
isValidated = false;
|
|
|
}
|
|
|
|
|
|
- if (verifyBirthDate(userBean.getBirthDate()) == false) {
|
|
|
+ if (verifyBirthDate(userBean.getBirthDate(), isDisplay) == false) {
|
|
|
isValidated = false;
|
|
|
}
|
|
|
|
|
|
- if (verifyPhoneNumber(userBean.getPhoneNumber()) == false) {
|
|
|
+ if (verifyPhoneNumber(userBean.getPhoneNumber(), isDisplay) == false) {
|
|
|
isValidated = false;
|
|
|
}
|
|
|
|
|
|
@@ -486,7 +492,7 @@ public class MobileAuthorizationPresenter {
|
|
|
* - 통과하면 api 호출
|
|
|
*/
|
|
|
|
|
|
- boolean isValidated = verifyRequestNumberValidation();
|
|
|
+ boolean isValidated = verifyRequestNumberValidation(true);
|
|
|
|
|
|
if (isValidated) {
|
|
|
// call api...
|
|
|
@@ -545,7 +551,7 @@ public class MobileAuthorizationPresenter {
|
|
|
private void doSomeWhenSendingSuccess() {
|
|
|
view.setEnabledRequestConfirmTextView(true);
|
|
|
|
|
|
- showSendingPopup(R.string.phone_identify_submit_message_success);
|
|
|
+// showSendingPopup(R.string.phone_identify_submit_message_success);
|
|
|
|
|
|
view.showRemainTime(true);
|
|
|
view.setEnabledExpansionTimeButton(true);
|
|
|
@@ -720,7 +726,7 @@ public class MobileAuthorizationPresenter {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- private boolean verifyPhoneNumber(String phoneNumber) {
|
|
|
+ private boolean verifyPhoneNumber(String phoneNumber, boolean isDisplay) {
|
|
|
boolean result = false;
|
|
|
|
|
|
if (StringUtil.isEmpty(phoneNumber)) {
|
|
|
@@ -730,20 +736,26 @@ public class MobileAuthorizationPresenter {
|
|
|
phoneNumber = StringUtil.getPureNumber(phoneNumber);
|
|
|
|
|
|
if (phoneNumber.length() == 0) {
|
|
|
- view.doPhoneNumberCheckedValidationMessage(R.string.phone_identify_phone_validation);
|
|
|
+ if (isDisplay) {
|
|
|
+ view.doPhoneNumberCheckedValidationMessage(R.string.phone_identify_phone_validation);
|
|
|
+ }
|
|
|
}
|
|
|
else if (phoneNumber.length() <= 6) {
|
|
|
- view.doPhoneNumberCheckedValidationMessage(R.string.phone_identify_phone_validation);
|
|
|
+ if (isDisplay) {
|
|
|
+ view.doPhoneNumberCheckedValidationMessage(R.string.phone_identify_phone_validation);
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
- view.doClearPhoneNumberValidationTextView();
|
|
|
+ if (isDisplay) {
|
|
|
+ view.doClearPhoneNumberValidationTextView();
|
|
|
+ }
|
|
|
result = true;
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- private boolean verifyBirthDate(String birthDate) {
|
|
|
+ private boolean verifyBirthDate(String birthDate, boolean isDisplay) {
|
|
|
boolean result = false;
|
|
|
|
|
|
if (StringUtil.isEmpty(birthDate)) {
|
|
|
@@ -754,18 +766,24 @@ public class MobileAuthorizationPresenter {
|
|
|
|
|
|
if (birthDate.length() == 0) {
|
|
|
Log.i("APP# MobileAuthorizationPresenter | verifyBirthDate", "|" + "length 0");
|
|
|
- view.doBirthDateValidationMessage(R.string.phone_identify_birth_date_input_validation_message);
|
|
|
+ if (isDisplay) {
|
|
|
+ view.doBirthDateValidationMessage(R.string.phone_identify_birth_date_input_validation_message);
|
|
|
+ }
|
|
|
}
|
|
|
else if (
|
|
|
birthDate.length() <= 7
|
|
|
- || birthDate.matches("^[012]")
|
|
|
+ || birthDate.matches("^[012].+") == false
|
|
|
) {
|
|
|
//숫자 7자리 이하 입력시, or YYYY 으로 시작 하지 않았을 경우;
|
|
|
Log.i("APP# MobileAuthorizationPresenter | verifyBirthDate", "|" + "birthDateLength check");
|
|
|
- view.doBirthDateValidationMessage(R.string.phone_identify_birth_date_length_validation_message);
|
|
|
+ if (isDisplay) {
|
|
|
+ view.doBirthDateValidationMessage(R.string.phone_identify_birth_date_length_validation_message);
|
|
|
+ }
|
|
|
}
|
|
|
else if (birthDate.length() == 8) { //8자리 확인
|
|
|
- view.doClearBirthDateValidationTextView();
|
|
|
+ if (isDisplay) {
|
|
|
+ view.doClearBirthDateValidationTextView();
|
|
|
+ }
|
|
|
// 년 월 일 확인
|
|
|
int year = Integer.valueOf(birthDate.substring(0, 4));
|
|
|
int month = Integer.valueOf(birthDate.substring(4, 6));
|
|
|
@@ -787,18 +805,22 @@ public class MobileAuthorizationPresenter {
|
|
|
else {
|
|
|
// 14 세 미만 가입 불가 알림
|
|
|
Log.i("APP# MobileAuthorizationPresenter | onBirthDateTextChanged", "|" + "14세미만 알림");
|
|
|
- view.doBirthDateValidationMessage(R.string.phone_identify_age_limit_validation_message);
|
|
|
+ if (isDisplay) {
|
|
|
+ view.doBirthDateValidationMessage(R.string.phone_identify_age_limit_validation_message);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- view.doBirthDateValidationMessage(R.string.phone_identify_birth_date_length_validation_message);
|
|
|
+ if (isDisplay) {
|
|
|
+ view.doBirthDateValidationMessage(R.string.phone_identify_birth_date_length_validation_message);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- private boolean verifyName(String inputName) {
|
|
|
+ private boolean verifyName(String inputName, boolean isDisplay) {
|
|
|
boolean result = false;
|
|
|
|
|
|
if (StringUtil.isEmpty(inputName)) {
|
|
|
@@ -807,14 +829,20 @@ public class MobileAuthorizationPresenter {
|
|
|
|
|
|
if (inputName.length() == 0) {
|
|
|
//이름 미입력시
|
|
|
- view.doNameValidationMessage(R.string.phone_identify_name_input_validation);
|
|
|
+ if (isDisplay) {
|
|
|
+ view.doNameValidationMessage(R.string.phone_identify_name_input_validation);
|
|
|
+ }
|
|
|
}
|
|
|
else if (inputName.length() <= 1) {
|
|
|
//한글 2자 미만 입력시
|
|
|
- view.doNameValidationMessage(R.string.phone_identify_name_length_validation);
|
|
|
+ if (isDisplay) {
|
|
|
+ view.doNameValidationMessage(R.string.phone_identify_name_length_validation);
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
- view.doClearNameValidationTextView();
|
|
|
+ if (isDisplay) {
|
|
|
+ view.doClearNameValidationTextView();
|
|
|
+ }
|
|
|
result = true;
|
|
|
}
|
|
|
|