Search in sources :

Example 1 with ErrorCallBack

use of com.knight.wanandroid.library_base.loadsir.ErrorCallBack in project wanandroid by KnightAndroid.

the class ModuleConfig method initSafeSdk.

public void initSafeSdk(@Nullable Application application) {
    // 初始化ARouter
    if (isDebug()) {
        // 如果是debug模式
        ARouter.openLog();
        ARouter.openDebug();
    }
    // 初始化路由
    ARouter.init(application);
    // 初始化Toast
    ToastUtils.setInterceptor(new ToastInterceptor());
    ToastUtils.init(application);
    // 网络请求初始化
    initOkhttp(application);
    // 登录拦截器
    initLoginFilter(application);
    // 初始化数据库
    DataBaseManager.getDataBase(application, "wanandroid_database");
    // 初始化用户信息
    user = initUser();
    // 状态页
    LoadSir.beginBuilder().addCallback(new ErrorCallBack()).addCallback(new LoadCallBack()).addCallback(new EmptyCallBack()).setDefaultCallback(LoadCallBack.class).commit();
    SystemUtils.darkNormal();
}
Also used : ErrorCallBack(com.knight.wanandroid.library_base.loadsir.ErrorCallBack) ToastInterceptor(com.knight.wanandroid.library_util.toast.ToastInterceptor) LoadCallBack(com.knight.wanandroid.library_base.loadsir.LoadCallBack) EmptyCallBack(com.knight.wanandroid.library_base.loadsir.EmptyCallBack)

Aggregations

EmptyCallBack (com.knight.wanandroid.library_base.loadsir.EmptyCallBack)1 ErrorCallBack (com.knight.wanandroid.library_base.loadsir.ErrorCallBack)1 LoadCallBack (com.knight.wanandroid.library_base.loadsir.LoadCallBack)1 ToastInterceptor (com.knight.wanandroid.library_util.toast.ToastInterceptor)1