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

import android.support.v4.app.DialogFragment;

/**
 * DialogBase
 * <pre>
 * </pre>
 *
 * @author 민효동
 * @version 1.0
 * @history 민효동   [2018. 9. 14.]   [최초 작성]
 * @since 2018. 9. 14.
 */
public abstract class DialogBase extends DialogFragment {
  protected IDialogResultListener resultListener;
  private boolean isDismissed = false;

  public IDialogResultListener getResultListener() {
    return resultListener;
  }

  public void setResultListener(IDialogResultListener resultListener) {
    this.resultListener = resultListener;
  }

  public abstract void setEnabled();

  public abstract void setDisabled();

  public abstract void restart();

  /**
   * dismiss 확인
   *
   * @return
   */
  public boolean isDismissed() {
    return isDismissed;
  }

  @Override
  public void dismiss() {
    super.dismiss();
    isDismissed = true;
  }

  @Override
  public void dismissAllowingStateLoss() {
    super.dismissAllowingStateLoss();
    isDismissed = true;
  }
}
