use of com.android.tools.idea.apk.viewer.diff.ApkDiffPanel in project android by JetBrains.
the class ApkEditor method selectApkAndCompare.
@Override
public void selectApkAndCompare() {
FileChooserDescriptor desc = new FileChooserDescriptor(true, false, false, false, false, false);
desc.withFileFilter(file -> ApkFileSystem.EXTENSIONS.contains(file.getExtension()));
VirtualFile file = FileChooser.chooseFile(desc, myProject, null);
if (file == null) {
// user canceled
return;
}
VirtualFile newApk = ApkFileSystem.getInstance().getRootByLocal(file);
assert newApk != null;
DialogBuilder builder = new DialogBuilder(myProject);
builder.setTitle(myRoot.getName() + " vs " + newApk.getName());
ApkDiffParser parser = new ApkDiffParser(myRoot, newApk);
ApkDiffPanel panel = new ApkDiffPanel(parser);
builder.setCenterPanel(panel.getContainer());
builder.setPreferredFocusComponent(panel.getPreferredFocusedComponent());
builder.show();
}
Aggregations