Search in sources :

Example 1 with ApkDiffParser

use of com.android.tools.idea.apk.viewer.diff.ApkDiffParser 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();
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ApkDiffPanel(com.android.tools.idea.apk.viewer.diff.ApkDiffPanel) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) ApkDiffParser(com.android.tools.idea.apk.viewer.diff.ApkDiffParser) DialogBuilder(com.intellij.openapi.ui.DialogBuilder)

Aggregations

ApkDiffPanel (com.android.tools.idea.apk.viewer.diff.ApkDiffPanel)1 ApkDiffParser (com.android.tools.idea.apk.viewer.diff.ApkDiffParser)1 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)1 DialogBuilder (com.intellij.openapi.ui.DialogBuilder)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1