|
|
@@ -3,8 +3,6 @@
|
|
|
*/
|
|
|
package kr.co.zumo.app.lifeplus.view.custom.pin;
|
|
|
|
|
|
-import android.util.Log;
|
|
|
-
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import io.reactivex.Completable;
|
|
|
@@ -31,6 +29,7 @@ public abstract class CustomPinPresenter implements IPinContract.Presenter {
|
|
|
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) {
|
|
|
@@ -103,7 +102,9 @@ public abstract class CustomPinPresenter implements IPinContract.Presenter {
|
|
|
view.updateGuideText(getGuideStringId());
|
|
|
view.updateTitleText(getTitleStringId());
|
|
|
view.restart();
|
|
|
- if (getPinCount() != 0) {
|
|
|
+ matchCount = getPinCount();
|
|
|
+ if (matchCount > 0) {
|
|
|
+ --matchCount;
|
|
|
retry();
|
|
|
}
|
|
|
}
|
|
|
@@ -127,13 +128,11 @@ 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), getPinCount()));
|
|
|
+ view.updateGuideText(String.format(ResourceUtil.getString(R.string.pin_miss_match_error_repeat), matchCount));
|
|
|
view.restart();
|
|
|
+ setPinCount(matchCount);
|
|
|
}
|
|
|
else {
|
|
|
/*
|
|
|
@@ -173,7 +172,6 @@ public abstract class CustomPinPresenter implements IPinContract.Presenter {
|
|
|
|
|
|
@Override
|
|
|
public void setPinCount(int count) {
|
|
|
- Log.e("APP# CustomPinPresenter | setPinCount", " count |" + count);
|
|
|
SuperModel.getInstance().getPreferences().setPinCount(count);
|
|
|
}
|
|
|
|