Browse Source

[공통][Common] 공통얼랏 정의

Hasemi 7 years ago
parent
commit
ee646c2ccf

+ 31 - 10
app/src/main/java/kr/co/zumo/app/lifeplus/view/dialog/ConfirmDialog.java

@@ -25,37 +25,58 @@ import kr.co.zumo.app.lifeplus.view.Event;
 public class ConfirmDialog extends TextDialog {
 
   @StringRes
-  protected int buttonLabel = R.string.empty_string;
+  protected int positiveButtonLabel = R.string.empty_string;
+  @StringRes
+  protected int negativeButtonLabel = R.string.empty_string;
 
   /**
-   * 표시할 buttonLabel 지정
+   * 표시할 positiveButtonLabel 지정
    *
    * @param stringId
    */
-  public void setButtonLabelId(@StringRes int stringId) {
-    this.buttonLabel = stringId;
+  public void setPositiveButtonLabelId(@StringRes int stringId) {
+    this.positiveButtonLabel = stringId;
+  }
+
+  public void setNegativeButtonLabelId(@StringRes int stringId) {
+    this.negativeButtonLabel = stringId;
   }
 
   @NonNull
   @Override
   public Dialog onCreateDialog(Bundle savedInstanceState) {
-    if (buttonLabel == R.string.empty_string) {
-      buttonLabel = R.string.confirm;
+    if (positiveButtonLabel == R.string.empty_string) {
+      positiveButtonLabel = R.string.confirm;
     }
+
+    if (negativeButtonLabel == R.string.empty_string) {
+      negativeButtonLabel = R.string.cancel;
+    }
+
     // Use the Builder class for convenient dialog construction
     android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(getActivity());
     builder.setMessage(text)
-      .setPositiveButton(buttonLabel, new DialogInterface.OnClickListener() {
+      .setPositiveButton(positiveButtonLabel, new DialogInterface.OnClickListener() {
         public void onClick(DialogInterface dialog, int id) {
           if (null != getCustomListener()) {
-            getCustomListener().onDialogResult(ConfirmDialog.this, new Event.Builder(Event.CONFIRM).build());
+            if (positiveButtonLabel == R.string.go_execute) {
+              getCustomListener().onDialogCanceled(ConfirmDialog.this);
+            }
+            else {
+              getCustomListener().onDialogResult(ConfirmDialog.this, new Event.Builder(Event.CONFIRM).build());
+            }
           }
         }
       })
-      .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
+      .setNegativeButton(negativeButtonLabel, new DialogInterface.OnClickListener() {
         public void onClick(DialogInterface dialog, int id) {
           if (null != getCustomListener()) {
-            getCustomListener().onDialogCanceled(ConfirmDialog.this);
+            if (negativeButtonLabel == R.string.back) {
+              getCustomListener().onDialogResult(ConfirmDialog.this, new Event.Builder(Event.CONFIRM).build());
+            }
+            else {
+              getCustomListener().onDialogCanceled(ConfirmDialog.this);
+            }
           }
         }
       });

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/contents/ContentsPresenter.java

@@ -168,7 +168,7 @@ public class ContentsPresenter extends ContentsBasePresenter<ContentsModel, ICon
       })
       .attribute(dialog -> {
         dialog.setText(ResourceUtil.getString(R.string.best_bucket_guest_guide));
-        dialog.setButtonLabelId(R.string.member_confirm);
+        dialog.setPositiveButtonLabelId(R.string.member_confirm);
       })
       .show();
   }

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/faq/FAQPresenter.java

@@ -133,7 +133,7 @@ public class FAQPresenter extends Presenter<FAQModel, IFAQView> {
         })
         .attribute(dialog -> {
           dialog.setText(ResourceUtil.getString(R.string.faq_guest_guide));
-          dialog.setButtonLabelId(R.string.member_confirm);
+          dialog.setPositiveButtonLabelId(R.string.member_confirm);
         })
         .show();
     }

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/my/main/MyMainPresenter.java

@@ -199,7 +199,7 @@ public class MyMainPresenter extends Presenter<MyMainModel, IMyMainView> {
       })
       .attribute(dialog -> {
         dialog.setText(ResourceUtil.getString(R.string.best_bucket_guest_guide));
-        dialog.setButtonLabelId(R.string.member_confirm);
+        dialog.setPositiveButtonLabelId(R.string.member_confirm);
       })
       .show();
   }

+ 2 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/signup/SignUpAgreePresenter.java

@@ -178,6 +178,8 @@ public class SignUpAgreePresenter extends Presenter<SignUpAgreeModel, ISignUpAgr
       })
       .attribute(dialog -> {
         dialog.setText(ResourceUtil.getString(model.getBackwardWarnStringId()));
+        dialog.setPositiveButtonLabelId(R.string.go_execute);
+        dialog.setNegativeButtonLabelId(R.string.back);
       })
       .show();
     return true;

+ 2 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/signup/SignUpMobileAuthPresenter.java

@@ -150,6 +150,8 @@ public class SignUpMobileAuthPresenter extends Presenter<SignUpMobileAuthModel,
         }
       })
       .attribute((IAttribute<ConfirmDialog>) dialog -> {
+        dialog.setPositiveButtonLabelId(R.string.go_execute);
+        dialog.setNegativeButtonLabelId(R.string.back);
         dialog.setText(ResourceUtil.getString(model.getBackwardWarnStringId()));
       })
       .show();

+ 3 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/signup/SignUpPinPresenter.java

@@ -4,6 +4,7 @@
 package kr.co.zumo.app.lifeplus.view.screen.signup;
 
 import io.reactivex.disposables.CompositeDisposable;
+import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
 import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
 import kr.co.zumo.app.lifeplus.util.ResourceUtil;
@@ -92,6 +93,8 @@ public class SignUpPinPresenter extends Presenter<SignUpPinModel, ISignUpView> {
         }
       })
       .attribute((IAttribute<ConfirmDialog>) dialog -> {
+        dialog.setPositiveButtonLabelId(R.string.go_execute);
+        dialog.setNegativeButtonLabelId(R.string.back);
         dialog.setText(ResourceUtil.getString(model.getBackwardWarnStringId()));
       })
       .show();

+ 6 - 3
app/src/main/res/values/strings.xml

@@ -188,12 +188,12 @@
   <string name="phone_identify_phone_hint">뒷번호 7~8자리 입력</string>
   <string name="phone_identify_submit">인증번호 발송</string>
   <string name="phone_identify_submit_message_success">인증번호가 발송되었습니다.</string>
-  <string name="phone_identify_submit_message_fail">인증번호 발송에 실패했습니다. 다시 시도해주세요.</string>
+  <string name="phone_identify_submit_message_fail">입력정보를 다시 확인해주세요.</string>
   <string name="phone_identify_submit_retry">인증번호 재발송</string>
   <string name="phone_identify_six_characters">인증번호 6자리 입력</string>
   <string name="phone_identify_number_validation_message">인증번호 6자리를 입력해주세요</string>
   <string name="phone_identify_number_need">인증번호를 입력해주세요.</string>
-  <string name="phone_identify_number_fail_1">입력하신 인증번호가 정확하지 않습니다. 다시 시도해주세요.</string>
+  <string name="phone_identify_number_fail_1">인증번호를 다시 확인해주세요.</string>
   <string name="phone_identify_number_fail_2">본인인증에 실패했습니다. 인증번호를 재발송해주세요.</string>
   <string name="phone_identify_completed">본인인증이 완료되었습니다.</string>
   <string name="phone_identify_confirm">확 인</string>
@@ -212,7 +212,7 @@
   <string name="sign_up_success_message">%s님\nLifeplus 회원가입이 완료되었습니다.</string>
   <string name="sign_up_success_message_from_zumo">%s님\nLifeplus 회원전환이 완료되었습니다.</string>
   <string name="coupon_detail">300</string>
-  <string name="sign_up_back_warning">화면 이탈 시 회원가입 과정이 초기화 됩니다.\n정말 나가시겠습니까?</string>
+  <string name="sign_up_back_warning">화면 이탈 시 과정이 초기화 됩니다.\n정말 나가시겠습니까?</string>
   <string name="sign_up_back_warning_from_zumo">화면 이탈 시 회원전환 과정이 초기화 됩니다.\n정말 나가시겠습니까?</string>
 
   <string name="network_disconnected_message">서버와의 통신이 \n원활하지 않습니다.</string>
@@ -227,6 +227,9 @@
   <string name="main">메인</string>
   <string name="previous_page">이전 페이지</string>
 
+  <string name="back">나가기</string>
+  <string name="go_execute">계속 진행</string>
+
   <string name="text_view_add_pop_up_message">지금 등록하시면 코인을 드려요!</string>
   <string name="button_add_special_code"><u>스페셜/추천인 코드 등록</u></string>
   <string name="button_add_email"><u>Email 등록</u></string>