|
|
@@ -30,12 +30,12 @@ import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
import kr.co.zumo.app.lifeplus.view.command.AppUpdateCommand;
|
|
|
import kr.co.zumo.app.lifeplus.view.command.EmailSendingCommand;
|
|
|
import kr.co.zumo.app.lifeplus.view.command.NotificationSettingCommand;
|
|
|
-import kr.co.zumo.app.lifeplus.view.dialog.ShareDialog;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.DialogBase;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.DialogBuilder;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.DialogID;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.ICustomDialogListener;
|
|
|
import kr.co.zumo.app.lifeplus.view.dialog.PinConfirmDialog;
|
|
|
+import kr.co.zumo.app.lifeplus.view.dialog.ShareDialog;
|
|
|
import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
|
|
|
|
|
|
/**
|
|
|
@@ -186,49 +186,7 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
if (index == SettingViewHolder.MEMBER_CONFIRM) {
|
|
|
// 회원 관리/확인
|
|
|
if (model.isMember()) {
|
|
|
- // PinConfirmDialog
|
|
|
- alertDialog = new DialogBuilder<PinConfirmDialog, ICustomDialogListener>(getFragmentManager(), DialogID.PIN_CONFIRM)
|
|
|
- .listener(new ICustomDialogListener<PinConfirmDialog>() {
|
|
|
- @Override
|
|
|
- public void onDialogResult(PinConfirmDialog dialog, Event event) {
|
|
|
- switch (event.getEventId()) {
|
|
|
- case Event.CONFIRM:
|
|
|
- String inputPin = event.getString();
|
|
|
- if (model.verifyPin(inputPin)) {
|
|
|
- dialog.dispose();
|
|
|
- go(ScreenID.SETTING_MEMBER_INFO);
|
|
|
- }
|
|
|
- else {
|
|
|
- dialog.retry();
|
|
|
- }
|
|
|
-
|
|
|
- break;
|
|
|
- case Event.FAIL:
|
|
|
- dialog.dispose();
|
|
|
- // 핀 불일치
|
|
|
- showErrorDialog(R.string.pin_miss_match_error);
|
|
|
- break;
|
|
|
- case Event.RESET:
|
|
|
- dialog.dispose();
|
|
|
- go(ScreenID.PIN_RESET_AUTH);
|
|
|
- break;
|
|
|
- case Event.HELP:
|
|
|
- // 이메일 문의
|
|
|
- onCommand(new EmailSendingCommand(ResourceUtil.getString(R.string.lifeplus_email)));
|
|
|
- break;
|
|
|
- default:
|
|
|
- dialog.dispose();
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onDialogCanceled(PinConfirmDialog dialog) {
|
|
|
- dialog.dispose();
|
|
|
- }
|
|
|
- })
|
|
|
- .attribute(dialog1 -> dialog1.setResetButtonVisible(true))
|
|
|
- .show();
|
|
|
+ confirmMember();
|
|
|
}
|
|
|
else {
|
|
|
go(ScreenID.SIGN_UP_START);
|
|
|
@@ -274,11 +232,55 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ private void confirmMember() {
|
|
|
+ // PinConfirmDialog
|
|
|
+ alertDialog = new DialogBuilder<PinConfirmDialog, ICustomDialogListener>(getFragmentManager(), DialogID.PIN_CONFIRM)
|
|
|
+ .listener(new ICustomDialogListener<PinConfirmDialog>() {
|
|
|
+ @Override
|
|
|
+ public void onDialogResult(PinConfirmDialog dialog, Event event) {
|
|
|
+ switch (event.getEventId()) {
|
|
|
+ case Event.CONFIRM:
|
|
|
+ String inputPin = event.getString();
|
|
|
+ if (model.verifyPin(inputPin)) {
|
|
|
+ dialog.dispose();
|
|
|
+ go(ScreenID.SETTING_MEMBER_INFO);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ dialog.retry();
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ case Event.FAIL:
|
|
|
+ dialog.dispose();
|
|
|
+ // 핀 불일치
|
|
|
+ showErrorDialog(R.string.pin_miss_match_error);
|
|
|
+ break;
|
|
|
+ case Event.RESET:
|
|
|
+ dialog.dispose();
|
|
|
+ go(ScreenID.PIN_RESET_AUTH);
|
|
|
+ break;
|
|
|
+ case Event.HELP:
|
|
|
+ // 이메일 문의
|
|
|
+ onCommand(new EmailSendingCommand(ResourceUtil.getString(R.string.lifeplus_email)));
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ dialog.dispose();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onDialogCanceled(PinConfirmDialog dialog) {
|
|
|
+ dialog.dispose();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .attribute(dialog -> dialog.setResetButtonVisible(true))
|
|
|
+ .show();
|
|
|
}
|
|
|
|
|
|
private void showShareDialog() {
|
|
|
-
|
|
|
String code = model.getSettingMemberBean().getMyRecommendCode();
|
|
|
if (StringUtil.isFull(code)) {
|
|
|
//추천 팝업 띄우기
|
|
|
@@ -317,7 +319,6 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
dialog.setDialogType(ShareDialog.TYPE_CODE);
|
|
|
})
|
|
|
.show();
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -442,10 +443,10 @@ public class SettingPresenter extends Presenter<SettingModel, ISettingView> {
|
|
|
|
|
|
SettingMemberBean memberBean = model.getSettingMemberBean();
|
|
|
|
|
|
- view.setPushEnabled(memberBean.isAllowPush());
|
|
|
- view.setPushMarketingEnabled(memberBean.isAllowPushMarketing());
|
|
|
- view.setLocationServiceEnabled(memberBean.isAllowLocationService());
|
|
|
- view.setRecommendCode(memberBean.getMyRecommendCode());
|
|
|
+ view.setPushEnabled(model.isPushEnabled());
|
|
|
+ view.setPushMarketingEnabled(model.isPushMarketingEnabled());
|
|
|
+ view.setLocationServiceEnabled(model.isLocationServiceEnabled());
|
|
|
+ view.setRecommendCode(model.getMyRecommendCode());
|
|
|
|
|
|
if (model.isMember()) {
|
|
|
view.setUserName(model.getUserName());
|