-
Notifications
You must be signed in to change notification settings - Fork 348
0x03i ViewCanary_en
hui.zhao edited this page Dec 1, 2019
·
3 revisions
Use the following configuration to install
GodEye.instance().install(GodEyeConfig.defaultConfigBuilder().withViewCanaryConfig(new GodEyeConfig.ViewCanaryConfig(10)).build());or
<viewCanary maxDepth="10"/>maxDepth indicates that the view exceeds the threshold value of the level (Views exceed this level will be marked in red in debug monitor)
You can produce data in two ways
- In the debug monitor dashboard, click the inspect button
- Call API in
GodEyeHelperclass
try {
GodEyeHelper.inspectView();
} catch (UninstallException e) {
e.printStackTrace();
}and use the following methods to observe the output:
try {
GodEye.instance().observeModule(GodEye.ModuleName.VIEW_CANARY, new Consumer<ViewIssueInfo>() {
@Override
public void accept(ViewIssueInfo viewIssueInfo) throws Exception {
}
});
} catch (UninstallException e) {
e.printStackTrace();
}After clicking inspect button or calling inspectView API, View and layout will be analysed. It will be output after the analysis is completed. The viewIssueInfo records all views level informations of the top page and the redraw areas in the page