use of com.android.sdklib.repository.IdDisplay in project android by JetBrains.
the class SystemImagePreview method setImage.
/**
* Set the image to display.
*/
public void setImage(@Nullable SystemImageDescription image) {
myImageDescription = image;
myHaxmAlert.setSystemImageDescription(image);
((CardLayout) myRootPanel.getLayout()).show(myRootPanel, NO_IMAGE_CONTENT);
if (image != null) {
((CardLayout) myRootPanel.getLayout()).show(myRootPanel, MAIN_CONTENT);
AndroidVersion version = image.getVersion();
if (version == null) {
return;
}
int apiLevel = version.getApiLevel();
myApiLevelListener.setApiLevel(apiLevel);
String codeName = SdkVersionInfo.getCodeName(myImageDescription.getVersion().getApiLevel());
if (codeName != null) {
myReleaseName.setText(codeName);
}
Icon icon = getIcon(codeName);
if (icon != null) {
myReleaseIcon.setIcon(icon);
}
myApiLevel.setText(image.getVersion().getApiString());
myAndroidVersion.setVisible(!image.getVersion().isPreview());
myAndroidVersion.setText(SdkVersionInfo.getVersionString(apiLevel));
String vendorName;
IdDisplay tag = myImageDescription.getTag();
if (tag.getId().equals("android-wear") || tag.getId().equals("android-tv")) {
vendorName = "Android";
} else {
vendorName = myImageDescription.getVendor();
}
myVendor.setText("<html>" + vendorName + "</html>");
myAbi.setText(myImageDescription.getAbiType());
}
}
use of com.android.sdklib.repository.IdDisplay in project android by JetBrains.
the class AndroidVersionsInfo method getTag.
/**
* Return the tag for the specified repository package.
* We are only interested in 2 package types.
*/
@Nullable
private static IdDisplay getTag(@NotNull RepoPackage repoPackage) {
TypeDetails details = repoPackage.getTypeDetails();
IdDisplay tag = NO_MATCH;
if (details instanceof DetailsTypes.AddonDetailsType) {
tag = ((DetailsTypes.AddonDetailsType) details).getTag();
}
if (details instanceof DetailsTypes.SysImgDetailsType) {
DetailsTypes.SysImgDetailsType imgDetailsType = (DetailsTypes.SysImgDetailsType) details;
if (imgDetailsType.getAbi().equals(SdkConstants.CPU_ARCH_INTEL_ATOM)) {
tag = imgDetailsType.getTag();
}
}
return tag;
}
use of com.android.sdklib.repository.IdDisplay in project android by JetBrains.
the class LaunchEmulatorDialog method doOKAction.
@Override
protected void doOKAction() {
final PropertiesComponent properties = PropertiesComponent.getInstance(myFacet.getModule().getProject());
final IdDisplay selectedAvd = (IdDisplay) myAvdCombo.getComboBox().getSelectedItem();
if (selectedAvd != null) {
properties.setValue(SELECTED_AVD_PROPERTY, selectedAvd.getId());
} else {
properties.unsetValue(SELECTED_AVD_PROPERTY);
}
super.doOKAction();
}
Aggregations