package com.mytatvarnsdk.myView.progress;

import android.app.Dialog;
import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/***
 * 基础的自定义进度弹框
 * @author minyuchun
 */
public class BaseCustomProgress extends Dialog {

    protected String message;

    protected OnCancelListener mCancelListener;

    protected int type;

    protected BaseCustomProgress(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
//        super(context, cancelable, cancelListener);
        super(context);
        setCancelable(cancelable);
        setCancelListener(mCancelListener);
    }


    public BaseCustomProgress(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }
    public BaseCustomProgress(@NonNull Context context) {
        super(context);
    }


    public BaseCustomProgress setMessage(String message) {
        this.message = message;
        return this;
    }

    public BaseCustomProgress setType(@ProgressType int type){
        this.type = type;
        return this;
    }

    public int getType() {
        return type;
    }

    public BaseCustomProgress setCancelListener(OnCancelListener cancelListener) {
        mCancelListener = cancelListener;
        return this;
    }
}
