/*
 * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
 */
package kr.co.zumo.app.lifeplus.activity;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import kr.co.zumo.app.R;
import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
import kr.co.zumo.app.lifeplus.model.SignUpModel;
import kr.co.zumo.app.lifeplus.supervisor.ScreenChangerHelper;
import kr.co.zumo.app.lifeplus.view.Event;
import kr.co.zumo.app.lifeplus.view.ISignUpView;
import kr.co.zumo.app.lifeplus.view.presenter.SignUpPresenter;

/**
 * ;
 * SignUpActivity
 * <pre>
 * </pre>
 *
 * @author 민효동
 * @version 1.0
 * @history 민효동   [2018. 9. 5.]   [최초 작성]
 * @since 2018. 9. 5.
 */
public class SignUpActivity extends ActivityBase<SignUpPresenter> implements ISignUpView {

  @Override
  void onAfterCreate(Bundle savedInstanceState) {

    setContentView(R.layout.activity_sign_up);

    ScreenChangerHelper.getInstance().setAppCompatActivity(this);
    ScreenChangerHelper.getInstance().setContainerId(R.id.sign_up_container);

    presenter.onEvent(new Event.Builder(Event.SIGN_UP).build());

  }

  @Override
  protected void onDestroy() {
    super.onDestroy();
  }

  @Override
  void defineActionBar() {
    ActionBarManager actionBarManager = ActionBarManager.getInstance();
    LayoutInflater inflater = LayoutInflater.from(this);
    View view = inflater.inflate(R.layout.sign_up_action_bar, null);

    TextView actionBarTitle = view.findViewById(R.id.action_bar_title);
    actionBarTitle.setText("");

    view.findViewById(R.id.btnBack).setOnClickListener(v -> {
      onBackPressed();
    });

    actionBarManager.setCustomView(view);
  }

  @Override
  SignUpPresenter definePresenter() {
    return new SignUpPresenter(getModel(SignUpModel.class), this);
  }

}

