Class AdaptiveIconsInfo
Contains values for configuring the Android Adaptive Icon. An Adaptive Launcher Icon represents the application icon on the device's Home Screen and in the launcher window on devices running Android 8 and above. Please see Android Documentation for more details on Adaptive Icon.
Implements
Namespace: UnityEngine .Localization.Platform.Android
Assembly: Unity.Localization.dll
Syntax
[DisplayName("Android Adaptive Icon Info", null)]
[Serializable]
public class AdaptiveIconsInfo : IMetadata
Examples
This example shows how to configure the Android App Info. Note: You must complete this configuration before the application is built, otherwise, the changes will not be applied.
using UnityEditor;
using UnityEngine.Localization;
using UnityEngine.Localization.Platform.Android;
using UnityEngine.Localization.Settings;
public class AndroidAppInfoExample
{
[MenuItem("Localization/Configure Android App Info")]
public static void ConfigureAppInfo()
{
var appInfo = LocalizationSettings.Metadata.GetMetadata<AppInfo>();
if (appInfo == null)
{
appInfo = new AppInfo();
LocalizationSettings.Metadata.AddMetadata(appInfo);
}
appInfo.DisplayName = new LocalizedString("My Table", "My Display Name");
EditorUtility.SetDirty(LocalizationSettings.Instance);
}
[MenuItem("Localization/Configure Android Icon Info")]
public static void ConfigureIconInfo()
{
var iconInfo = LocalizationSettings.Metadata.GetMetadata<AdaptiveIconsInfo>();
if (iconInfo == null)
{
iconInfo = new AdaptiveIconsInfo();
LocalizationSettings.Metadata.AddMetadata(iconInfo);
}
iconInfo.AdaptiveHdpi = new AdaptiveIcon
{
Background = new LocalizedTexture { TableReference = "My Textures", TableEntryReference = "Hdpi Background" },
Foreground = new LocalizedTexture { TableReference = "My Textures", TableEntryReference = "Hdpi Foreground" }
};
EditorUtility.SetDirty(LocalizationSettings.Instance);
}
}
Properties
Name | Description |
---|---|
Adaptive |
Contains resources for high-density (hdpi) screens (~240dpi) that can be localized in the Android Application Please see Android Documentation for more details on density qualifiers. |
Adaptive |
Contains resources for low-density (ldpi) screens (~120dpi) that can be localized in the Android Application Please see Android Documentation for more details on density qualifiers. |
Adaptive |
Contains resources for medium-density (mdpi) screens (~160dpi) that can be localized in the Android Application Please see Android Documentation for more details on density qualifiers. |
Adaptive |
Contains resources for extra-extra-high-density (xxhdpi) screens (~480dpi) that can be localized in the Android Application Please see Android Documentation for more details on density qualifiers. |
Adaptive |
Contains resources for extra-extra-extra-high-density (xxxhdpi) uses (~640dpi) that can be localized in the Android Application Please see Android Documentation for more details on density qualifiers. |
Adaptive |
Contains resources for extra-high-density (xhdpi) screens (~320dpi) that can be localized in the Android Application Please see Android Documentation for more details on density qualifiers. |