|
|
@@ -3,12 +3,16 @@
|
|
|
*/
|
|
|
package kr.co.zumo.app.lifeplus.view.custom.pin;
|
|
|
|
|
|
+import android.util.Log;
|
|
|
+
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import io.reactivex.Completable;
|
|
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
|
import io.reactivex.disposables.CompositeDisposable;
|
|
|
import kr.co.zumo.app.R;
|
|
|
+import kr.co.zumo.app.lifeplus.model.LifeplusPreferences;
|
|
|
+import kr.co.zumo.app.lifeplus.model.SuperModel;
|
|
|
import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
|
|
|
/**
|
|
|
@@ -25,14 +29,14 @@ public abstract class CustomPinPresenter implements IPinContract.Presenter {
|
|
|
|
|
|
protected IPinContract.View view;
|
|
|
protected IPinContract.Listener listener;
|
|
|
-
|
|
|
+ protected LifeplusPreferences lifeplusPreferences;
|
|
|
protected String pin;
|
|
|
- protected int matchCount;
|
|
|
protected CompositeDisposable disposable = new CompositeDisposable();
|
|
|
|
|
|
public CustomPinPresenter(IPinContract.View view, IPinContract.Listener listener) {
|
|
|
this.view = view;
|
|
|
this.listener = listener;
|
|
|
+ this.lifeplusPreferences = SuperModel.getInstance().getPreferences();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -99,6 +103,9 @@ public abstract class CustomPinPresenter implements IPinContract.Presenter {
|
|
|
view.updateGuideText(getGuideStringId());
|
|
|
view.updateTitleText(getTitleStringId());
|
|
|
view.restart();
|
|
|
+ if (getPinCount() != 0) {
|
|
|
+ retry();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -120,9 +127,12 @@ public abstract class CustomPinPresenter implements IPinContract.Presenter {
|
|
|
@Override
|
|
|
public final void retry() {
|
|
|
// 일치 하지 않으면 5회 재시도 후
|
|
|
+ Log.e("APP# CustomPinPresenter | retry", "getPinCount() |" + getPinCount());
|
|
|
+ int matchCount = getPinCount();
|
|
|
if (++matchCount < 5) {
|
|
|
+ setPinCount(matchCount);
|
|
|
view.updateGuideTextColor(ResourceUtil.getColor(R.color.CF12815));
|
|
|
- view.updateGuideText(String.format(ResourceUtil.getString(R.string.pin_miss_match_error_repeat), matchCount));
|
|
|
+ view.updateGuideText(String.format(ResourceUtil.getString(R.string.pin_miss_match_error_repeat), getPinCount()));
|
|
|
view.restart();
|
|
|
}
|
|
|
else {
|
|
|
@@ -130,6 +140,7 @@ public abstract class CustomPinPresenter implements IPinContract.Presenter {
|
|
|
5회 이상 불일치 시 ‘간편암호가 5회이상 일치하지 않아, 입력값이 초기화됩니다.’ 밸리데이션 문구 1초간 노출
|
|
|
- 입력값 초기화된 상태로 STEP1로 변경
|
|
|
*/
|
|
|
+ setPinCount(matchCount);
|
|
|
view.updateGuideTextColor(ResourceUtil.getColor(R.color.CF12815));
|
|
|
view.updateGuideText(getFailGuideStringId());
|
|
|
|
|
|
@@ -159,4 +170,15 @@ public abstract class CustomPinPresenter implements IPinContract.Presenter {
|
|
|
disposable = null;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void setPinCount(int count) {
|
|
|
+ Log.e("APP# CustomPinPresenter | setPinCount", " count |" + count);
|
|
|
+ SuperModel.getInstance().getPreferences().setPinCount(count);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int getPinCount() {
|
|
|
+ return SuperModel.getInstance().getPreferences().getPinCount();
|
|
|
+ }
|
|
|
}
|