-
Notifications
You must be signed in to change notification settings - Fork 61
quick entrance
Carlyle Lee edited this page Jul 10, 2020
·
1 revision
Lens 浮窗上提供快捷跳转入口,跳转到Lens 内部提供或者app 定制的其它页面中。
Lens 设置页面中,快捷跳转功能功能区。
- 系统页面的跳转是Lens 内部支持的。
- 其余的页面跳转是由app 层在代码中实现接口支持的。
APP 层接口实现定义:
public class CustomJumpAction implements IJumpAction {
private String[] jumpKeys = {
"小视频DBG",
"UI Component",
"AB Test",
"DebugInfo",
"QigsawDebug",
"PushDebug"
};
public String[] getKeys() {
return jumpKeys;
}
@Override
public boolean jump(Context context, String s, int id) {
if (jumpKeys[0].equals(s)) {
startActivity(context, "com.qiyi.lens.DebugActivity");
} else {
return false;
}
return true;
}
private void startActivity(Context context, String name) {
Intent intent = new Intent();
ComponentName componentName = new ComponentName(context.getPackageName(), name);
intent.setComponent(componentName);
context.startActivity(intent);
}
}
Lens 自定义跳转设置:
CustomJumpAction jumpAction = new CustomJumpAction();
LensUtil.buildConfig()
.defaultOpen(false)
.addCustomJumpEntrance( jumpAction.getKeys(), jumpAction)
.showHide(Lens.wrapContext(mContext), wd);