Selaa lähdekoodia

[공통][Bug] 불필요 파일 제거
- 핀 확인은 다이얼로그로 대체
- 핀 재설정은 인증 후 재설정으로 수정

hyodong.min 7 vuotta sitten
vanhempi
commit
b71d43374c

+ 0 - 21
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/pin/IPinConfirmView.java

@@ -1,21 +0,0 @@
-/*
- * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
- */
-package kr.co.zumo.app.lifeplus.view.screen.pin;
-
-/**
- * IPinView
- * <pre>
- * </pre>
- *
- * @author 민효동
- * @version 1.0
- * @history 민효동   [2018. 9. 21.]   [최초 작성]
- * @since 2018. 9. 21.
- */
-public interface IPinConfirmView extends IPinView {
-  /**
-   * 핀 입력 재시도
-   */
-  void retry();
-}

+ 0 - 19
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/pin/IPinView.java

@@ -1,19 +0,0 @@
-/*
- * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
- */
-package kr.co.zumo.app.lifeplus.view.screen.pin;
-
-import kr.co.zumo.app.lifeplus.view.IView;
-
-/**
- * IPinView
- * <pre>
- * </pre>
- *
- * @author 민효동
- * @version 1.0
- * @history 민효동   [2018. 9. 21.]   [최초 작성]
- * @since 2018. 9. 21.
- */
-public interface IPinView extends IView {
-}

+ 0 - 114
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/pin/PinConfirmFragment.java

@@ -1,114 +0,0 @@
-/*
- * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
- */
-package kr.co.zumo.app.lifeplus.view.screen.pin;
-
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import kr.co.zumo.app.R;
-import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
-import kr.co.zumo.app.lifeplus.view.Event;
-import kr.co.zumo.app.lifeplus.view.custom.pin.CustomPinConfirmPresenter;
-import kr.co.zumo.app.lifeplus.view.custom.pin.CustomPinView;
-import kr.co.zumo.app.lifeplus.view.custom.pin.IPinContract;
-import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
-
-/**
- * PinConfirmFragment
- * <pre>
- * </pre>
- *
- * @author 민효동
- * @version 1.0
- * @history 민효동   [2018. 10. 15.]   [최초 작성]
- * @since 2018. 10. 15.
- */
-public class PinConfirmFragment extends FragmentBase<PinConfirmPresenter> implements IPinConfirmView {
-
-  private CustomPinView customPinView;
-  private IPinContract.Presenter pinPresenter;
-
-  @Nullable
-  @Override
-  protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
-    return inflater.inflate(R.layout.view_container, container, false);
-  }
-
-  @Override
-  protected void onAfterActivityCreated(Bundle savedInstanceState) {
-
-    /**
-     * 핀 확인/등록/초기화(재등록)
-     *
-     * - 같은 뷰(CustomPinView)를 이용한다.
-     * - presenter 를 달리하여 각 단계를 컨트롤한다.
-     * - 결과는 IPinContract.Listener 로 전달한다.
-     *
-     */
-    customPinView = new CustomPinView(getActivity());
-    pinPresenter = new CustomPinConfirmPresenter(customPinView, new IPinContract.Listener() {
-      @Override
-      public void onPinResult(String result) {
-        presenter.onEvent(new Event.Builder(Event.RESULT).string(result).build());
-      }
-
-      @Override
-      public void onClickPinReset() {
-        presenter.onEvent(new Event.Builder(Event.RESET).build());
-      }
-
-      @Override
-      public void onClickClose() {
-        presenter.onEvent(new Event.Builder(Event.EXIT).build());
-      }
-
-      @Override
-      public void onPinFail() {
-        presenter.onEvent(new Event.Builder(Event.FAIL).build());
-      }
-
-      @Override
-      public void onPinHelp() {
-        presenter.onEvent(new Event.Builder(Event.HELP).build());
-      }
-    });
-
-    ViewGroup layout = findViewById(R.id.container);
-    ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
-    layout.addView(customPinView, params);
-  }
-
-  @Override
-  protected void defineActionBar() {
-    ActionBarManager.getInstance().begin().hide();
-  }
-
-  @Override
-  protected PinConfirmPresenter definePresenter() {
-    return new PinConfirmPresenter(getModel(PinModel.class), this);
-  }
-
-  @Override
-  public void retry() {
-    pinPresenter.retry();
-  }
-
-  @Override
-  protected void onAfterDestroyView() {
-
-    if (null != pinPresenter) {
-      pinPresenter.dispose();
-      pinPresenter = null;
-    }
-
-    if (null != customPinView) {
-      customPinView.dispose();
-      customPinView = null;
-    }
-  }
-}

+ 0 - 118
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/pin/PinConfirmPresenter.java

@@ -1,118 +0,0 @@
-/*
- * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
- */
-package kr.co.zumo.app.lifeplus.view.screen.pin;
-
-import android.util.Log;
-
-import io.reactivex.disposables.Disposable;
-import kr.co.zumo.app.R;
-import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
-import kr.co.zumo.app.lifeplus.util.ResourceUtil;
-import kr.co.zumo.app.lifeplus.view.Event;
-import kr.co.zumo.app.lifeplus.view.command.EmailSendingCommand;
-import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
-
-/**
- * PinConfirmPresenter
- * <pre>
- * </pre>
- *
- * @author 민효동
- * @version 1.0
- * @history 민효동   [2018. 9. 21.]   [최초 작성]
- * @since 2018. 9. 21.
- */
-public class PinConfirmPresenter extends Presenter<PinModel, IPinConfirmView> {
-
-  private Disposable disposable;
-
-  public PinConfirmPresenter(PinModel model, IPinConfirmView view) {
-    super(model, view);
-  }
-
-  @Override
-  protected void startInternal() {
-
-  }
-
-  @Override
-  protected void stopInternal() {
-
-  }
-
-  @Override
-  protected void resumeInternal() {
-
-  }
-
-  @Override
-  protected void pauseInternal() {
-
-  }
-
-  @Override
-  protected void destroyInternal() {
-    if (null != disposable) {
-      disposable.dispose();
-      disposable = null;
-    }
-  }
-
-  @Override
-  public void onResult(Event event) {
-
-  }
-
-  @Override
-  public boolean onBackPressed() {
-    go(ScreenID.MAIN, ScreenID.DIRECTION_NONE);
-    return true;
-  }
-
-  @Override
-  protected void onEventInternal(Event event) {
-    switch (event.getEventId()) {
-      case Event.RESULT:
-        Log.i("APP# PinConfirmPresenter | onEventInternal", "|" + event.getString());
-        verifyPin(event.getString());
-        break;
-      case Event.FAIL:
-        onBackPressed();
-        break;
-      case Event.RESET:
-        go(ScreenID.PIN_RESET, ScreenID.DIRECTION_NONE);
-        break;
-      case Event.EXIT:
-        onBackPressed();
-        break;
-      case Event.HELP:
-        // 이메일 문의
-        onCommand(new EmailSendingCommand(ResourceUtil.getString(R.string.lifeplus_email)));
-        break;
-      default:
-        break;
-    }
-  }
-
-  /**
-   * 핀 검증
-   *
-   * @param pin
-   */
-  private void verifyPin(String pin) {
-
-    boolean result = model.verifyPin(pin);
-
-    if (result) {
-      // 저장된 핀 번호와 일치 함
-      onBackPressed();
-    }
-    else {
-      // 핀 번호 불 일치
-      // view 에 다시 요청함
-      view.retry();
-    }
-  }
-
-}

+ 0 - 65
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/pin/PinModel.java

@@ -1,65 +0,0 @@
-/*
- * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
- */
-package kr.co.zumo.app.lifeplus.view.screen.pin;
-
-import kr.co.zumo.app.lifeplus.model.Model;
-import kr.co.zumo.app.lifeplus.model.SuperModel;
-import kr.co.zumo.app.lifeplus.model.module.PinModuleParser;
-
-/**
- * PinModel
- * <pre>
- * </pre>
- *
- * @author 민효동
- * @version 1.0
- * @history 민효동   [2018. 9. 21.]   [최초 작성]
- * @since 2018. 9. 21.
- */
-public class PinModel extends Model {
-
-  /**
-   * 입력한 핀과 저장된 핀이 같은지 확인
-   *
-   * @param pin "0000"
-   * @return boolean
-   */
-  public boolean verifyPin(String pin) {
-    return new PinModuleParser().verify(pin);
-  }
-
-  /**
-   * 핀 저장
-   *
-   * @param pin
-   */
-  public void savePin(String pin) {
-    SuperModel.getInstance().savePinWithEncryption(pin);
-  }
-
-  @Override
-  protected void destroyInternal() {
-
-  }
-
-  @Override
-  protected void startInternal() {
-
-  }
-
-  @Override
-  protected void stopInternal() {
-
-  }
-
-  @Override
-  protected void resumeInternal() {
-
-  }
-
-  @Override
-  protected void pauseInternal() {
-
-  }
-}

+ 0 - 97
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/pin/reset/PinResetFragment.java

@@ -1,97 +0,0 @@
-/*
- * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
- */
-package kr.co.zumo.app.lifeplus.view.screen.pin.reset;
-
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import kr.co.zumo.app.R;
-import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
-import kr.co.zumo.app.lifeplus.view.Event;
-import kr.co.zumo.app.lifeplus.view.custom.pin.CustomPinResetPresenter;
-import kr.co.zumo.app.lifeplus.view.custom.pin.CustomPinView;
-import kr.co.zumo.app.lifeplus.view.custom.pin.IPinContract;
-import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
-import kr.co.zumo.app.lifeplus.view.screen.pin.IPinView;
-import kr.co.zumo.app.lifeplus.view.screen.pin.PinModel;
-
-/**
- * PinResetFragment
- * <pre>
- * </pre>
- *
- * @author 민효동
- * @version 1.0
- * @history 민효동   [2018. 10. 15.]   [최초 작성]
- * @since 2018. 10. 15.
- */
-public class PinResetFragment extends FragmentBase<PinResetPresenter> implements IPinView {
-  private CustomPinView customPinView;
-  private IPinContract.Presenter pinPresenter;
-
-  @Nullable
-  @Override
-  protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
-    return inflater.inflate(R.layout.view_container, container, false);
-  }
-
-  @Override
-  protected void onAfterActivityCreated(Bundle savedInstanceState) {
-
-    /**
-     * 핀 확인/등록/초기화(재등록)
-     *
-     * - 같은 뷰(CustomPinView)를 이용한다.
-     * - presenter 를 달리하여 각 단계를 컨트롤한다.
-     * - 결과는 IPinContract.Listener 로 전달한다.
-     *
-     */
-    customPinView = new CustomPinView(getActivity());
-    pinPresenter = new CustomPinResetPresenter(customPinView, new IPinContract.Listener() {
-      @Override
-      public void onPinResult(String result) {
-        presenter.onEvent(new Event.Builder(Event.SUCCESS).string(result).build());
-      }
-
-      @Override
-      public void onClickPinReset() {
-      }
-
-      @Override
-      public void onClickClose() {
-        presenter.onEvent(new Event.Builder(Event.EXIT).build());
-      }
-
-
-      @Override
-      public void onPinFail() {
-        pinPresenter.onPinStart();
-      }
-
-      @Override
-      public void onPinHelp() {
-        presenter.onEvent(new Event.Builder(Event.HELP).build());
-      }
-    });
-
-    ViewGroup layout = findViewById(R.id.container);
-    ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
-    layout.addView(customPinView, params);
-
-  }
-
-  @Override
-  protected void defineActionBar() {
-    ActionBarManager.getInstance().begin().hide();
-  }
-
-  @Override
-  protected PinResetPresenter definePresenter() {
-    return new PinResetPresenter(getModel(PinModel.class), this);
-  }
-}

+ 0 - 95
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/pin/reset/PinResetPresenter.java

@@ -1,95 +0,0 @@
-/*
- * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
- */
-package kr.co.zumo.app.lifeplus.view.screen.pin.reset;
-
-import android.util.Log;
-
-import io.reactivex.disposables.Disposable;
-import kr.co.zumo.app.R;
-import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
-import kr.co.zumo.app.lifeplus.util.ResourceUtil;
-import kr.co.zumo.app.lifeplus.view.Event;
-import kr.co.zumo.app.lifeplus.view.command.EmailSendingCommand;
-import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
-import kr.co.zumo.app.lifeplus.view.screen.pin.IPinView;
-import kr.co.zumo.app.lifeplus.view.screen.pin.PinModel;
-
-/**
- * PinResetPresenter
- * <pre>
- * </pre>
- *
- * @author 민효동
- * @version 1.0
- * @history 민효동   [2018. 9. 21.]   [최초 작성]
- * @since 2018. 9. 21.
- */
-public class PinResetPresenter extends Presenter<PinModel, IPinView> {
-
-  private Disposable disposable;
-
-  public PinResetPresenter(PinModel model, IPinView view) {
-    super(model, view);
-  }
-
-  @Override
-  protected void startInternal() {
-
-  }
-
-  @Override
-  protected void stopInternal() {
-
-  }
-
-  @Override
-  protected void resumeInternal() {
-
-  }
-
-  @Override
-  protected void pauseInternal() {
-
-  }
-
-  @Override
-  protected void destroyInternal() {
-    if (null != disposable) {
-      disposable.dispose();
-      disposable = null;
-    }
-  }
-
-  @Override
-  public void onResult(Event event) {
-
-  }
-
-  @Override
-  public boolean onBackPressed() {
-    go(ScreenID.MAIN, ScreenID.DIRECTION_NONE);
-    return true;
-  }
-
-  @Override
-  protected void onEventInternal(Event event) {
-    switch (event.getEventId()) {
-      case Event.SUCCESS:
-        String pin = event.getString();
-        Log.i("APP# PinResetPresenter | onEventInternal", "|" + pin);
-        model.savePin(pin);
-        onBackPressed();
-        break;
-      case Event.EXIT:
-        onBackPressed();
-        break;
-      case Event.HELP:
-        // 이메일 문의
-        onCommand(new EmailSendingCommand(ResourceUtil.getString(R.string.lifeplus_email)));
-        break;
-      default:
-        break;
-    }
-  }
-}