package com.bonait.bnframework.common.cookie;

import android.app.Activity;
import android.widget.Toast;

import com.bonait.bnframework.R;

public class CookieHelper {
    public static int Mode = 0;
    public static int ShowTime = 10000;

    /**
     * 显示消息
     * @param title
     * @param message
     */
    public static void Show(Activity activity, String title, String message) {
        if (Mode == 1) {
            new CookieBar.Builder(activity)
                    .setBackgroundColor(R.color.app_color_blue)
                    .setActionColor(android.R.color.white)
                    .setTitleColor(R.color.white)
                    .setTitle(title)
                    .setMessage(message)
                    .setDuration(ShowTime)
                    .setActionWithIcon(R.mipmap.ic_action_close, new OnActionClickListener() {
                        @Override
                        public void onClick() {

                        }
                    })
                    .show();
        } else {
            new CookieBar.Builder(activity)
                    .setTitle(title)
                    .setMessage(message)
                    .setDuration(ShowTime)
                    .setBackgroundColor(R.color.app_color_blue)
                    .setActionColor(android.R.color.white)
                    .setTitleColor(R.color.white)
                    .setAction("已读确认关闭", new OnActionClickListener() {
                        @Override
                        public void onClick() {

                        }
                    })
                    .show();
        }
    }
}
