package com.zhaohaoting.framework.mvchelper.mvc;

import android.view.View;

/**
 * author：Created by zhaohaoting on 2018/8/30
 * email：526309416@qq.com
 * desc：
 */
public class BaseILoadView implements ILoadViewFactory.ILoadView {

    protected int currentShowStatus = SHOW_RESTORE;
    protected static final int SHOW_LOADING = 1;
    protected static final int SHOW_EMPTY = 2;
    protected static final int SHOW_FAIL = 3;
    protected static final int SHOW_RESTORE = 0;

    @Override
    public void init(View switchView, View.OnClickListener onClickRefreshListener) {

    }

    public void setCurrentShowStatus(int currentShowStatus) {
        this.currentShowStatus = currentShowStatus;
    }

    @Override
    public void showLoading() {
        setCurrentShowStatus(SHOW_LOADING);
    }

    @Override
    public void showFail(Exception e) {
        setCurrentShowStatus(SHOW_FAIL);
    }

    @Override
    public void showEmpty() {
        setCurrentShowStatus(SHOW_EMPTY);
    }

    @Override
    public void tipFail(Exception e) {

    }

    @Override
    public void restore() {
        setCurrentShowStatus(SHOW_RESTORE);
    }

    @Override
    public void setEmptyTips(String emptyTips) {

    }
}
