use of com.android.tools.idea.npw.assetstudio.wizard.GenerateVectorIconModel in project android by JetBrains.
the class NewVectorAssetAction method createWizard.
@Nullable
@Override
protected ModelWizard createWizard(@NotNull AndroidFacet facet) {
Module module = facet.getModule();
Project project = module.getProject();
AndroidModuleModel androidModel = AndroidModuleModel.get(module);
if (androidModel != null) {
AndroidVersion minSdkVersion = androidModel.getMinSdkVersion();
String version = androidModel.getAndroidProject().getModelVersion();
GradleVersion revision = GradleVersion.parse(version);
if (revision.compareIgnoringQualifiers(VECTOR_ASSET_GENERATION_REVISION) < 0 && (minSdkVersion == null || minSdkVersion.getApiLevel() < VECTOR_DRAWABLE_API_LEVEL)) {
Messages.showErrorDialog(project, ERROR_MESSAGE, ERROR_TITLE);
return null;
}
}
ModelWizard.Builder wizardBuilder = new ModelWizard.Builder();
wizardBuilder.addStep(new NewVectorAssetStep(new GenerateVectorIconModel(facet), facet));
return wizardBuilder.build();
}
Aggregations