Java Code Examples for com.didichuxing.doraemonkit.DoraemonKit#install()

The following examples show how to use com.didichuxing.doraemonkit.DoraemonKit#install() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AopApp.java    From DoraemonKit with Apache License 2.0 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    List<AbstractKit> kits = new ArrayList<>();
    kits.add(new DemoKit());
    //测试环境:a49842eeebeb1989b3f9565eb12c276b
    //线上环境:749a0600b5e48dd77cf8ee680be7b1b7
    //new AopTest().test();
    ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
            .setDiskCacheEnabled(false)
            .build();
    Fresco.initialize(this, config);

    //是否显示入口icon
    // DoraemonKit.setAwaysShowMainIcon(false);
    DoraemonKit.disableUpload();
    DoraemonKit.install(this, "749a0600b5e48dd77cf8ee680be7b1b7");
    //DoraemonKit.install(this, kits, "70e78c27f9174d68668d8a66a2b66483")
}
 
Example 2
Source File: TestApp.java    From TikTok with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    ARouter.openLog();     // 打印日志
    ARouter.openDebug();   // 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险)
    ARouter.init(this); // 尽可能早,推荐在Application中初始化

    RxToast.init(this)
            .setBackgroundColor("#CC000000")
            .setTextColor("#FFFFFF")
            .setGravity(Gravity.CENTER)
            .setPadding(16, 16, 12, 12)
            .setMaxLines(2)
            .setTextSize(12)
            .setZ(30)
            .setMaxLines(3)
            .apply();

    Utils.init(this);

    DoraemonKit.install(this);
    // H5任意门功能需要,非必须
    DoraemonKit.setWebDoorCallback(new WebDoorManager.WebDoorCallback() {
        @Override
        public void overrideUrlLoading(Context context, String s) {
            // 使用自己的H5容器打开这个链接
        }
    });
}
 
Example 3
Source File: TestApp.java    From TikTok with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    ARouter.openLog();     // 打印日志
    ARouter.openDebug();   // 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险)
    ARouter.init(this); // 尽可能早,推荐在Application中初始化

    RxToast.init(this)
            .setBackgroundColor("#CC000000")
            .setTextColor("#FFFFFF")
            .setGravity(Gravity.CENTER)
            .setPadding(16, 16, 12, 12)
            .setMaxLines(2)
            .setTextSize(12)
            .setZ(30)
            .setMaxLines(3)
            .apply();

    Utils.init(this);
    DoraemonKit.install(this);
    // H5任意门功能需要,非必须
    DoraemonKit.setWebDoorCallback(new WebDoorManager.WebDoorCallback() {
        @Override
        public void overrideUrlLoading(Context context, String s) {
            // 使用自己的H5容器打开这个链接
            WebView webView = new WebView(context);
            webView.loadUrl(s);
        }
    });

}
 
Example 4
Source File: MyApplication.java    From AndroidAnimationExercise with Apache License 2.0 5 votes vote down vote up
@Override
    @DebugLog
    public void onCreate() {
        super.onCreate();

        Debug.startMethodTracing("sample");

        MultiDex.install(this);
        Stetho.initializeWithDefaults(this);

        if (BuildConfig.DEBUG) {
            ARouter.openLog();
            ARouter.openDebug();
        }

        ARouter.init(this);
        Fresco.initialize(this);
        String dir = MMKV.initialize(this);
        Log.e("application", "onCreate: mmkv.dir==" + dir);
        WebView.setWebContentsDebuggingEnabled(true);


        DoraemonKit.disableUpload();
        DoraemonKit.install(this);
//        DoraemonKit.hide();
        logLifeCycleCallBacks();

        Debug.stopMethodTracing();
    }
 
Example 5
Source File: AppLifecyclesImpl.java    From TikTok with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate(@NonNull Application application) {
    if (LeakCanary.isInAnalyzerProcess(application)) {
        // This process is dedicated to LeakCanary for heap analysis.
        // You should not init your app in this process.
        return;
    }
    //leakCanary内存泄露检查
    ArmsUtils.obtainAppComponentFromContext(application).extras().put(RefWatcher.class.getName(), BuildConfig.USE_CANARY ? LeakCanary.install(application) : RefWatcher.DISABLED);

    ARouter.openLog();     // 打印日志
    ARouter.openDebug();   // 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险)
    ARouter.init(application); // 尽可能早,推荐在Application中初始化
    //bugly
    CrashReport.initCrashReport(application, "c6dc9a5939", true);

    RxToast.init(application)
            .setBackgroundColor("#CC000000")
            .setTextColor("#FFFFFF")
            .setGravity(Gravity.CENTER)
            .setPadding(16, 16, 12, 12)
            .setMaxLines(2)
            .setTextSize(12)
            .setZ(30)
            .setMaxLines(3)
            .apply();

    DoraemonKit.install(application);
    // H5任意门功能需要,非必须
    DoraemonKit.setWebDoorCallback(new WebDoorManager.WebDoorCallback() {
        @Override
        public void overrideUrlLoading(Context context, String s) {
            // 使用自己的H5容器打开这个链接
            // 使用自己的H5容器打开这个链接
            WebView webView = new WebView(context);


            webView.loadUrl(s);

        }
    });


}