|
|
@@ -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;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|