From 6d65b47794ca9b26c468308187bcbe7e1e5e2a63 Mon Sep 17 00:00:00 2001 From: James Montemagno Date: Tue, 3 Jan 2017 17:47:24 -0800 Subject: [PATCH 1/3] Add support for Round Icon #51207 --- .../Mono.Android/ActivityAttribute.Partial.cs | 6 ++++++ .../Android.App/ActivityAttribute.cs | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/ActivityAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/ActivityAttribute.Partial.cs index 97636b56c9c..4e9054265e0 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/ActivityAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/ActivityAttribute.Partial.cs @@ -24,6 +24,7 @@ partial class ActivityAttribute { bool _Immersive; bool _ResizeableActivity; bool _SupportsPictureInPicture; + string _RoundIcon; static ManifestDocumentElement mapping = new ManifestDocumentElement ("activity") { { @@ -147,6 +148,11 @@ partial class ActivityAttribute { "resizeableActivity", self => self._ResizeableActivity, (self, value) => self._ResizeableActivity = (bool) value + }, { + "RoundIcon", + "roundIcon", + self => self._RoundIcon, + (self, value) => self._RoundIcon = (string) value }, { "SupportsPictureInPicture", "supportsPictureInPicture", diff --git a/src/Xamarin.Android.NamingCustomAttributes/Android.App/ActivityAttribute.cs b/src/Xamarin.Android.NamingCustomAttributes/Android.App/ActivityAttribute.cs index 641282c7e47..cd29228cd04 100644 --- a/src/Xamarin.Android.NamingCustomAttributes/Android.App/ActivityAttribute.cs +++ b/src/Xamarin.Android.NamingCustomAttributes/Android.App/ActivityAttribute.cs @@ -53,6 +53,11 @@ public ActivityAttribute () public string Process {get; set;} #if ANDROID_24 public bool ResizeableActivity {get;set;} +#endif +#if ANDROID_25 + public string RoundIcon {get;set;} +#endif +#if ANDROID_24 public bool SupportsPictureInPicture {get;set;} #endif public ScreenOrientation ScreenOrientation {get; set;} From 9be2cde122ff203041a58874bbfde96c401cbeb3 Mon Sep 17 00:00:00 2001 From: James Montemagno Date: Tue, 3 Jan 2017 18:46:04 -0800 Subject: [PATCH 2/3] Finalize Round Icon by adding to the 9 different attributes --- src/Mono.Android/Android.App/IntentFilterAttribute.cs | 3 +++ src/Mono.Android/Android.App/PermissionAttribute.cs | 3 +++ src/Mono.Android/Android.App/PermissionGroupAttribute.cs | 3 +++ src/Mono.Android/Android.App/PermissionTreeAttribute.cs | 3 +++ .../Mono.Android/ApplicationAttribute.Partial.cs | 6 ++++++ .../Mono.Android/BroadcastReceiverAttribute.Partial.cs | 9 ++++++++- .../Mono.Android/ContentProviderAttribute.Partial.cs | 7 +++++++ .../Mono.Android/InstrumentationAttribute.Partial.cs | 7 +++++++ .../Mono.Android/IntentFilterAttribute.Partial.cs | 1 + .../Mono.Android/PermissionAttribute.Partial.cs | 9 ++++++++- .../Mono.Android/PermissionGroupAttribute.Partial.cs | 9 ++++++++- .../Mono.Android/PermissionTreeAttribute.Partial.cs | 9 ++++++++- .../Mono.Android/ServiceAttribute.Partial.cs | 8 +++++++- .../Android.App/ApplicationAttribute.cs | 3 +++ .../Android.App/InstrumentationAttribute.cs | 3 +++ .../Android.App/ServiceAttribute.cs | 3 +++ .../Android.Content/BroadcastReceiverAttribute.cs | 3 +++ .../Android.Content/ContentProviderAttribute.cs | 3 +++ 18 files changed, 87 insertions(+), 5 deletions(-) diff --git a/src/Mono.Android/Android.App/IntentFilterAttribute.cs b/src/Mono.Android/Android.App/IntentFilterAttribute.cs index 26c6c1871f8..f1d17b39c74 100644 --- a/src/Mono.Android/Android.App/IntentFilterAttribute.cs +++ b/src/Mono.Android/Android.App/IntentFilterAttribute.cs @@ -39,6 +39,9 @@ public IntentFilterAttribute (string[] actions) #if ANDROID_23 // This does not exist on https://developer.android.com/guide/topics/manifest/intent-filter-element.html but on http://developer.android.com/intl/ja/training/app-links/index.html ! (bug #35595) public bool AutoVerify {get; set;} +#endif +#if ANDROID_25 + public string RoundIcon {get; set;} #endif } } diff --git a/src/Mono.Android/Android.App/PermissionAttribute.cs b/src/Mono.Android/Android.App/PermissionAttribute.cs index 0c72383f262..0ddc296277b 100644 --- a/src/Mono.Android/Android.App/PermissionAttribute.cs +++ b/src/Mono.Android/Android.App/PermissionAttribute.cs @@ -21,6 +21,9 @@ public PermissionAttribute () public string Name {get; set;} public string PermissionGroup {get; set;} public Protection ProtectionLevel {get; set;} +#if ANDROID_25 + public string RoundIcon {get; set;} +#endif } } diff --git a/src/Mono.Android/Android.App/PermissionGroupAttribute.cs b/src/Mono.Android/Android.App/PermissionGroupAttribute.cs index 83e04d5c40d..a248556788a 100644 --- a/src/Mono.Android/Android.App/PermissionGroupAttribute.cs +++ b/src/Mono.Android/Android.App/PermissionGroupAttribute.cs @@ -19,6 +19,9 @@ public PermissionGroupAttribute () public string Icon {get; set;} public string Label {get; set;} public string Name {get; set;} +#if ANDROID_25 + public string RoundIcon {get; set;} +#endif } } diff --git a/src/Mono.Android/Android.App/PermissionTreeAttribute.cs b/src/Mono.Android/Android.App/PermissionTreeAttribute.cs index 5e4648ec637..c65dc24d064 100644 --- a/src/Mono.Android/Android.App/PermissionTreeAttribute.cs +++ b/src/Mono.Android/Android.App/PermissionTreeAttribute.cs @@ -18,6 +18,9 @@ public PermissionTreeAttribute () public string Icon {get; set;} public string Label {get; set;} public string Name {get; set;} +#if ANDROID_25 + public string RoundIcon {get; set;} +#endif } } diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/ApplicationAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/ApplicationAttribute.Partial.cs index a02b66c4251..f2e42837710 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/ApplicationAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/ApplicationAttribute.Partial.cs @@ -33,6 +33,7 @@ partial class ApplicationAttribute { bool _VMSafeMode; bool _ResizeableActivity; ICustomAttributeProvider provider; + string _RoundIcon; static ManifestDocumentElement mapping = new ManifestDocumentElement ("application") { { @@ -180,6 +181,11 @@ partial class ApplicationAttribute { "restrictedAccountType", self => self._RestrictedAccountType, (self, value) => self._RestrictedAccountType = (string) value + }, { + "RoundIcon", + "roundIcon", + self => self._RoundIcon, + (self, value) => self._RoundIcon = (string) value }, { "SupportsRtl", "supportsRtl", diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/BroadcastReceiverAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/BroadcastReceiverAttribute.Partial.cs index 57845b9984f..030476975f7 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/BroadcastReceiverAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/BroadcastReceiverAttribute.Partial.cs @@ -11,6 +11,8 @@ namespace Android.Content { partial class BroadcastReceiverAttribute { + + string _RoundIcon; static ManifestDocumentElement mapping = new ManifestDocumentElement ("receiver") { { @@ -53,7 +55,12 @@ partial class BroadcastReceiverAttribute { "process", self => self.Process, (self, value) => self.Process = (string) value - }, + }, { + "RoundIcon", + "roundIcon", + self => self._RoundIcon, + (self, value) => self._RoundIcon = (string) value + }, }; diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/ContentProviderAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/ContentProviderAttribute.Partial.cs index dd6893d935c..773c1dc2470 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/ContentProviderAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/ContentProviderAttribute.Partial.cs @@ -12,6 +12,8 @@ namespace Android.Content { partial class ContentProviderAttribute { + string _RoundIcon; + static ManifestDocumentElement mapping = new ManifestDocumentElement ("provider") { { "Authorities", @@ -78,6 +80,11 @@ partial class ContentProviderAttribute { "readPermission", self => self.ReadPermission, (self, value) => self.ReadPermission = (string) value + }, { + "RoundIcon", + "roundIcon", + self => self._RoundIcon, + (self, value) => self._RoundIcon = (string) value }, { "Syncable", "syncable", diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/InstrumentationAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/InstrumentationAttribute.Partial.cs index 2cda53e0bd5..a8c1e40eaac 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/InstrumentationAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/InstrumentationAttribute.Partial.cs @@ -11,6 +11,8 @@ namespace Android.App { partial class InstrumentationAttribute { + + string _RoundIcon; static ManifestDocumentElement mapping = new ManifestDocumentElement ("instrumentation") { { @@ -38,6 +40,11 @@ partial class InstrumentationAttribute { "name", self => self.Name, (self, value) => self.Name = (string) value + }, { + "RoundIcon", + "roundIcon", + self => self._RoundIcon, + (self, value) => self._RoundIcon = (string) value }, { "TargetPackage", "targetPackage", diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/IntentFilterAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/IntentFilterAttribute.Partial.cs index 260b291eec8..d63e7d71937 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/IntentFilterAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/IntentFilterAttribute.Partial.cs @@ -13,6 +13,7 @@ namespace Android.App { partial class IntentFilterAttribute { bool _AutoVerify; + string _RoundIcon; static readonly Dictionary attributeMappings = new Dictionary () { { "Icon", "icon" }, diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionAttribute.Partial.cs index e791dfd3f30..9ca4894a9e5 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionAttribute.Partial.cs @@ -17,6 +17,8 @@ namespace Android.App { partial class PermissionAttribute { + string _RoundIcon; + static ManifestDocumentElement mapping = new ManifestDocumentElement ("permission") { { "Description", @@ -48,7 +50,12 @@ partial class PermissionAttribute { "protectionLevel", self => self.ProtectionLevel, (self, value) => self.ProtectionLevel = (Protection) value - }, + }, { + "RoundIcon", + "roundIcon", + self => self._RoundIcon, + (self, value) => self._RoundIcon = (string) value + }, }; ICollection specified; diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionGroupAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionGroupAttribute.Partial.cs index a12c8b82c23..01385700c74 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionGroupAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionGroupAttribute.Partial.cs @@ -16,6 +16,8 @@ namespace Android.App { partial class PermissionGroupAttribute { + + string _RoundIcon; static ManifestDocumentElement mapping = new ManifestDocumentElement ("permission") { { @@ -38,7 +40,12 @@ partial class PermissionGroupAttribute { "name", self => self.Name, (self, value) => self.Name = (string) value - }, + }, { + "RoundIcon", + "roundIcon", + self => self._RoundIcon, + (self, value) => self._RoundIcon = (string) value + }, }; ICollection specified; diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionTreeAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionTreeAttribute.Partial.cs index b7122205512..fa97ec3c158 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionTreeAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionTreeAttribute.Partial.cs @@ -16,6 +16,8 @@ namespace Android.App { partial class PermissionTreeAttribute { + + string _RoundIcon; static ManifestDocumentElement mapping = new ManifestDocumentElement ("permission") { { @@ -33,7 +35,12 @@ partial class PermissionTreeAttribute { "name", self => self.Name, (self, value) => self.Name = (string) value - }, + }, { + "RoundIcon", + "roundIcon", + self => self._RoundIcon, + (self, value) => self._RoundIcon = (string) value + }, }; ICollection specified; diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/ServiceAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/ServiceAttribute.Partial.cs index 2939d05e6c4..e44ed0e8d2b 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/ServiceAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/ServiceAttribute.Partial.cs @@ -13,6 +13,7 @@ namespace Android.App { partial class ServiceAttribute { bool _IsolatedProcess; + string _RoundIcon; static ManifestDocumentElement mapping = new ManifestDocumentElement ("service") { { @@ -60,7 +61,12 @@ partial class ServiceAttribute { "process", self => self.Process, (self, value) => self.Process = (string) value - }, + }, { + "RoundIcon", + "roundIcon", + self => self._RoundIcon, + (self, value) => self._RoundIcon = (string) value + }, }; ICollection specified; diff --git a/src/Xamarin.Android.NamingCustomAttributes/Android.App/ApplicationAttribute.cs b/src/Xamarin.Android.NamingCustomAttributes/Android.App/ApplicationAttribute.cs index 19adc3bce55..3de483e937b 100644 --- a/src/Xamarin.Android.NamingCustomAttributes/Android.App/ApplicationAttribute.cs +++ b/src/Xamarin.Android.NamingCustomAttributes/Android.App/ApplicationAttribute.cs @@ -60,6 +60,9 @@ public ApplicationAttribute () #if ANDROID_18 public string RestrictedAccountType {get; set;} #endif +#if ANDROID_25 + public string RoundIcon {get; set;} +#endif #if ANDROID_17 public bool SupportsRtl {get; set;} #endif diff --git a/src/Xamarin.Android.NamingCustomAttributes/Android.App/InstrumentationAttribute.cs b/src/Xamarin.Android.NamingCustomAttributes/Android.App/InstrumentationAttribute.cs index c7a705eb484..27a8207cdf0 100644 --- a/src/Xamarin.Android.NamingCustomAttributes/Android.App/InstrumentationAttribute.cs +++ b/src/Xamarin.Android.NamingCustomAttributes/Android.App/InstrumentationAttribute.cs @@ -17,6 +17,9 @@ public InstrumentationAttribute () public string Icon {get; set;} public string Label {get; set;} public string Name {get; set;} +#if ANDROID_25 + public string RoundIcon {get; set;} +#endif public string TargetPackage {get; set;} } } diff --git a/src/Xamarin.Android.NamingCustomAttributes/Android.App/ServiceAttribute.cs b/src/Xamarin.Android.NamingCustomAttributes/Android.App/ServiceAttribute.cs index 384d7d4813d..d3aaef17952 100644 --- a/src/Xamarin.Android.NamingCustomAttributes/Android.App/ServiceAttribute.cs +++ b/src/Xamarin.Android.NamingCustomAttributes/Android.App/ServiceAttribute.cs @@ -29,5 +29,8 @@ public ServiceAttribute () public string Label {get; set;} public string Permission {get; set;} public string Process {get; set;} +#if ANDROID_25 + public string RoundIcon {get; set;} +#endif } } diff --git a/src/Xamarin.Android.NamingCustomAttributes/Android.Content/BroadcastReceiverAttribute.cs b/src/Xamarin.Android.NamingCustomAttributes/Android.Content/BroadcastReceiverAttribute.cs index 28ed046b93f..b84d8c54107 100644 --- a/src/Xamarin.Android.NamingCustomAttributes/Android.Content/BroadcastReceiverAttribute.cs +++ b/src/Xamarin.Android.NamingCustomAttributes/Android.Content/BroadcastReceiverAttribute.cs @@ -20,5 +20,8 @@ public BroadcastReceiverAttribute () public string Name {get; set;} public string Permission {get; set;} public string Process {get; set;} +#if ANDROID_25 + public string RoundIcon {get; set;} +#endif } } diff --git a/src/Xamarin.Android.NamingCustomAttributes/Android.Content/ContentProviderAttribute.cs b/src/Xamarin.Android.NamingCustomAttributes/Android.Content/ContentProviderAttribute.cs index 3675ebc3822..c930ba9d11b 100644 --- a/src/Xamarin.Android.NamingCustomAttributes/Android.Content/ContentProviderAttribute.cs +++ b/src/Xamarin.Android.NamingCustomAttributes/Android.Content/ContentProviderAttribute.cs @@ -32,6 +32,9 @@ public ContentProviderAttribute (string[] authorities) public string Permission {get; set;} public string Process {get; set;} public string ReadPermission {get; set;} +#if ANDROID_25 + public string RoundIcon {get; set;} +#endif public bool Syncable {get; set;} public string WritePermission {get; set;} } From 5e4b7781223db8c6d2cb13ce6ea0d11708265ff0 Mon Sep 17 00:00:00 2001 From: James Montemagno Date: Tue, 3 Jan 2017 18:46:13 -0800 Subject: [PATCH 3/3] Add to IntentFilter --- .../Mono.Android/IntentFilterAttribute.Partial.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/IntentFilterAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/IntentFilterAttribute.Partial.cs index d63e7d71937..07527c73d52 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/IntentFilterAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/IntentFilterAttribute.Partial.cs @@ -49,6 +49,7 @@ partial class IntentFilterAttribute { { "DataPorts", (self, value) => self.DataPorts = ToStringArray (value) }, { "DataSchemes", (self, value) => self.DataSchemes = ToStringArray (value) }, { "AutoVerify", (self, value) => self._AutoVerify = (bool) value }, + { "RoundIcon", (self, value) => self._RoundIcon = (string) value }, }; static string[] ToStringArray (object value)