Search in sources :

Example 11 with IdDisplay

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());
    }
}
Also used : IdDisplay(com.android.sdklib.repository.IdDisplay) AndroidVersion(com.android.sdklib.AndroidVersion)

Example 12 with IdDisplay

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;
}
Also used : TypeDetails(com.android.repository.impl.meta.TypeDetails) IdDisplay(com.android.sdklib.repository.IdDisplay) DetailsTypes(com.android.sdklib.repository.meta.DetailsTypes) Nullable(org.jetbrains.annotations.Nullable)

Example 13 with IdDisplay

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();
}
Also used : IdDisplay(com.android.sdklib.repository.IdDisplay) PropertiesComponent(com.intellij.ide.util.PropertiesComponent)

Aggregations

IdDisplay (com.android.sdklib.repository.IdDisplay)13 Module (com.intellij.openapi.module.Module)3 Nullable (org.jetbrains.annotations.Nullable)3 TypeDetails (com.android.repository.impl.meta.TypeDetails)2 AndroidVersion (com.android.sdklib.AndroidVersion)2 AvdInfo (com.android.sdklib.internal.avd.AvdInfo)2 DetailsTypes (com.android.sdklib.repository.meta.DetailsTypes)2 TextProperty (com.android.tools.idea.ui.properties.swing.TextProperty)2 AndroidFacet (org.jetbrains.android.facet.AndroidFacet)2 AndroidDebugBridge (com.android.ddmlib.AndroidDebugBridge)1 IDevice (com.android.ddmlib.IDevice)1 State (com.android.sdklib.devices.State)1 AvdManager (com.android.sdklib.internal.avd.AvdManager)1 AvdComboBox (com.android.tools.idea.run.AvdComboBox)1 LaunchCompatibility (com.android.tools.idea.run.LaunchCompatibility)1 StringToDoubleAdapterProperty (com.android.tools.idea.ui.properties.adapters.StringToDoubleAdapterProperty)1 StringToIntAdapterProperty (com.android.tools.idea.ui.properties.adapters.StringToIntAdapterProperty)1 SelectedItemProperty (com.android.tools.idea.ui.properties.swing.SelectedItemProperty)1 SelectedProperty (com.android.tools.idea.ui.properties.swing.SelectedProperty)1 Result (com.android.tools.idea.ui.validation.Validator.Result)1