diff options
author | Softlion (Benjamin Mayrargue) <benjamin@vapolia.fr> | 2017-09-12 16:09:38 +0200 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-10-23 13:30:51 +0900 |
commit | a5689472ef1fe9c2f301adf61d167dcc6fd95242 (patch) | |
tree | 7d3ba533a80c2e4abca5d558516709fa742f6ff0 /Xamarin.Forms.Platform.Android/ResourceManager.cs | |
parent | 89ae5eca1b8fabc6431fdc42c7cc1f96ff708bc6 (diff) | |
download | xamarin-forms-a5689472ef1fe9c2f301adf61d167dcc6fd95242.tar.gz xamarin-forms-a5689472ef1fe9c2f301adf61d167dcc6fd95242.tar.bz2 xamarin-forms-a5689472ef1fe9c2f301adf61d167dcc6fd95242.zip |
Enables custom images (especially SVG) through the new IImageSourceHandler to work with tab bar icons on Android (like it does on iOS). And also on cell adapters and navigation page menu. (#1130)
Diffstat (limited to 'Xamarin.Forms.Platform.Android/ResourceManager.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Android/ResourceManager.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Android/ResourceManager.cs b/Xamarin.Forms.Platform.Android/ResourceManager.cs index 402e52be..f09f9978 100644 --- a/Xamarin.Forms.Platform.Android/ResourceManager.cs +++ b/Xamarin.Forms.Platform.Android/ResourceManager.cs @@ -24,6 +24,11 @@ namespace Xamarin.Forms.Platform.Android if(drawable == null) { var bitmap = GetBitmap(resource, file) ?? BitmapFactory.DecodeFile(file); + if (bitmap == null) + { + var source = Registrar.Registered.GetHandler<IImageSourceHandler>(fileImageSource.GetType()); + bitmap = source.LoadImageAsync(fileImageSource, Forms.Context).GetAwaiter().GetResult(); + } if (bitmap != null) drawable = new BitmapDrawable(resource, bitmap); } |