# AdaptiveIcons

> Holds one localized Android adaptive launcher icon per screen density.

## Definition

* **Type:** Class
* **Namespace:** [Unity.Localization.Android](/engine/7000.0/script-reference/unity/localization/android.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

```csharp
public class AdaptiveIcons
```

## Remarks

An adaptive icon is a background and a foreground layer the operating system composes and masks to whatever shape the launcher uses, so a density needs both layers to be usable. Assign both layers at every density: Unity writes a locale only when the whole set resolves, because mixing a layer from one density with a layer scaled from another distorts the icon, and a partial set would still outrank the Player Settings icons for that locale. Android 8.0 introduced adaptive icons, so populate [AppInfo.LegacyIcons](/engine/7000.0/script-reference/unity/localization/android/appinfo/legacyicons.md) as well to cover older devices.

Additional Resources: [AppInfo](/engine/7000.0/script-reference/unity/localization/android/appinfo.md), [Icons](/engine/7000.0/script-reference/unity/localization/android/icons.md), [IconDensity](/engine/7000.0/script-reference/unity/localization/android/icondensity.md)

Assign a localized adaptive icon for one density.

## Examples

```csharp
using Unity.Localization;
using Android = Unity.Localization.Android;

namespace Unity.Localization.Samples
{
    public class AndroidAdaptiveIconsExample
    {
        // Both layers at every density, or the locale keeps the icons from the Player Settings.
        static readonly (Android.IconDensity density, string suffix)[] k_Densities =
        {
            (Android.IconDensity.Low, "ldpi"),
            (Android.IconDensity.Medium, "mdpi"),
            (Android.IconDensity.High, "hdpi"),
            (Android.IconDensity.ExtraHigh, "xhdpi"),
            (Android.IconDensity.ExtraExtraHigh, "xxhdpi"),
            (Android.IconDensity.ExtraExtraExtraHigh, "xxxhdpi")
        };

        public void Run(Android.AppInfo appInfo)
        {
            var icons = appInfo.AdaptiveIcons;
            foreach (var (density, suffix) in k_Densities)
            {
                icons.Background.GetIcon(density).SetReference("App Icons", $"Icon Background {suffix}");
                icons.Foreground.GetIcon(density).SetReference("App Icons", $"Icon Foreground {suffix}");
            }
        }
    }
}
```

## Properties

| Property                                                                                             | Description                                                                                       |
| ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [Background](/engine/7000.0/script-reference/unity/localization/android/adaptiveicons/background.md) | The layer drawn behind the foreground, which the launcher may move to animate the icon.           |
| [Foreground](/engine/7000.0/script-reference/unity/localization/android/adaptiveicons/foreground.md) | The layer drawn on top of the background, holding the part of the icon that should stay readable. |

## Methods

| Method                                                                                         | Description                                          |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| [IsEmpty](/engine/7000.0/script-reference/unity/localization/android/adaptiveicons/isempty.md) | Reports whether no density has both layers assigned. |
