package com.qimai.android.widgetlib.toast;

import android.content.Context;

/**
 * created by wangwei   ON 2019-11-04  email:wangwei_5521@163.com
 *
 * @version 1.1.1
 * @Description
 **/
public class HolderContext {
    private static volatile HolderContext instance;

    public static HolderContext getInstance() {
        if (instance == null) {
            synchronized (HolderContext.class) {
                if (instance == null) {
                    instance = new HolderContext();
                }
            }
        }
        return instance;
    }

    public static Context getContext() {
        return getInstance().holder.getContext();
    }

    public Holder holder;

    public void register(Holder holder) {
        this.holder = holder;
    }

    public interface Holder {
        Context getContext();
    }
}
