代码拉取完成,页面将自动刷新
同步操作将从 DiDi-opensource/DoraemonKit 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
dependencies {
...
debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:2.0.1'
releaseImplementation 'com.didichuxing.doraemonkit:doraemonkit-no-op:2.0.1'
...
}
Please use the latest release。
Install DoraemonKit
in Application::onCreate()
.
@Override
public void onCreate() {
...
DoraemonKit.install(application)
// for web container debug, optional
DoraemonKit.setWebDoorCallback(new WebDoorManager.WebDoorCallback() {
@Override
public void overrideUrlLoading(Context context, String s) {
// use your web container open the link
}
...
}
Add a dependency in build.gradle
in root of host project as following.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
...
classpath 'com.github.franticn:gradle_plugin_android_aspectjx:2.0.6'
...
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Apply plugin in application module of build.gradle
...
apply plugin: 'android-aspectjx'
dependencies {
...
debugImplementation 'com.didichuxing.doraemonkit:doraemonkit-aop:2.0.1'
...
}
Define a class implement the interface IKit,the interface describe a component in DoraemonKit panel.
An environment switch component can be defined as following.
public class EnvSwitchKit implements IKit {
@Override
public int getCategory() {
return Category.BIZ;
}
@Override
public int getName() {
return R.string.bh_env_switch;
}
@Override
public int getIcon() {
return R.drawable.bh_roadbit;
}
@Override
public void onClick(Context context) {
DebugService service = ServiceManager.getInstance().getService(context, DebugService.class);
PageManager.getInstance().startFragment(service.getContainer(), EnvSwitchFragment.class);
}
@Override
public void onAppInit(Context context) {
}
}
Register the environment switch component when DoraemonKit installed.
@Override
public void onCreate() {
kits.add(new EnvSwitchKit());
DoraemonKit.install(application, kits);
...
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。