|
|
@@ -1,9 +1,11 @@
|
|
|
package kr.co.zumo.app.lifeplus.view.dialog;
|
|
|
|
|
|
|
|
|
+import android.app.Activity;
|
|
|
import android.app.Dialog;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.Nullable;
|
|
|
+import android.support.annotation.StringRes;
|
|
|
import android.support.v4.app.DialogFragment;
|
|
|
import android.text.Editable;
|
|
|
import android.text.TextWatcher;
|
|
|
@@ -11,11 +13,13 @@ import android.util.Log;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
+import android.view.inputmethod.InputMethodManager;
|
|
|
import android.widget.AdapterView;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.CheckBox;
|
|
|
import android.widget.CompoundButton;
|
|
|
import android.widget.EditText;
|
|
|
+import android.widget.LinearLayout;
|
|
|
import android.widget.RadioButton;
|
|
|
import android.widget.Spinner;
|
|
|
import android.widget.TextView;
|
|
|
@@ -40,6 +44,9 @@ public class MobileAuthorizationDialog extends DialogBase implements View.OnClic
|
|
|
private Button buttonTimeDelay;
|
|
|
private Button buttonIdentifyNumberSend;
|
|
|
|
|
|
+ private InputMethodManager manager;
|
|
|
+
|
|
|
+ private LinearLayout linearLayout;
|
|
|
private EditText editTextName;
|
|
|
private RadioButton radioSelectLocal;
|
|
|
private EditText editTextBirthDate;
|
|
|
@@ -55,6 +62,10 @@ public class MobileAuthorizationDialog extends DialogBase implements View.OnClic
|
|
|
private EditText editTextAuthorizedNumber;
|
|
|
private TextView textViewPhoneIdentifyTime;
|
|
|
|
|
|
+ private TextView textViewBirthValidation;
|
|
|
+ private TextView textViewNameValidation;
|
|
|
+ private TextView textViewPhoneValidation;
|
|
|
+
|
|
|
private MobileAuthorizationPresenter presenter;
|
|
|
CheckBoxAllDriver checkBoxAllDriver;
|
|
|
|
|
|
@@ -71,6 +82,11 @@ public class MobileAuthorizationDialog extends DialogBase implements View.OnClic
|
|
|
@Override
|
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
|
setStyle(DialogFragment.STYLE_NORMAL, R.style.CustomDialog);
|
|
|
+ // getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
|
|
|
+ // getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
|
|
|
+ InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE);
|
|
|
+ // TODO: auto scroll 추가
|
|
|
+
|
|
|
presenter = new MobileAuthorizationPresenter(this);
|
|
|
if (null != resultListener) {
|
|
|
presenter.setResultListener(resultListener);
|
|
|
@@ -142,7 +158,7 @@ public class MobileAuthorizationDialog extends DialogBase implements View.OnClic
|
|
|
* @param view
|
|
|
*/
|
|
|
private void initView(View view) {
|
|
|
-
|
|
|
+ linearLayout = view.findViewById(R.id.linear_layout_identify);
|
|
|
buttonConfirm = view.findViewById(R.id.button_phone_identify_confirm);
|
|
|
buttonTimeDelay = view.findViewById(R.id.button_phone_identify_time_delay);
|
|
|
buttonIdentifyNumberSend = view.findViewById(R.id.button_identify_number_send);
|
|
|
@@ -160,6 +176,9 @@ public class MobileAuthorizationDialog extends DialogBase implements View.OnClic
|
|
|
editTextPhoneNumber = view.findViewById(R.id.edit_text_phone_number);
|
|
|
editTextAuthorizedNumber = view.findViewById(R.id.edit_text_authorized_number);
|
|
|
textViewPhoneIdentifyTime = view.findViewById(R.id.text_view_phone_identify_time);
|
|
|
+ textViewBirthValidation = view.findViewById(R.id.text_view_birth_validation);
|
|
|
+ textViewNameValidation = view.findViewById(R.id.text_view_name_validation);
|
|
|
+ textViewPhoneValidation = view.findViewById(R.id.text_view_phone_number_validation);
|
|
|
|
|
|
checkBoxAllDriver = new CheckBoxAllDriver(checkBoxAllAgree);
|
|
|
checkBoxAllDriver.addChildBox(checkBoxAgree1);
|
|
|
@@ -167,10 +186,21 @@ public class MobileAuthorizationDialog extends DialogBase implements View.OnClic
|
|
|
checkBoxAllDriver.addChildBox(checkBoxAgree3);
|
|
|
checkBoxAllDriver.addChildBox(checkBoxAgree4);
|
|
|
|
|
|
+ linearLayout.setOnClickListener(this);
|
|
|
buttonConfirm.setOnClickListener(this);
|
|
|
buttonTimeDelay.setOnClickListener(this);
|
|
|
buttonIdentifyNumberSend.setOnClickListener(this);
|
|
|
|
|
|
+ editTextName.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
|
|
+ @Override
|
|
|
+ public void onFocusChange(View view, boolean isFocusChanged) {
|
|
|
+ if (!isFocusChanged) {
|
|
|
+ presenter.doClearNameValidationTextView();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
editTextName.addTextChangedListener(new TextWatcher() {
|
|
|
@Override
|
|
|
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
|
|
@@ -188,6 +218,15 @@ public class MobileAuthorizationDialog extends DialogBase implements View.OnClic
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ editTextBirthDate.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
|
|
+ @Override
|
|
|
+ public void onFocusChange(View view, boolean isFocusChanged) {
|
|
|
+ if (!isFocusChanged) {
|
|
|
+ presenter.doClearBirthDatValidationTextView();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
editTextBirthDate.addTextChangedListener(new TextWatcher() {
|
|
|
@Override
|
|
|
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
|
|
@@ -340,6 +379,8 @@ public class MobileAuthorizationDialog extends DialogBase implements View.OnClic
|
|
|
case R.id.button_identify_number_send:
|
|
|
presenter.onAuthorizationNumberSendButtonClick();
|
|
|
break;
|
|
|
+ case R.id.linear_layout_identify:
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
@@ -348,28 +389,44 @@ public class MobileAuthorizationDialog extends DialogBase implements View.OnClic
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public void doNameValidationMessage(String inputName) {
|
|
|
+ public void doClearNameValidationTextView() {
|
|
|
+ textViewNameValidation.setText("");
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void doNameValidationMessage(@StringRes int StringId) {
|
|
|
+ textViewNameValidation.setText(StringId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void doNationalityValidationMessage(String inputNationality) {
|
|
|
+ public void doNationalityValidationMessage() {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void doBirthDateValidationMessage(String inputBirthDate) {
|
|
|
+ public void doClearBirthDateValidationTextView() {
|
|
|
+ textViewBirthValidation.setText("");
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void doBirthDateValidationMessage(@StringRes int stringId) {
|
|
|
+ textViewBirthValidation.setText(stringId);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
- public void doGenderValidationMessage(String inputGender) {
|
|
|
+ public void doGenderValidationMessage() {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void doPhoneNumberCheckedValidationMessage(String inputPhoneNumber) {
|
|
|
+ public void doClearPhoneNumberValidationTextView() {
|
|
|
+ textViewPhoneValidation.setText("");
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void doPhoneNumberCheckedValidationMessage(@StringRes int stringId) {
|
|
|
+ textViewPhoneValidation.setText(stringId);
|
|
|
}
|
|
|
|
|
|
@Override
|